Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-04-2007, 04:45 AM
Dionysus Dionysus is offline
RTK| God of Wine
Dionysus's Avatar
Join Date: Apr 2007
Location: United States
Posts: 14
Dionysus is on a distinguished road
Send a message via AIM to Dionysus
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;
}
__________________


Reply With Quote
  #2  
Old 05-04-2007, 05:05 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
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...
Reply With Quote
  #3  
Old 05-04-2007, 02:07 PM
Dionysus Dionysus is offline
RTK| God of Wine
Dionysus's Avatar
Join Date: Apr 2007
Location: United States
Posts: 14
Dionysus is on a distinguished road
Send a message via AIM to Dionysus
Ya thanks
__________________


Reply With Quote
  #4  
Old 05-04-2007, 03:38 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
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 );

=]
Reply With Quote
  #5  
Old 05-04-2007, 09:39 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Novo View Post
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #6  
Old 05-04-2007, 09:41 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:03 AM.


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