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:
cxl 2012-09-17 09:14:40 +00:00
parent bbc8ef005a
commit dfb118a820
2 changed files with 6 additions and 2 deletions

View file

@ -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)

View file

@ -146,4 +146,4 @@ to [%-*@3 sz].&]
onst]&]
[s2; Returns the maximum icons size.&]
[s3;%- &]
[s0; ]
[s0; ]]