Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GS2 Tabs (https://forums.graalonline.com/forums/showthread.php?t=73811)

Dionysus 05-04-2007 04:45 AM

GS2 Tabs
 
How do i use the

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

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

i dont get what i put for tabidindex like is it the same as tabid or what im just confused what goes in what params...

function Info_Tabs.onSelect(0,"Info","WHAT HERE?");
{
//script;
}

Gambet 05-04-2007 05:05 AM

You don't need to put anything, just read what you need in the actual script.

Example:
PHP Code:

function whatever_tab.onSelect(tabid,tabtext,tabindex)
{
 switch(
tabtext)
  {
   case 
"Bob":
     
player.chat "Bob tab selected!";
     break;
   case 
"Bill":
     
player.chat "Bill tab selected!";
     break;
  }



etc...

Dionysus 05-04-2007 02:07 PM

Ya thanks :)

Novo 05-04-2007 03:38 PM

One thing I like doing with tabs is name them with their respective scrollbox...

It allows this shortcut:
PHP Code:

function whatever_tab.onSelect(tabid,tabtext,tabindex)
{
  for ( 
tabwhatever_tab.rows )
    (@
"Scroll"tab.text ).visible = ( tab.text == tabtext );


=]

killerogue 05-04-2007 09:39 PM

Quote:

Originally Posted by Novo (Post 1305420)
One thing I like doing with tabs is name them with their respective scrollbox...

It allows this shortcut:
PHP Code:

function whatever_tab.onSelect(tabid,tabtext,tabindex)
{
  for ( 
tabwhatever_tab.rows )
    (@
"Scroll"tab.text ).visible = ( tab.text == tabtext );


=]

Ooo, I could use that. Thanks Novo.

Rapidwolve 05-04-2007 09:41 PM

Another way of doing it is inside the TabControl you could do this.
PHP Code:

thiso.catchevent(this"onSelect""TabSelected"); 

or outside of the tab control:

PHP Code:

this.catchevent("TabControlName""onSelect""TabSelected"); 

All this basically does is call another function (with parameters) once the action of the specified GUI control has happened.


All times are GMT +2. The time now is 02:05 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.