tabs.gadget Reference¶
Comprehensive function reference for tabs.gadget, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/tabs).
This page documents 8 functions of tabs.gadget. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.
Function index¶
tabs.gadget()¶
**tabs.gadget -- File folder tabs gadget. (V42)
SUPERCLASS
gadgetclass
DESCRIPTION
The tabs gadget class provides a custom control that has imagry
similar in style to the tabs seen in a drawer full of file folders.
The action of the gadget is the same as a conventional
mutual-exclusion control in that only one tab can be active at a time
and a tab is selected by clicking upon it.
The purpose of the tabs gadget class is to provide functionality like
the page selection cycle gadget on the top-right side of the AmigaOS
2.1 PrinterPS preferences editor, but allowing all the choices to be
visible at the same time.
This gadget class requires 2.04 (V37) or greater.
METHODS
OM_NEW--Create the button gadget. Passed to superclass, then OM_SET.
OM_GET--Get an object attribute. Passed to superclass for unknown
attributes.
OM_SET--Set object attributes. Passed to superclass first.
OM_UPDATE--Set object notification attributes. Passed to superclass
first.
GM_LAYOUT--Calculate gadget imagry positioning. Passed to superclass
first.
GM_RENDER--Renders the gadget imagry. Overrides the superclass.
GM_HITTEST--Determines if mouse is within the gadget rectangle. Over-
rides the superclass.
GM_GOACTIVE--Handles activation, toggle-select and button-select.
Overrides the superclass.
GM_GOINACTIVE--Deselects the button. Overrides the superclass.
All other methods are passed to the superclass, including OM_DISPOSE.
ATTRIBUTES
GA_Disabled (BOOL) -- Determines whether the button is disabled or
not. Changing disable state will invoke GM_RENDER. A disabled
button's border and label are all rendered in SHADOWPEN and then
dusted in a ghosting pattern that is rendered in SHADOWPEN.
Defaults to FALSE.
GA_TextAttr (struct TextAttr *) -- Text attribute for the font to
use for the labels.
LAYOUTA_ChildMaxWidth (BOOL) -- Indicate whether the tabs should be
the width of the widest label. Defaults to TRUE.
TABS_Labels (TabLabelP) -- An array of TabLabel structures used to
indicate the labels for each of the tabs.
TABS_Current (LONG) -- Currently selected tab. Defaults to zero.**
Notes
This gadget class requires 2.04 or beyond to run.
GM_GOACTIVE()¶
GM_GOACTIVE -- Activate a gadget.
Function
The GM_GOACTIVE method is used to indicate to a gadget that it has become active. This method overrides the superclass.
Invokes GM_RENDER with GREDRAW_UPDATE set if the current tab is changed.
RESULT
If a new tab is selected, then returns GMR_VERIFY | GMR_NOREUSE.
All other cases returns GMR_NOREUSE.
Sets the *msg->gpi_Termination field to TABS_Current, which in turn fills in the IntuiMessage->Code field.
GM_HITTEST()¶
GM_HITTEST -- Is gadget hit.
Function
The GM_HITTEST method is used to determine if the given mouse coordinates are within the domain of the gadget. This method overrides the superclass.
RESULT
This method returns GMR_GADGETHIT if within the domain, otherwise zero is returned.
GM_LAYOUT()¶
GM_LAYOUT -- Calculate the positioning of the imagry.
Function
The GM_LAYOUT method is used to calculate the domain of the gadget and to center the label within the domain. This method is passed to the superclass first.
Gadget relativity is fully supported.
RESULT
This method returns 0.
GM_RENDER()¶
GM_RENDER -- Render the visuals of the gadget.
Function
The GM_RENDER method is used to render the visuals of the gadget. This method overrides the superclass.
If the gadget is disabled, then the ghosting pattern is applied.
RESULT
This method returns 0.
OM_GET()¶
OM_GET -- Get an attribute of a tabs.gadget object.
Function
The OM_GET method is used to get an attributes of a tabs.gadget. This method is passed to the superclass for any attribute the class doesn't understand..
ATTRIBUTES
The following attributes can be obtained from the tabs.gadget.
TABS_Current (LONG) -- Currently selected tab.
RESULT
Returns TRUE (1) if the attribute can be obtained, otherwise returns FALSE (0).
OM_NEW()¶
OM_NEW -- Create a tabs.gadget object.
Function
The OM_NEW method is used to create an instance of the tabs.gadget class. This method is passed to the superclass first.
ATTRIBUTES
The following attributes can be specified at creation time.
GA_Top (LONG) -- The top of the gadget. Should be win->BorderTop + 2.
GA_Left (LONG) -- The left edge of the gadget.
GA_Height (LONG) -- Height of the gadget. Should be the font height plus seven.
GA_RelHeight (LONG) -- Although this attribute is supported, it is stylistically a bad thing to do.
GA_Disabled (BOOL) -- Determines whether the gadget is disabled or not. Defaults to FALSE.
GA_TextAttr (struct TextAttr *) -- Text attribute for the font to use for the labels.
RESULT
If the object was created then a pointer to the object is returned, otherwise NULL is returned.
OM_SET()¶
OM_SET -- Set the attributes of a tabs.gadget object.
Function
The OM_SET method is used to set the attributes of a tabs.gadget. This method is passed to the superclass first.
ATTRIBUTES
The following attributes can be changed at OM_SET or OM_UPDATE.
GA_Disabled (BOOL) -- Determines whether the gadget is disabled or not. Changing disable state will invoke GM_RENDER. A disabled gadget's border and label are all rendered in SHADOWPEN and then dusted in a ghosting pattern that is rendered in SHADOWPEN. Defaults to FALSE.
GA_TextAttr (struct TextAttr *) -- Text attribute for the font to use for the labels.
LAYOUTA_ChildMaxWidth (BOOL) -- Indicate whether the tabs should be the width of the widest label. Defaults to TRUE.
TABS_Labels (TabLabelP) -- An array of TabLabel structures used to indicate the labels for each of the tabs.
TABS_Current (LONG) -- Currently selected tab. Defaults to zero.
RESULT
The class will update the attributes of object. Changing some attributes will result in GM_LAYOUT and/or GM_RENDER being called.
The return value will be non-zero if the gadget needs to be refreshed.