Tab control help
Function help:
Real API_Tab_Create (Real Parent Handle, Real X, Real Y, Real Width, Real Height, Real Style Flags, Real Extended Style Flags);
This function creates a new tab control.
Argument list:
(0) Parent Handle: Identifies the window handle of the window to create this control on.
(1) X: The horizontal position of the control in pixels, relative to the parent window.
(2) Y: The vertical position of the control in pixels, relative to the parent window.
(3) Width: The horizontal size of the control in pixels.
(4) Height: The vertical size of the control in pixels.
(5) Style Flags: The style flags, supports the Global Control Styles and the following styles:
TCS_BOTTOM
Tabs appear at the bottom of the control. This value equals TCS_RIGHT. This style is not supported if you use ComCtl32.dll version 6.
TCS_BUTTONS
Tabs appear as buttons, and no border is drawn around the display area.
TCS_FIXEDWIDTH
All tabs are the same width. This style cannot be combined with the TCS_RIGHTJUSTIFY style.
TCS_FLATBUTTONS
Selected tabs appear as being indented into the background while other tabs appear as being on the same plane as the background. This style only affects tab controls with the TCS_BUTTONS style.
TCS_FOCUSNEVER
The tab control does not receive the input focus when clicked.
TCS_FOCUSONBUTTONDOWN
The tab control receives the input focus when clicked.
TCS_FORCEICONLEFT
Icons are aligned with the left edge of each fixed-width tab. This style can only be used with the TCS_FIXEDWIDTH style.
TCS_FORCELABELLEFT
Labels are aligned with the left edge of each fixed-width tab; that is, the label is displayed immediately to the right of the icon instead of being centered. This style can only be used with the TCS_FIXEDWIDTH style, and it implies the TCS_FORCEICONLEFT style.
TCS_HOTTRACK
Items under the pointer are automatically highlighted.
TCS_MULTILINE
Multiple rows of tabs are displayed, if necessary, so all tabs are visible at once.
TCS_MULTISELECT
Multiple tabs can be selected by holding down the CTRL key when clicking. This style must be used with the TCS_BUTTONS style.
TCS_OWNERDRAWFIXED
The parent window is responsible for drawing tabs.
TCS_RAGGEDRIGHT
Rows of tabs will not be stretched to fill the entire width of the control. This style is the default.
TCS_RIGHT
Tabs appear vertically on the right side of controls that use the TCS_VERTICAL style. This value equals TCS_BOTTOM. This style is not supported if you use visual styles.
TCS_RIGHTJUSTIFY
The width of each tab is increased, if necessary, so that each row of tabs fills the entire width of the tab control. This window style is ignored unless the TCS_MULTILINE style is also specified.
TCS_SCROLLOPPOSITE
Unneeded tabs scroll to the opposite side of the control when a tab is selected.
TCS_SINGLELINE
Only one row of tabs is displayed. The user can scroll to see more tabs, if necessary. This style is the default.
TCS_TABS
Tabs appear as tabs, and a border is drawn around the display area. This style is the default.
TCS_VERTICAL
Tabs appear at the left side of the control, with tab text displayed vertically. This style is valid only when used with the TCS_MULTILINE style. To make tabs appear on the right side of the control, also use the TCS_RIGHT style. This style is not supported if you use ComCtl32.dll version 6.
(6) Extended Style Flags: This can be any combination of the Global Extended Control Styles.
Return value:
If this function succeeds, it returns the Control ID of the control, otherwise it returns 0.
Real API_Tab_DeleteAll (Real Control ID);
This function removes all items from the tab control.
Return value:
Returns true (1) if successful, or false (0) otherwise.
Real API_Tab_DeleteItem (Real Control ID, Real Zero Based Item Index);
This function removes a specific item from the tab.
Return value:
Returns true (1) if successful, or false (0) otherwise.
Real API_Tab_GetCurFocus (Real Control ID);
This function returns the zero based index of the item that has the focus.
Return value:
Returns the index of the tab item that has the focus.
Real API_Tab_GetCurSel (Real Control ID);
This function returns the zero based index of the item that is selected.
Return value:
Returns the index of the tab item that is selected.
Real API_Tab_GetExtendedStyle (Real Control ID);
This function returns the extended style flags.
Return value:
Returns the extended style flags.
Real API_Tab_GetImageList (Real Control ID);
This function returns the resource handle of the image list assigned to the tab control.
Return value:
Returns the handle to the image list if successful, or NULL otherwise.
Real API_Tab_GetItemCount (Real Control ID);
This function returns the number of items inside the tab control.
Return value:
Returns the number of items if successful, or zero otherwise.
Real API_Tab_GetRowCount (Real Control ID);
This function returns the number of rows in a tab control which has the TCS_MULTILINE style.
Return value:
Returns the number of rows of tabs.
Real API_Tab_HighlightItem (Real Control ID, Real Zero Based Item Index, Real Do Highlight);
This function highlights or removes the highlight from a tab item.
Use 1 in argument2 to highlight or 0 to remove the highlight.
Return value:
Returns true (1) if successful, or false (0) otherwise.
Real API_Tab_InsertItem (Real Control ID, Real Zero Based Item Index, String Text);
This function inserts a new item into the tab control.
Return value:
Returns the index of the new tab if successful, or -1 otherwise.
Real API_Tab_SetCurFocus (Real Control ID, Real Zero Based Item Index);
This function changes the focus to the specified item.
Return value:
No return value.
Real API_Tab_SetCurSel (Real Control ID, Real Zero Based Item Index);
This function changes the selection to the specified item.
Return value:
Returns the index of the previously selected tab if successful, or -1 otherwise.
Real API_Tab_SetExtendedStyle (Real Control ID, Real Extended Style Flags);
This function sets the extended style flags of the tab control.
Do not confuse this styles with the extended styles of argument6 of API_Tab_Create.
The following style is supported:
TCS_EX_FLATSEPARATORS
The tab control will draw separators between the tab items. This extended style only affects tab controls that have the TCS_BUTTONS and TCS_FLATBUTTONS styles.
Return value:
Returns a value that contains the previous tab control extended styles.
Real API_Tab_SetImageList (Real Control ID, Real Image List Handle);
This function assigns a image list to a tab control.
Make an image list using API_ImageList_Create.
Return value:
Returns the handle to the previous image list, or NULL if there is no previous image list.
Real API_Tab_SetItemText (Real Control ID, Real Zero Based Item Index, String Text);
This function changes the text of a tab control item.
Return value:
Returns true (1) if successful, or false (0) otherwise.
Real API_Tab_SetItemImage (Real Control ID, Real Zero Based Item Index, Real Image List Image Index);
This function changes the image of the tab item.
This image is the number of the image in the image list, so you have to call API_Tab_SetImageList first.
Return value:
Returns true (1) if successful, or false (0) otherwise
Real API_Tab_SetItemSize (Real Control ID, Real Width, Real Height);
This function changes the size of the tab items.
Return value:
Returns nothing.
Real API_Tab_SetMinWidth (Real Control ID, Real Width);
This function changes the minimum width of tab items.
Return value:
Returns a value that represents the previous minimum tab width.
Real API_Tab_SetPadding (Real Control ID, Real Width, Real Heigth);
Sets the amount of space (padding) around each tab's icon and label in a tab control.
Return value:
No return value.
Secondary check commands for tab controls:
TCN_FOCUSCHANGE - Notifies a tab control's parent window that the button focus has changed.
TCN_SELCHANGE - The currently selected tab has changed.
TCN_SELCHANGING - The currently selected tab is about to change.
Example:
if (Command == Tab1)
{
Second = API_Check_SecondaryCommand (1);
if (Second == TCN_SELCHANGE)
{
Selection = API_Tab_GetCurSel (Tab1);
show_message ("The selection of Tab1 changed to tab "+string(Selection)+".");
}
} |
Example code:
Tab1 = API_Tab_Create (Win,550,100,200,200);
API_Tab_InsertItem (Tab1,0,"Item 0");
API_Tab_InsertItem (Tab1,1,"Item 1");
|
is
Return to help index
|