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:

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

oedepict.OEAddSVGToggle(toggle_area, target_area)

image.PushGroup(toggle_area)
image.DrawRectangle(oedepict.OE2DPoint(30, 30),
                    oedepict.OE2DPoint(70, 70), oedepict.OERedBoxPen)
image.PopGroup(toggle_area)

image.PushGroup(target_area)
image.DrawCircle(oedepict.OE2DPoint(150, 50), 30, oedepict.OEBlueBoxPen)
image.PopGroup(target_area)

oedepict.OEAddInteractiveIcon(image)

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

Download code

AddSVGToggle.py

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