PDA

View Full Version : gui object questions


Prozac
02-15-2006, 03:33 AM
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

Rick
02-15-2006, 05:23 AM
1. GuiTabCtrl (http://wiki.graal.net/index.php/Creation/Dev/Script/Client/GuiTabCtrl) - I've written a tutorial on how to use those (http://wiki.graal.net/index.php/Creation/Dev/Creating_Tabbed_Window_Panes) (at least the way I do).
2. GuiBitmapCtrl (http://wiki.graal.net/index.php/Creation/Dev/Script/Client/GuiBitmapCtrl).
3. There is nothing there?
4. GuiTreeViewCtrl (http://wiki.graal.net/index.php/Creation/Dev/Script/Client/GuiTreeViewCtrl).
5. GuiMLTextCtrl (http://wiki.graal.net/index.php/Creation/Dev/Script/Client/GuiMLTextCtrl) contained within a GuiScrollCtrl (http://wiki.graal.net/index.php/Creation/Dev/Script/Client/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.

Prozac
02-15-2006, 07:23 AM
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:


// 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

Rick
02-15-2006, 08:10 AM
What's the problem? item_list.getselectednode() should return the selected node.

ApothiX
02-15-2006, 02:52 PM
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() ?

Skyld
02-15-2006, 07:31 PM
Ah, thank you Prozac. You pointed out an error in my News Browser.

Rick
02-15-2006, 07:44 PM
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 (http://wiki.graal.net/index.php/Creation/Dev/Script/Client/GuiTreeViewNode).

Prozac
02-16-2006, 01:23 AM
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?

Rick
02-16-2006, 01:56 AM
onSelect should work fine?

Prozac
02-16-2006, 02:18 AM
nope.


// 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)

Maniaman
02-16-2006, 04:37 AM
You need to include the ctrl name in the onSelect() thing


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

Rick
02-16-2006, 06:12 AM
Oh, oops. I hadn't noticed that, I figured he was doing a catchevent or something.