mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
CtrlLib: MenuBar::Execute now allows only single level of local menus
git-svn-id: svn://ultimatepp.org/upp/trunk@5365 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
bbc8ef005a
commit
dfb118a820
2 changed files with 6 additions and 2 deletions
|
|
@ -556,10 +556,14 @@ void MenuBar::PopUp(Ctrl *owner, Point p, Size rsz)
|
|||
|
||||
void MenuBar::Execute(Ctrl *owner, Point p)
|
||||
{
|
||||
if(IsEmpty()) return;
|
||||
static int level; // Used to prevent another local menu to be opened (repeated right-click)
|
||||
if(IsEmpty() || level > 0)
|
||||
return;
|
||||
++level;
|
||||
PopUp(owner, p);
|
||||
EventLoop(this);
|
||||
CloseMenu();
|
||||
--level;
|
||||
}
|
||||
|
||||
void MenuBar::Execute(Ctrl *owner, Callback1<Bar&> proc, Point p)
|
||||
|
|
|
|||
|
|
@ -146,4 +146,4 @@ to [%-*@3 sz].&]
|
|||
onst]&]
|
||||
[s2; Returns the maximum icons size.&]
|
||||
[s3;%- &]
|
||||
[s0; ]
|
||||
[s0; ]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue