Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-28-2006, 05:20 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Few questions w/ GuiTreeViewCtrl

1) How can I change the image selection?
2) How can I check which is the last node of a group? ( To give it a specific image )

Basically it opens a text file, and sends to client then loads it up into a treeview (works).. just can't get the two things I listed above to work =(
Reply With Quote
  #2  
Old 09-28-2006, 06:51 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
You can either use icons (setIconSize() etc.), and you update them when you click the node or the node is expanded,
or you use the profile.bitmap, which can contain any number of sub images, separated by the color of the first pixel in the image (upper-left corner), check treeview_serverlisticons.png. The node then automatically chooses one of the images based on node.image, node.selectedimage, node.expandedimage and node.expandedselectedimage which specify the number of the image that should be used.
Reply With Quote
  #3  
Old 09-28-2006, 09:09 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Stefan View Post
You can either use icons (setIconSize() etc.), and you update them when you click the node or the node is expanded,
or you use the profile.bitmap, which can contain any number of sub images, separated by the color of the first pixel in the image (upper-left corner), check treeview_serverlisticons.png. The node then automatically chooses one of the images based on node.image, node.selectedimage, node.expandedimage and node.expandedselectedimage which specify the number of the image that should be used.
Okay okay.. this is my problem now:

PHP Code:
      // Add Ranks
      
temp.tholder temp.gangranks.savevarstoarray(true);
      for (
temp.0temp.temp.tholder.size(); temp.I++)
      {
        
temp.hold temp.tholder[temp.I];
        if (
temp.hold.substring(temp.hold.pos("=") + 1, -4in client.gmembers)
        {
          
with (Gang_Ranks_Tree.getnode(temp.tholder[temp.I].substring(temp.tholder[temp.I].pos("=") + 1, -4)))
          {
            
image selectedimage 2;
          }
        }
      } 
Thing is.. I can't get the image to change =(. The variable for that.. for example would be KuJi but it's not the direct location and I've tried to think of 150 ways to get:
In Members:
1=KuJi (which is basically rank ids in the tree view or whatever)

In Ranks:
1=General Armii
1.1=General-Polkovnik
1.2=General-Lieutenant
1.3=General-Major

That would add me under General Armii which is fine. I just dont know how I can check the full length and use getnodebypath("STR", "STR"); or whatever =(.

If you have an idea to end up searching
5.4.4.8.2.6.8.3 (infinite really.. depends on how many ranks) to get the full paths.. please post it.

Last edited by KuJi; 09-29-2006 at 06:17 AM..
Reply With Quote
  #4  
Old 10-01-2006, 06:05 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Bump =o
Reply With Quote
  #5  
Old 10-31-2006, 02:16 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
bump :O


I'm starting to learn this TreeView stuff too and I gotta know:


How do I add lists of things? addnode("Name of item here")? am I supposed to add them by root? It would be great if the wiki example could be the input for the intro pic on the top of the page...
( http://wiki.graal.net/index.php/Crea...uiTreeViewCtrl )
Reply With Quote
  #6  
Old 10-31-2006, 03:12 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
addnode() or addnodebypath() like in the example
Reply With Quote
  #7  
Old 10-31-2006, 05:41 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
Alright, and how would one be able to include a custom image alongside a node? HTML?
Reply With Quote
  #8  
Old 11-02-2006, 02:25 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
alongside? You mean beside setting an unique icon?
Reply With Quote
  #9  
Old 11-08-2006, 09:46 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
Forget that question please. While I was unable to login to the g2k1 forums I eventually solved that matter.



New question:
How to use onSelect(qch, qch, qch)?

function GUIname.onSelect(?,?,?) {}

can someone give me a practical example for what to use in the function's arguments? I'm having trouble figuring out whether I should put a variable for the node's name, make a for loop and put the node's name in the 1st argument position and leave the others null, or what...


edit - can I say

function GUI_Name.onSelect(getselectednode(),null,null) {}

to make this work or should I use a variable and assign it to getselectednode()?

edit again - would I need to use the TreeViewCtrl name or the ScrollCtrl name?

((If I am way off then don't bother elaborating on why I'm wrong and just tell me the answer and call me stupid or something -ooc))
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 06:41 PM.


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