Add new classes FCheckMenuItem and FRadioMenuItem

This commit is contained in:
Markus Gans 2015-11-15 22:31:55 +01:00
parent 0c0453eb79
commit bfac128c3d
2 changed files with 6 additions and 10 deletions

View File

@ -218,16 +218,9 @@ void FMenu::hideSuperMenus()
if ( isMenuBar(super) ) if ( isMenuBar(super) )
{ {
FMenuBar* mbar = reinterpret_cast<FMenuBar*>(super); FMenuBar* mbar = reinterpret_cast<FMenuBar*>(super);
FMenuItem* selectedMenuItem = mbar->getSelectedItem();
if ( selectedMenuItem ) if ( mbar->hasSelectedItem() )
{ mbar->leaveMenuBar();
selectedMenuItem->unsetSelected();
selectedMenuItem = 0;
mbar->mouse_down = false;
mbar->drop_down = false;
mbar->redraw();
}
} }
else if ( isMenu(super) ) else if ( isMenu(super) )
{ {

View File

@ -446,6 +446,9 @@ void FMenuBar::adjustSize()
void FMenuBar::leaveMenuBar() void FMenuBar::leaveMenuBar()
{ {
resetMenu(); resetMenu();
if ( hasSelectedItem() )
getSelectedItem()->unsetSelected();
setSelectedItem(0);
redraw(); redraw();
activatePrevWindow(); activatePrevWindow();
getActiveWindow()->getFocusWidget()->setFocus(); getActiveWindow()->getFocusWidget()->setFocus();
@ -454,7 +457,7 @@ void FMenuBar::leaveMenuBar()
statusBar()->drawMessage(); statusBar()->drawMessage();
updateTerminal(); updateTerminal();
flush_out(); flush_out();
drop_down = false; mouse_down = false;
} }
// public methods of FMenuBar // public methods of FMenuBar