Creation/Dev/Script/Client/GuiTabCtrl: Difference between revisions

From Graal Bible
(reformat)
No edit summary
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Scripting Reference]]
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.


=Variables=
=Variables=
{| border="1" cellpadding="2" width="100%"
{| border="1" cellpadding="2" width="100%"
| '''Name'''
| '''Name'''
Line 22: Line 31:
| integer (read only)
| integer (read only)
|
|
|-
| rows
| object
| array of [[Creation/Dev/Script/Client/GuiTabCtrlEntry|GuiTabCtrlEntry]]
|-
|-
| selected
| selected
Line 33: Line 46:


=Functions=
=Functions=
{| border="1" cellpadding="2" width="100%"
{| border="1" cellpadding="2" width="100%"
| '''Name'''
| '''Name'''
Line 116: Line 130:
| seticonsize(int, int)
| seticonsize(int, int)
|
|
|
| sets the width and height of the icons for the entries, maximum size is 64x64
|-
|-
| setselectedbyid(int)
| setselectedbyid(int)
Line 126: Line 140:
|
|
|}
|}
=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=
<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>

Latest revision as of 23:56, 15 February 2010

Inherits GuiControl.

Description

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.


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) sets the width and height of the icons for the entries, maximum size is 64x64
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);
}