Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TreeCtrl » IsSelected(id)
IsSelected(id) [message #18942] Sun, 02 November 2008 01:07 Go to next message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
Hi,

I want to allow users to select items in a TreeCtrl with a single click on one of the items and tried to solve this with a callback for "WhenSel".


void getActiveItem()
{
   Vector<int> elements;

   elements = GetSel();

   TreeCtrl::Node tmp = GetNode(elemets[0]);

   OUTPUT(tmp.key);
   OUTPUT(tmp.value);
   OUTPUT(IsSelected(elements[0]);
}


OUTPUT is a Makro which writes the values to a file. I got the key and the value of the node, but every time a "false" from IsSelected.

Is it possible to get an example for using the method in the right way?

regards

reinhard

[Updated on: Sun, 02 November 2008 01:08]

Report message to a moderator

Re: IsSelected(id) [message #18948 is a reply to message #18942] Sun, 02 November 2008 13:06 Go to previous messageGo to next message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
grazy thing ...

when I activate MultiSelect(), I get "true" even if I don't click on it ... Just moving the mouse over the items ...

I thought that DoClick is called automatically? Is that wrong?
How to do this?

reinhard
Re: IsSelected(id) [message #18953 is a reply to message #18942] Sun, 02 November 2008 15:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11991
Registered: November 2005
Ultimate Member
I guess GetCursor is quite ok here, is not it?

Mirek
Re: IsSelected(id) [message #18968 is a reply to message #18953] Sun, 02 November 2008 20:41 Go to previous messageGo to next message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
HI Mirek,

mmh, I think I give you just much too less information ..

luzr wrote on Sun, 02 November 2008 15:09

I guess GetCursor is quite ok here, is not it?

Mirek


I've got a tree without root:

-group1
--element1
--...
-group2
--element2
--element3
--...
-group3
--elementn
--...

there should be called a function when a user LeftClick on an element, but not when clicked on a group. I used a callback to start the action and tried "WhenSel". The Callback-Funktion checks if parent == 0 or not. But I didn't find a solution to recognize if the user only moves over an element or clicked with the left button on the element. It is only allowed to choose one element, not more.

looking at the documentation for IsCursor():
Returns true if there is cursor in the tree

But the work ought to be done only when LeftDown/LeftUp - Action happens on an element ...

IsSelected(id) checks Item.sel if true .. But this is not set from DoClick(...) or?

I hope it's more clear what I want to do.

regards

reinhard
Re: IsSelected(id) [message #18971 is a reply to message #18968] Sun, 02 November 2008 21:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11991
Registered: November 2005
Ultimate Member
WhenLeftClick?

(AFAIK, this is recent addition, you might not have it in your U++ - checkout svn mirror).

Mirek
Re: IsSelected(id) [message #18981 is a reply to message #18971] Sun, 02 November 2008 23:17 Go to previous messageGo to next message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
luzr wrote on Sun, 02 November 2008 21:34

WhenLeftClick?

(AFAIK, this is recent addition, you might not have it in your U++ - checkout svn mirror).

Mirek


thanks, is this part of the next release? when about?

regards

reinhard
Re: IsSelected(id) [message #18983 is a reply to message #18981] Mon, 03 November 2008 00:19 Go to previous message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
Use svn builds if you want it now and don't want to build Upp on your own from svn.

cdabbd745f1234c2751ee1f932d1dd75
Previous Topic: Cursor doesn't refresh
Next Topic: Bug changing text after node insertion
Goto Forum:
  


Current Time: Tue Aug 20 20:34:37 CEST 2019

Total time taken to generate the page: 0.00966 seconds