Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-15-2006, 03:33 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
gui object questions

The gui information is great on the wiki .net and .us sites, but beyond names like window button and text box, I get a little lost without pictures to tell me what's what.

Based on this example of the Rudora help system, can someone please tell me what Gui(fillintheblank)Ctrl names are for these items, and then I can look up how to use them with the refrence tools on my own.

1 - tab menus
2 - the image
3 - the banner area
4 - the option list, and is that an image next to each item, or a default arrow?
5 - the scrollbar attached to what appears to be a textbox. and can you attach a scrollbar to an option list?

thanks in adance for the help
Attached Thumbnails
Click image for larger version

Name:	rudora-gui.gif
Views:	225
Size:	101.4 KB
ID:	35574  

Last edited by Prozac; 02-15-2006 at 03:51 AM..
Reply With Quote
  #2  
Old 02-15-2006, 05:23 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
1. GuiTabCtrl - I've written a tutorial on how to use those (at least the way I do).
2. GuiBitmapCtrl.
3. There is nothing there?
4. GuiTreeViewCtrl.
5. GuiMLTextCtrl contained within a GuiScrollCtrl.

Now, I'm not the coder of that script so I could be wrong on a couple things, but that is what it looks like to me.
Reply With Quote
  #3  
Old 02-15-2006, 07:23 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
thanks, I have made good progress, but on the Tree controll, when I click on a node, I want it to change the text in a scrolling text box. select() appears to be the only likely command to detect if a node in the tree is clicked, there is really not enough information on the Tree control to tell me what i need to know to make it work.

Within the window:
PHP Code:

// the option list
  
new GuiScrollCtrl("item_scroll")
    {
    
width=150;
    
height=300;

   new 
GuiTreeViewCtrl("item_list")
     {
      
width=150;
      
height=400;
      
columns="0 16";
      
visible=true;  
      
addnode("test1");   
      
addnode("test2");   
      
addnode("test3");   
     }
  }

// scrolling text window
  
new GuiScrollCtrl("item_desc_scroll")
    {
    
width=150;
    
height=150;
    
    new 
GuiMLTextCtrl("item_desc_text")
      {
        
wordwrap=true;
        
text="hi there i am some text";
      }
    }

/* so this is what i tried to detect the action of the node being clicked with the mouse to change the text box to something else. But it dosent work. What is the propper detection for that action?*/

function onitem_list.select()
{
  
item_desc_text.text="you clicked a node";

thanks again for the support
Reply With Quote
  #4  
Old 02-15-2006, 08:10 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
What's the problem? item_list.getselectednode() should return the selected node.
Reply With Quote
  #5  
Old 02-15-2006, 02:52 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Rick
What's the problem? item_list.getselectednode() should return the selected node.
Can you add properties when you create the node? like:

temp.node = addnode("Test1");
temp.node.coolprop = "WeeEeeE";

then access the node.coolprop in .select() ?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 02-15-2006, 07:31 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Ah, thank you Prozac. You pointed out an error in my News Browser.
__________________
Skyld
Reply With Quote
  #7  
Old 02-15-2006, 07:44 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Quote:
Originally Posted by ApothiX
Can you add properties when you create the node? like:

temp.node = addnode("Test1");
temp.node.coolprop = "WeeEeeE";

then access the node.coolprop in .select() ?
Yes. A node is GuiTreeViewNode.
Reply With Quote
  #8  
Old 02-16-2006, 01:23 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
hm i dont think my follow up question on the nodes was clear.
asking with a picture helped before, so i will do it again:

and Skyld, what was wrong with your menu? i was not looking to correct anything in your gui.

so: how do i detect that a node has been clicked? what does the event block look like, that will have item_desc_text.text="new text"; inside it?
where in relation to the gui creation should the 'click on a node' event detection go?
does it need to be in a timeout loop?
Attached Thumbnails
Click image for larger version

Name:	treev1.gif
Views:	174
Size:	32.2 KB
ID:	35584  
Reply With Quote
  #9  
Old 02-16-2006, 01:56 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
onSelect should work fine?
Reply With Quote
  #10  
Old 02-16-2006, 02:18 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
nope.

PHP Code:
// made the gui window and items as listed above

function onSelect()
{
  
player.chat=item_list.getselectednode();
  
item_desc_text.text="you clicked a node";

that is an event block, and the text does not change.

try again ... i am looking for the same event thats triggered on the F8 window when you click on a world, and it changes the text (and image)
Reply With Quote
  #11  
Old 02-16-2006, 04:37 AM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
You need to include the ctrl name in the onSelect() thing

NPC Code:

function ctrlname.onSelect() {
player.chat = "whoah";
}

__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #12  
Old 02-16-2006, 06:12 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Oh, oops. I hadn't noticed that, I figured he was doing a catchevent or something.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:20 PM.


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