Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Tree View (https://forums.graalonline.com/forums/showthread.php?t=134264492)

Emera 09-06-2011 11:19 AM

Tree View
 
OK, well on my "mission" to get to grips with remembering GS2 functions and understanding how everything works, I am trying my very best at using each and every command to get used to using them. I find that creating scripts using the things I am studying help me to understand the controls better. For instance...
NPC Code:
Online Log Reader - Reading and writing from.txt files
Chat System - Using triggerserver and triggerclient
Item Spawner - Using putnpc2(); and using classes


I now want to be able to get to grips with using a tree view control in my scripts. I don't actually know how I would go about using this but if anybody has any ideas or wants to explain to me in depth what a tree view control actually does I will be very happy with that! ^_^

Here is what I know already.

Tree views can be created and added too by using both parents and and children. The parent control is the "top of the tree" and the children grow down the tree. It can be used to store multiple bursts of short information and picking options from each of the nodes.

cbk1994 09-06-2011 12:56 PM

It's just a tree list.

Example from SQL Explorer:

PHP Code:

new GuiTreeViewCtrl("SQL_Data_DBs_Tree") {
  
profile GuiBlueTreeViewProfile;

  
0;
  
0;

  
fitparentwidth true;
  
horizSizing "width";

  
active false;

  
clearNodes();
  
addNode("Loading...");


later..

PHP Code:

with (SQL_Data_DBs_Tree) {
  
clearNodes();
  
active true;

  for (
temp.dbdata[0]) {
    
with (addNode(db[0])) {
      
this.expanded false;
      
      for (
temp.tabledb[1]) {
        
this.expanded false;

        
with (addNode(table[0])) {
          
this.database db[0];

          for (
temp.idxtable[1]) {
            
with (addNode(idx[0] @ " (" idx[1] @ ")")) {
              
image selectedimage 2;

              
this.indexName idx[0];
              
this.columns idx[1];
            }
          }
        }
      }
    }
  }
// lol 



All times are GMT +2. The time now is 03:00 PM.

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