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 » Right Clicking Tree Nodes?
Right Clicking Tree Nodes? [message #10796] Sun, 29 July 2007 21:07 Go to next message
Ishi is currently offline  Ishi
Messages: 5
Registered: July 2007
Location: Middlesbrough, UK
Promising Member
Hi there,

I'm pretty new to U++ but it seems really good so far.

My first major problem is how to set a right click menu for when you right click on a tree node, e.g.:
http://i12.tinypic.com/68aypns.png

Apologies if this has been asked before, I had a mosey around the forum but couldn't find anything. Thanks in advance for any help, much appreciated. Smile
Re: Right Clicking Tree Nodes? [message #10797 is a reply to message #10796] Sun, 29 July 2007 22:39 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
U++ TreeCtrl up to 2007.1 didn't have any standard right click menu (if you have that in mind) unlike ArrayCtrl. You would need to implement one yourself.
Have a look at ArrayCtrl or theide or some other supplied examples (with global find Ctrl_Sfift_F look for "RightClick" or "StdBar"). Or wait until someone posts an example...
Re: Right Clicking Tree Nodes? [message #10803 is a reply to message #10796] Mon, 30 July 2007 10:40 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
In constructor:
tree.WhenBar = THISBACK(TreeMenu);


And add OnTreeMenu function:
void TreeMenu(Bar &bar) {
	bar.Add("Menu Item 1", THISBACK(OnItem1));
        // etc.
}


Use tree.GetCursor to determine which node the mouse was clicked on.

James.

[Updated on: Mon, 30 July 2007 10:40]

Report message to a moderator

Re: Right Clicking Tree Nodes? [message #10806 is a reply to message #10803] Mon, 30 July 2007 15:21 Go to previous message
Ishi is currently offline  Ishi
Messages: 5
Registered: July 2007
Location: Middlesbrough, UK
Promising Member
Awesome. Thanks a lot guys ^_^
Previous Topic: Tree Control - how to access properties of node.ctrl?
Next Topic: TreeCtrl Scroll triggers Parent Refresh
Goto Forum:
  


Current Time: Thu Mar 28 21:19:03 CET 2024

Total time taken to generate the page: 0.01650 seconds