void MenuBar::SetupRestoreFocus() { MenuBar *q = GetMasterMenu(); while(q) { if(q->HasFocusDeep()) return; q = q->submenu; } restorefocus = GetFocusCtrl(); LLOG("SetupRestoreFocus -> " << UPP::Name(restorefocus)); }
void MenuBar::PostDeactivate() { LLOG("PostDeactivate"); MenuBar *q = GetLastSubmenu(); MenuBar *u = q; while(q && q->IsPopUp()) { if(q->IsOpen() && q->HasFocusDeep()) return; q = q->parentmenu; } if(u->IsPopUp()) { while(u->parentmenu && u->parentmenu->IsPopUp()) u = u->parentmenu; Ctrl *w = GetActiveCtrl(); while(w) { if(w == u) return; w = w->GetOwner(); } } CloseMenu(); }