Creation/Dev/Script/Client/GuiTabCtrl: Difference between revisions
From Graal Bible
(Added picture, description and an example script) |
|||
Line 1: | Line 1: | ||
Inherits [[Creation/Dev/Script/Client/GuiControl|GuiControl]]. | Inherits [[Creation/Dev/Script/Client/GuiControl|GuiControl]]. | ||
=Description= | |||
[[Image:Guicontrol_tab.png]] | |||
Displays several leveled buttons. If there is not enough space for displaying all tabs, then two arrow buttons are displayed for scrolling between the visible tabs. The actually behaviour (showing and hiding different GUI controls, which work as 'pages') must be done by script by reacting to the ''onSelect'' and ''onDeselect'' events. | |||
Line 144: | Line 150: | ||
onIconResized(newwidth,newheight) - the icon size has been modified (via setIconSize()) | onIconResized(newwidth,newheight) - the icon size has been modified (via setIconSize()) | ||
=Example= | |||
<pre> | |||
new GuiTabCtrl("Test_Tab") { | |||
profile = GuiBlueTabProfile; | |||
x = 10; | |||
y = 10; | |||
width = 160; | |||
height = 24; | |||
tabwidth = 70; | |||
clearrows(); | |||
addrow(0,"Tab"); | |||
addrow(1,"Control"); | |||
setSelectedRow(0); | |||
} | |||
</pre> |
Revision as of 19:05, 16 September 2006
Inherits GuiControl.
Description
Displays several leveled buttons. If there is not enough space for displaying all tabs, then two arrow buttons are displayed for scrolling between the visible tabs. The actually behaviour (showing and hiding different GUI controls, which work as 'pages') must be done by script by reacting to the onSelect and onDeselect events.
Variables
Name | Type | Description |
iconheight | integer (read only) | |
iconwidth | integer (read only) | |
leveling | integer | |
maxvisibletabs | integer (read only) | |
rows | object | array of GuiTabCtrlEntry |
selected | object (read only) | |
tabwidth | integer |
Functions
Name | Return Type | Description |
addrow(int, str) | object row | Returns the added row |
clearrows() | ||
clearselection() | ||
findtext(str) | integer rowindex | |
findtextid(str) | integer rowid | |
getrowatpoint(int, int) | integer rowindex | |
getrowidatpoint(int, int) | integer rowid | |
getrownumbyid(int) | integer | |
getselectedid() | integer rowid | |
getselectedrow() | integer rowindex | |
getselectedtext() | string | |
insertrow(int, int, str) | object row | Returns the inserted row |
isidselected(int) | boolean | |
isrowselected(int) | boolean | |
makevisible(int) | ||
makevisiblebyid(int) | ||
removerow(int) | ||
removerowbyid(int) | ||
rowcount() | integer | |
seticonsize(int, int) | ||
setselectedbyid(int) | ||
setselectedrow(int) |
Events
onSelect(tabid,tabtext,tabindex) - a tab has been selected
onDeselect(tabid,tabtext,tabindex) - a tab has been deselected (another tab got the focus)
onOpenMenu(tabindex,mousescreenx,mousescreeny) - the right mouse button has been pressed while the mouse was over a tab
onIconResized(newwidth,newheight) - the icon size has been modified (via setIconSize())
Example
new GuiTabCtrl("Test_Tab") { profile = GuiBlueTabProfile; x = 10; y = 10; width = 160; height = 24; tabwidth = 70; clearrows(); addrow(0,"Tab"); addrow(1,"Control"); setSelectedRow(0); }