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  |
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
|
|
|
Goto Forum:
Current Time: Mon Aug 18 21:01:38 CEST 2025
Total time taken to generate the page: 0.07482 seconds
|