IupGLExpander (since 3.11)

Creates an embedded OpenGL container that can interactively show or hide its child. It inherits from IupGLSubCanvas. It exists only inside an IupGLCanvasBox.

Creation

Ihandle* IupGLExpander(Ihandle* child); [in C]
iup.glexpander{child: ihandle} -> (elem: ihandle) [in Lua]
glexpander(child) [in LED]

child: Identifier of an interface element. It can be NULL (nil in Lua), or empty in LED.

Returns: the identifier of the created element, or NULL if an error occurs.

Attributes

The IupGLExpander element handle all attributes defined for a IupGLSubCanvas control.


BACKCOLOR (non inheritable): background color of the title area. Default: "50 100 150".

BARPOSITION: indicates the bar handler position. Possible values are "TOP", "BOTTOM", "LEFT" or "RIGHT". Default: "TOP".

BARSIZE (non inheritable): controls the size of the bar handler. Default: the height of a text line plus 5 pixels.

EXPAND (non inheritable): the default value is "YES".

EXTRABUTTONS (non inheritable): sets the number of extra image buttons at right when BARPOSITION=TOP. The maximum number of buttons is 3. See the EXTRABUTTON_CB callback. Default: 0.

IMAGEEXTRAid: image name used for the button. id can be 1, 2 or 3. 1 is the rightmost button, and count from right to left.
IMAGEEXTRAPRESSid: image name used for the button when pressed.
IMAGEEXTRAHIGHLIGHTid: image name for the button used when mouse is over the button area.

All images must be 16x16, or smaller but the occupied size will still be 16x16.

FORECOLOR (non inheritable): text and arrow color. Default: "255 255 255".

HIGHCOLOR (non inheritable): text and arrow color when highlight. Default: "200 225 245".

IMAGE (non inheritable): image name to replace the arrow by an image STATE=CLOSE. Works only when BARPOSITION=TOP. The minimum horizontal space reserved for the handler is 20 pixels. Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage.

IMAGEOPEN: image name used when STATE=OPEN.
IMAGEHIGHLIGHT: image name used when mouse is over the bar handler and STATE=CLOSE.
IMAGEOPENHIGHLIGHT: image name used when mouse is over the bar handler and STATE=OPEN.

MOVEABLE (non inheritable): enable the frame to be interactively moved when it is a direct child of the IupGLCanvasBox. Default: NO.

MOVETOTOP (non inheritable): when MOVEABLE=Yes and the frame is moved then its ZORDER is also set to TOP. (Since 3.11.1)

PRESSCOLOR (non inheritable): text and arrow color when pressed. Default: "150 200 235".

STATE (non inheritable): Show or hide the container elements. Possible values: "OPEN" (expanded) or "CLOSE" (collapsed). Default: OPEN. Setting this attribute will automatically change the layout of the entire dialog so the child can be recomposed.

TITLE (non inheritable): title text, shown in the title bar near the expand or collapse symbol. Shown only when BARPOSITION=TOP.

TITLEBACKIMAGE (non inheritable): image name to be used as a background of the title area. It will be zoomed to fill the background (it does not includes the border). Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage. (Since 3.11.1)

TITLEBACKIMAGEINACTIVE (non inheritable): background image name of the element when inactive. If it is not defined then the TITLEBACKIMAGE is used and its colors will be replaced by a modified version creating the disabled effect.  (Since 3.11.2)


CLIENTSIZE, CLIENTOFFSET: also accepted.

Callbacks

The IupGLFrame element handle all callbacks defined for the IupGLSubCanvas control.


ACTION: Action generated after the expander state is interactively changed.

int function(Ihandle* ih); [in C]
elem:action() -> (ret: number) [in Lua]

ih: identifier of the element that activated the event. 

MOVE_CB: Called after the frame was moved on the IupGLCanvasBox, when MOVEABLE=Yes. The coordinates are the same as the POSITION attribute.

int function(Ihandle *ih, int x, int y); [in C]
elem:trayclick_cb(x, y: number) -> (ret: number) [in Lua]

ih: identifier of the element that activated the event.
x, y: coordinates of the new position.

OPENCLOSE_CB: Action generated before the expander state is interactively changed.

int function(Ihandle* ih, int state); [in C]
elem:openclose_cb(state: number) -> (ret: number) [in Lua]

ih: identifier of the element that activated the event. 
state: new state to be applied.

Returns: if return IUP_IGNORE the new state is ignored.

EXTRABUTTON_CB: Action generated when any mouse button is pressed and released.

int function(Ihandle* ih, int button, int pressed); [in C]
elem:extrabutton_cb(button, pressed: number) -> (ret: number) [in Lua]

ih: identifies the element that activated the event.
button: identifies the extra button. can be 1, 2 or 3. (this is not the same as BUTTON_CB)
pressed: indicates the state of the button:

0 - mouse button was released;
1 - mouse button was pressed.

Notes

The container can be created with no elements and be dynamic filled using IupAppend or IupInsert.

When the TITLE is defined and BARPOSITION=TOP then the expand/collapse symbol is left aligned. In all other situations the expand/collapse symbol is centered.