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 » Menus&Toolbars » ToolBar's context menu
Re: ToolBar's context menu [message #15090 is a reply to message #15083] Sun, 30 March 2008 08:13 Go to previous message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

But what is the best way to determine which button was clicked? My code uses ctrl-descriptions for this purpose, but it is not the best way, I think.

Added: the variant below works too:

void BarContext::ChildMouseEvent(Ctrl *child, int event, Point p, int zdelta, dword keyflags)
{
	if(toolbar.HasChildDeep(child))
	{
		if(event == RIGHTDOWN)
		{
			Ctrl *c = child;
			int i = -1;
			
			while (c != NULL)
			{
				c = c->GetPrev();
				i++;
			}

			MenuBar::Execute(THISBACK1(SetMenuBar, i));
		}
	}
	Ctrl::ChildMouseEvent(child, event, p, zdelta, keyflags);
}


Anton

[Updated on: Sun, 30 March 2008 14:54]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Popup menu on button click
Next Topic: ToolButton: Label Patch!
Goto Forum:
  


Current Time: Mon Aug 18 18:42:16 CEST 2025

Total time taken to generate the page: 0.06664 seconds