About Store Forum Documentation Contact



Post Reply 
List
Author Message
Dynad Offline
Member

Post: #1
List
Hey,

Is there a function that returns which cursor in the list is selected?

I can use this but i need to know first which 1 is selected... And if selected it returns a pointer with the data from the array.
PHP Code:
list.setElm(i); 

Probably you can use this:
PHP Code:
Ptr   elmToData (Int elm  ); 
The problem again is i don't know which elm is selected pfft

Maybe i could use to get current selected but im not sure:
PHP Code:
Ptr operator()  (         ) {return orderToData(cur  );} 

Im not very clear how this works..


Thnx,
~Dynad

There is always evil somewhere, you just have to look for it properly.
08-27-2010 06:33 PM
Visit this user's website Find all posts by this user Quote this message in a reply
McTomas Offline
Member

Post: #2
RE: List
Hi

I didn't understand what you want, but:

To get the current element use: list.cur
To get the current element object use: list() or list.orderToData(list.cur);

Hope I could help.
08-27-2010 08:55 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #3
RE: List
Yes thats it, but what the problem was that i had setData(i); in the update function. This way the cur is reset to -1 on every update cycle. But anyhow thnx for the help smile

There is always evil somewhere, you just have to look for it properly.
08-27-2010 11:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
McTomas Offline
Member

Post: #4
RE: List
No need for setData. You can just put cur=-1 instead, that way you won't have to load the data, every frame.
If you want to clean all the selection in the update(), just put cur = cur_prev = lit = -1;
08-28-2010 12:16 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #5
RE: List
Well i have setData on a button callback now. So before i set new data i clean the list first and then add new data to it wink

There is always evil somewhere, you just have to look for it properly.
08-28-2010 12:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply