Expand/Shrink

IupGLCanvasBox

Definition: include pGUI.e

Ihandle ih = IupGLCanvasBox(Ihandles children, string attributes="", dword_seq args={})
Description: Creates an OpenGL canvas container. It inherits from IupGLCanvas.

children: List of the identifiers that will be placed in the box. It can be {}. For more information on the attributes and args parameters see IupSetAttributes.

Returns: the identifier of the created element.
pwa/p2js: Not supported.
See Also: IupCanvas, IupGLCanvas
Notes: This is an additional control that depends on the OpenGL library. It is included in the IupGLControls library.

To use the controls available in the IupGLControls library inside your OpenGL canvas you must replace the IupGLCanvas by the IupGLCanvasBox element.

It can have any number of children. Controls from the IupGLControls library can be used as children along with the void containers such as IupHbox, IupVbox, and so on, including IupFill. Native elements can also be placed on top although they will not be clipped by IupGLFrame and other IupGlControls containers.

The elements that are a direct child of the box can be positioned using the VERTICALALIGN and/or HORIZONTALALIGN attributes, or using a position in pixels relative to the top left corner of the box by setting the attribute POSITION.

Each direct children will be sized to its natural size by default, except if EXPANDHORIZONTAL or EXPANDVERTICAL are set.

The box can be created with no elements and filled dynamically using IupAppend() or IupInsert().
Attributes: The IupGLCanvasBox element handle all attributes defined for an OpenGL canvas and a conventional canvas, see IupGLCanvas and IupCanvas.
MARGIN (non inheritable) Defines a margin in pixels.
Its value has the format "widthxheight", where width and height are integer values corresponding to the horizontal and vertical margins, respectively.
Default: "0x0" (no margin).
REDRAW (non inheritable, write-only) force a full redraw of all elements and the main canvas.
Attributes: (at Children)
HORIZONTALALIGN (non inheritable, at children only): Horizontally aligns the element inside the box.
Possible values: "ALEFT", "ACENTER", "ARIGHT" or "FLOAT". Default: "FLOAT".
When FLOAT is used its horizontal position is obtained from the POSITION attribute.
VERTICALALIGN (non inheritable, at children only): Vertically aligns the element inside the box.
Possible values: "ATOP", "ACENTER", "ABOTTOM" or "FLOAT". Default: "FLOAT".
When FLOAT is used its vertical position is obtained from the POSITION attribute.
EXPANDHORIZONTAL (non inheritable, at children only): Expand the horizontal size of the element to the box width. Can be Yes or No. Default: No. (since 3.13)
EXPANDVERTICAL (non inheritable, at children only): Expand the vertical size of the element to the box height. Can be Yes or No. Default: No. (since 3.13)
also CLIENTSIZE, CLIENTOFFSET: also accepted.
Callbacks The IupGLCanvasBox element understands all callbacks defined for the IupGLCanvas.

But since it has to forward the mouse and action callbacks to the IupGLControls elements when it is mapped the callbacks ACTION, BUTTON_CB, MOTION_CB, WHEEL_CB, and LEAVEWINDOW_CB are replaced by internal callbacks. The application callbacks will still be called and they can be retrieved by using the prefix "APP_" on the callback name. If for some reason the application set one of these callbacks after being mapped, the box internal callback can be retrieved by using the prefix "GLBOX_" on the callback name.

Keyboard focus is NOT processed for IupGLCanvasBox children.

The IupGLCanvas SWAPBUFFERS_CB callback is used internally to enable a correct display for the box children. This means that when the application calls IupGLSwapBuffers, then children will be drawn before actually swapping the double buffer.