Graal Forums

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

xXziroXx 05-14-2007 03:28 AM

GuiTextListCtrl
 
Could anyone explain how the following commands works, preferably with an example? :)


PHP Code:

sortcolumn integer

sortmode 
string

sortorder 
string 


cbk1994 05-14-2007 04:28 AM

Well, I just use sort() which alphabatizes. I assume those change the way it sorts.

godofwarares 05-14-2007 12:35 PM

Quote:

Originally Posted by xXziroXx (Post 1307602)
Could anyone explain how the following commands works, preferably with an example? :)


PHP Code:

sortcolumn integer

sortmode 
string

sortorder 
string 


Well, I don't know what sortcolumn does, but:

For sortmode, it can be either 'ascending' or 'descending', e.g

PHP Code:

sortMode "ascending"

This is also probably the same for sortorder


And, per what cbkbud said, you need to call sort() for it to actually sort.

Deadly_Killer 05-14-2007 01:14 PM

most likely:

sortcolumn = 1; // To sort the second column

sort();

xXziroXx 09-02-2008 10:58 AM

M-m-m-meeega Buuuump!


Is there a way to sort by value (well I know there's a sortmode = "value";, but keep reading!)? Sorting numbers does fishy sorting like... 12, 34, 260 would be sorted as:

12
260
32

A bit frustrating when making a shop GUI and want to sort it by item costs :(

xXziroXx 09-03-2008 01:52 AM

I guess not.

Programmer 09-03-2008 02:20 AM

Quote:

Originally Posted by godofwarares (Post 1307653)
...

Hey! It's me!


Quote:

Originally Posted by xXziroXx (Post 1419755)
M-m-m-meeega Buuuump!


Is there a way to sort by value (well I know there's a sortmode = "value";, but keep reading!)? Sorting numbers does fishy sorting like... 12, 34, 260 would be sorted as:

12
260
32

A bit frustrating when making a shop GUI and want to sort it by item costs :(

The problem with the sorting is that it's sorted by the first letter of a string rather than the integer values of said numbers. I suppose you would have to get the elements from the list and parse them yourself, and then re-add them in that specific order, provided the list doesn't auto-sort.

xXziroXx 09-03-2008 02:32 AM

Quote:

Originally Posted by Programmer (Post 1419889)
The problem with the sorting is that it's sorted by the first letter of a string rather than the integer values of said numbers. I suppose you would have to get the elements from the list and parse them yourself, and then re-add them in that specific order, provided the list doesn't auto-sort.

Yeah, I know, I was hoping I could avoid it though, say if Stefan implemented an actual value sort for numbers or something. :\

Admins 09-03-2008 02:48 AM

Beside graal.net you can also easily search on the Graal forums for stuff :) Quoting http://forums.graalonline.com/forums...81&postcount=2 :

For the tree view you set attributes like this:

sortmode = "value";
sortorder = "descending";
groupsortorder = "ascending";

For the nodes then:

sortvalue = 1;
sortgroup = 2;

That would sort the nodes after the value you have assigned to them. When you set sortmode="name" then it will be sorted alphabetically. The sort group can be used to let some types of nodes always appear at the top, e.g. in a folder view you would want to display the folders at the top.

---

sortmode can be "value", "name" or "extension"

xXziroXx 09-03-2008 04:35 PM

Right, thanks! :)

Exactly how does groupsortorder and sortgroup work though?

Admins 09-04-2008 12:34 PM

The text list control is displaying group by group, if groupsortorder is ascending then entries would be displayed like 1,1,1,2,2,2,2 (entry.sortgroup). So basicly 'groupsortmode' is always 'value'.
When the entries have the same group then the entry.sortvalue decides if they are above or below.

In the playerlist buddies have group 1, normal people 2, ignored people 3 (or something like that). The players are sorted either alphabetically (sortmode 'name') or by time of arrival/last pm (sortmode 'value').

xXziroXx 09-04-2008 01:07 PM

Naruhodo! Arigato :)

Inverness 09-04-2008 02:52 PM

Quote:

Originally Posted by xXziroXx (Post 1420046)
I see! Thank you :)

Fixed.

xXziroXx 09-05-2008 01:08 PM

Quote:

Originally Posted by Inverness (Post 1420054)
Naruhodo! Arigato :)

Fixed. :\

... or should I say kimatte imasu?

Deas_Voice 09-05-2008 03:30 PM

Quote:

Originally Posted by xXziroXx (Post 1420382)
... or should I say kimatte imasu?

:confused:
English plox?

xXziroXx 09-05-2008 04:52 PM

Quote:

Originally Posted by Deas_Voice (Post 1420396)
:confused:
English plox?

Japanese > English.


Also Stefan, would it be possible for you to implement so you can change textprofiles (well, text manipulating in general) for each individual row?

Admins 09-06-2008 06:58 PM

You can (/scripthelp GuiTextListEntry) :

PHP Code:

with (addrow(0"Test")) {
  
useownprofile true;
  
profile.fontcolor = {255,0,0};



xXziroXx 09-06-2008 07:14 PM

Quote:

Originally Posted by Stefan (Post 1420853)
You can (/scripthelp GuiTextListEntry) :

PHP Code:

with (addrow(0"Test")) {
  
useownprofile true;
  
profile.fontcolor = {255,0,0};



My stupidity in throughout this thread is more notable then ever. :cry:

I was trying:

PHP Code:

addrow(0"Foobar");
rows[0].profile "foobarprofile"

... and that didn't work.

Crono 09-06-2008 07:25 PM

Quote:

Originally Posted by xxziroxx (Post 1420407)
japanese > english.

No, it doesn't.

Inverness 09-06-2008 07:34 PM

Quote:

Originally Posted by xXziroXx (Post 1420857)
... and that didn't work.

The first parameter in addrow() is the row's ID not index. Also, profiles are objects, not strings. Your script should work if foobar is the first row.

Admins 09-07-2008 02:32 PM

Quote:

Originally Posted by Inverness (Post 1420862)
The first parameter in addrow() is the row's ID not index. Also, profiles are objects, not strings. Your script should work if foobar is the first row.

You still need useownprofile = true (otherwise it's using the GuiTextListCtrl profile or null, not sure)


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

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