IupDetachBox

Definition: include pGUI.e

Ihandle ih = IupDetachBox(Ihandln child=NULL, [[nullable_string action=NULL,] cbfunc func=NULL,] string attributes="", sequence data={})
Description: Creates a detachable void container.
Dragging and dropping this element creates a new dialog composed by its child or elements arranged in it (for example, a child like IupVbox or IupHbox).

It does not have a native representation, but it contains an IupCanvas to implement the bar handler.

child: Identifier of an interface element that will receive the box. It can be NULL.
action: Name of the action generated when the box is detached, typically/traditionally/defaults to "DETACHED_CB".
func: a callback address, usually specified as Icallback("name").
For more information on the attributes and data parameters see IupSetAttributes.
This is a paranormalised function.

Returns: the identifier of the created element.
Notes: The box can be created with no elements and filled dynamically using IupAppend() or IupInsert().
Attributes:
BARSIZE (non inheritable) controls the size of the bar handler. To completely hide the bar set BARSIZE to 0. Default: 10.
COLOR Changes the color of the bar grip affordance. The value should be given in "R G B" color style.
Default: "160 160 160". When SHOWGRIP = NO, this attribute sets the background color of the bar handler.
EXPAND (non inheritable) The default value is "YES".
ORIENTATION (creation only) Indicates the orientation of the bar handler.
The direction of the resize is perpendicular to the orientation.
Possible values are "VERTICAL" or "HORIZONTAL". Default: "VERTICAL".
OLDPARENT_HANDLE (read only) returns the previous parent of the detached element. Only valid after the element was detached.
OLDBROTHER_HANDLE (read only) returns the previous reference child of the detached element. Only valid after the element was detached.
See IupReparent for a reference child definition.
DETACH (write-only) detach the box by creating a new dialog and placing the detachbox as the child of the new dialog.
The DETACHED_CB callback is called, use it to configure the new dialog.
The handler is hidden, the USERSIZE of the detachbox is set to the CURRENTSIZE of the child, and the PARENTDIALOG of the new dialog is set to old dialog.
To re-parent the child we need to map the dialog before doing it, so to force a dialog resize its size is reset before it is shown, to control the dialog size use the child size.
The new dialog is show at the current cursor position, and the USERSIZE of the detachbox is reset.
RESTORE (write-only) restore the box to its previous place (parent and brother) and destroys the new dialog.
Value can be NULL or can be the name of a new parent when the control will be appended.
Use IupSetHandle or IupSetAttributeHandle to associate an Ihandle to a name.
The handler is shown (if restored to inside a zbox, the application must update the zbox child visibility manually).
SHOWGRIP (non inheritable) Shows the bar grip affordance. Default: YES.
When set to NO, the BARSIZE is set to 5 (if greater than 5).
To completely hide the bar set BARSIZE to 0 (since 3.16).
WID (read-only) returns -1 if mapped.
also FONT, SIZE, RASTERSIZE, CLIENTSIZE, CLIENTOFFSET, POSITION, MINSIZE, MAXSIZE: also accepted.
Callbacks:
DETACHED_CB Callback called when the box is detached.

function detached_cb(Ihandle ih, Ihandle new_parent, integer x, integer y)
ih: identifier of the element that activated the event.
new_parent: identifier of the future parent of the box. At this point only the PARENTDIALOG attribute was set.
x, y: dropped position.

Returns: IUP_IGNORE will be processed, in order to cancel the detach action.
Examples: The following is demo\pGUI\detachbox.exw

IupDetachBox (ORIENTATION = VERTICAL)

New dialog created after the detach action