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

From Graal Bible
m (→‎Events: Parameter names)
m (→‎Events: Flipped parameter order for onSelect.)
Line 142: Line 142:
=Events=
=Events=


onSelect(tabid,tabindex,tabtext) - a tab has been selected
onSelect(tabid,tabtext,tabindex) - a tab has been selected


onDeselect(tabid,tabtext,tabindex) - a tab has been deselected (another tab got the focus)
onDeselect(tabid,tabtext,tabindex) - a tab has been deselected (another tab got the focus)

Revision as of 17:54, 16 January 2009

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);
}