Exemplo n.º 1
0
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();
    }
}
Exemplo n.º 2
0
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();
}
Exemplo n.º 3
0
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
}