MCPcopy Create free account
hub / github.com/NetHack/NetHack / NetHackQtMainWindow

Method NetHackQtMainWindow

outdated/win/Qt3/qt3_win.cpp:3544–3798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3542
3543
3544NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
3545 message(0), map(0), status(0), invusage(0),
3546 keysink(ks), dirkey(0)
3547{
3548 QToolBar* toolbar = new QToolBar(this);
3549#if QT_VERSION >= 210
3550 setToolBarsMovable(FALSE);
3551 toolbar->setHorizontalStretchable(TRUE);
3552 toolbar->setVerticalStretchable(TRUE);
3553#endif
3554 addToolBar(toolbar);
3555 menubar = menuBar();
3556
3557 setCaption("Qt NetHack");
3558 if ( qt_compact_mode )
3559 setIcon(QPixmap(nh_icon_small));
3560 else
3561 setIcon(QPixmap(nh_icon));
3562
3563 QPopupMenu* game=new QPopupMenu;
3564 QPopupMenu* apparel=new QPopupMenu;
3565 QPopupMenu* act1=new QPopupMenu;
3566 QPopupMenu* act2 = qt_compact_mode ? new QPopupMenu : act1;
3567 QPopupMenu* magic=new QPopupMenu;
3568 QPopupMenu* info=new QPopupMenu;
3569
3570 QPopupMenu *help;
3571
3572#ifdef KDE
3573 help = kapp->getHelpMenu( TRUE, "" );
3574 help->insertSeparator();
3575#else
3576 help = qt_compact_mode ? info : new QPopupMenu;
3577#endif
3578
3579 enum { OnDesktop=1, OnHandhelds=2 };
3580 struct Macro {
3581 QPopupMenu* menu;
3582 const char* name;
3583 const char* action;
3584 int flags;
3585 } item[] = {
3586 { game, 0, 0, 3},
3587 { game, "Version\tv", "v", 3},
3588 { game, "Compilation\tAlt+V", "\366", 3},
3589 { game, "History\tShift+V", "V", 3},
3590 { game, "Redraw\tCtrl+R", "\022", 0}, // useless
3591 { game, "Options\tShift+O", "O", 3},
3592 { game, "Explore mode\tShift+X", "X", 3},
3593 { game, 0, 0, 3},
3594 { game, "Save\tSy", "Sy", 3},
3595 { game, "Quit\tAlt+Q", "\361", 3},
3596
3597 { apparel, "Apparel off\tShift+A", "A", 2},
3598 { apparel, "Remove many\tShift+A", "A", 1},
3599 { apparel, 0, 0, 3},
3600 { apparel, "Wield weapon\tw", "w", 3},
3601 { apparel, "Exchange weapons\tx", "x", 3},

Callers

nothing calls this directly

Calls 3

insertItemMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected