void DOSBoxMenu::setScale(size_t s) { if (s == 0) s = 1; if (s > 2) s = 2; if (fontCharScale != s) { fontCharScale = s; menuBarHeight = menuBarHeightBase * fontCharScale; fontCharWidth = fontCharWidthBase * fontCharScale; fontCharHeight = fontCharHeightBase * fontCharScale; updateRect(); layoutMenu(); } }
GuiContextMenu::GuiContextMenu(GuiManager * manager, ContextMenuList const& list) : GuiCollection(manager) { assert(!list.empty()); m_handles.reserve(list.size()); for (auto const& entry : list) { auto handle = addChildWindow<GuiContextMenuEntry>(this, entry.first, entry.second); m_handles.push_back(handle); } setBackground(ColourPalette::GREY11); refreshLayout(); layoutMenu(); }
void DOSBoxMenu::rebuild(void) { #if DOSBOXMENU_TYPE == DOSBOXMENU_HMENU /* Windows menu handle */ if (winMenu == NULL) { if (!winMenuInit()) return; } #endif #if DOSBOXMENU_TYPE == DOSBOXMENU_NSMENU /* Mac OS X menu handle */ if (nsMenu == NULL) { if (!nsMenuInit()) return; } #endif #if DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW /* SDL drawn menus */ layoutMenu(); #endif }