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

From Graal Bible
mNo edit summary
 
No edit summary
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Scripting Reference]]
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=
{| border="1" cellpadding="2" width="100%"
| '''Name'''
| '''Type'''
| '''Description'''
|-
| iconheight
| integer (read only)
|
|-
| iconwidth
| integer (read only)
|
|-
| leveling
| integer
|
|-
| maxvisibletabs
| integer (read only)
|
|-
| rows
| object
| array of [[Creation/Dev/Script/Client/GuiTabCtrlEntry|GuiTabCtrlEntry]]
|-
| selected
| object (read only)
|
|-
| tabwidth
| integer
|
|}
=Functions=
{| border="1" cellpadding="2" width="100%"
| '''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=
<pre>
<pre>
    GuiTabCtrl (GuiControl):
new GuiTabCtrl("Test_Tab") {
      iconheight - integer (read only)
  profile = GuiBlueTabProfile;
      iconwidth - integer (read only)
  x = 10;
      leveling - integer
  y = 10;
      maxvisibletabs - integer (read only)
  width = 160;
      selected - object (read only)
  height = 24;
      tabwidth - integer
  tabwidth = 70;
      addrow(int, str) - returns object - the added row
   
      clearrows()
  clearrows();
      clearselection()
  addrow(0,"Tab");
      findtext(str) - returns integer - row index
  addrow(1,"Control");
      findtextid(str) - returns integer - row id
  setSelectedRow(0);
      getrowatpoint(int, int) - returns integer - row index
      getrowidatpoint(int, int) - returns integer - row id
      getrownumbyid(int) - returns integer
      getselectedid() - returns integer - row id
      getselectedrow() - returns integer - row index
      getselectedtext() - returns string
      insertrow(int, int, str) - returns object - the inserted row
      isidselected(int) - returns boolean
      isrowselected(int) - returns boolean
      makevisible(int)
      makevisiblebyid(int)
      removerow(int)
      removerowbyid(int)
      rowcount() - returns integer
      seticonsize(int, int)
      setselectedbyid(int)
      setselectedrow(int)
</pre>
</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);
}