OEAddSVGToggle

bool OEAddSVGToggle(OESVGGroup *area, OESVGGroup *target, bool on = false)

Adds a toggle effect to the objects drawn between the two given groups. When clicking on the objects drawn inside the area group the objects drawn in the target group appear / disappear.

on

The parameter that determine whether the objects drawn inside the target group are displayed initially.

Note

This functionality is only available for .svg image format.

Example:

OESVGGroup toggle_area = image.NewSVGGroup("toggle_area");
OESVGGroup target_area = image.NewSVGGroup("toggle_target_area");

oedepict.OEAddSVGToggle(toggle_area, target_area);

image.PushGroup(toggle_area);
image.DrawRectangle(new OE2DPoint(30, 30), new OE2DPoint(70, 70), oedepict.getOERedBoxPen());
image.PopGroup(toggle_area);

image.PushGroup(target_area);
image.DrawCircle(new OE2DPoint(150, 50), 30, oedepict.getOEBlueBoxPen());
image.PopGroup(target_area);

oedepict.OEAddInteractiveIcon(image);

oedepict.OEWriteImage("AddSVGToggle.svg", image);

Download code

AddSVGToggle.java

Hint

The OEAddSVGToggle function should always be called prior to pushing / popping the OESVGGroup objects.

click on the red rectangle below

Example of using the OEAddSVGToggle function

../../_images/AddSVGToggle.svg