IupTabs - controle

IUP - Portable User Interface

IupTabs

Creates a Tabs element. Allows a single dialog to have several screens, grouping options. The grouping is done in a single line of tabs arranged according to the tab type. It inherits from IupCanvas. It contains a IupZbox to control the groups of controls.

Parameters/Return

Ihandle* IupTabs(Ihandle* elem1, Ihandle* elem2, ...); [in C]
Ihandle* IupTabsv(Ihandle** elems); [in C]
iuptabs{elem1, elem2, ...: iuplua_tag} -> (elem: iuplua_tag) [in IupLua3]
iup.tabs{elem1, elem2, ...: iuplua_tag} -> (elem: iuplua_tag) [in IupLua5]
tabs(elem1, elem2, ...) [in LED]

elem1, elem2, ...: This function receives as parameters the elements that will be transformed into Tabs. Each of such elements must have a "TABTITLE" attribute, specifying the text to be shown in its tab's title. If this attribute is omitted, the Tabs behavior is undetermined.

This function returns the created Tabs's identifier, or NULL if an error occurs. The second form in C must end the array with a NULL.

Attributes

ALIGNMENT: Changes the respective attribute in the internal zbox.

TABTITLE: Contains the text to be shown in the tab's title. If this value is NULL, it will remain empty. This attribute is used only in the elements contained in the tab.

TABTYPE: Indicates the type of tab, which can be one of the following:

"TOP", "BOTTOM", "LEFT" or "RIGHT". Default is "TOP".

FONT: Indicates the font to be used in the internal tab text. Font Table

FONT_ACTIVE: Indicates the font to be used when the tab is selected. Font Table

FONT_INACTIVE: Indicates the font to be used when the tab is inactive. Font Table

TABSIZE: Contains the size of a tab. If this value is NULL, the tab will be shown with the smallest possible value that fits its title. This size can refer to the whole IupTabs, thus affecting all tabs, or to a specific tab. If both are defined, the size of a specific tab will have priority over the global IupTabs size.

VALUE: Contains the name of the currently selected tab. Changing this attribute, adding the name of a different tab, makes the latter be the active tab. If the provided name does not correspond to any tab, nothing occurs. To set a name to a tab, use the IupSetHandle function on the element to be inserted in the tab.

ACTIVE: Allows or inhibits user interaction with a given tab. When the attribute is "NO", the corresponding tab modifies the text color to show that interaction is inhibited. Be careful, because a "REPAINT" may be needed to generate a Tabs repaint.

REPAINT: This attribute immediately generates a Tabs repaint.

Callbacks

TABCHANGE_CB: Callback called when the user shifts the active tab. The parameters passed are:

int function(Ihandle* self, Ihandle* new_tab, Ihandle* old_tab); [in C]
elem:tabchange(new_tab, old_tab: iuplua_tag) -> (ret: number) [in IupLua3]
elem:tabchange_cb(new_tab, old_tab: iuplua_tag) -> (ret: number) [in IupLua5]

self: Ihandle* of the control
new_tab: Ihandle* of the tab selected by the user
old_tab: Ihandle* of the previously selected tab

Note

The Tabs elements, differently from a ZBOX, does not need to have associated names. Those without a name will receive an automatically generated one.

Examples

iuptabs.gif

See Also

IupCanvas