/* Создает все необходимые меню и помечает их для дальнейшего перевода */ void MainWindow::CreateMenus() { menuMap = new QMap<QString,QMenu*>; QMenu *pMenuFile = ui->menuBar->addMenu(MainWindow::tr("&File")); menuMap->insert("File",pMenuFile); pMenuFile->addAction(MainWindow::tr("&Open"),this, SLOT(ShowDialog()), QKeySequence::Open); QAction * m_pActionSeparator = pMenuFile->addSeparator(); m_pActionSeparator->setVisible(true); pMenuFile->addAction(MainWindow::tr("E&xit"),this,SLOT(close()), QKeySequence::Quit); QMenu *pMenuWindow = ui->menuBar->addMenu(MainWindow::tr("&View")); menuMap->insert("View",pMenuWindow); pMenuWindow->addAction(MainWindow::tr("&Close all windows"),this, SLOT(CloseSubWindows()), QKeySequence::Close); m_pActionSeparator = pMenuFile->addSeparator(); m_pActionSeparator->setVisible(true); QMenu *pMenuAbout = ui->menuBar->addMenu(MainWindow::tr("&Help")); pMenuAbout->addAction(MainWindow::tr("&About"),this, SLOT(ShowAbout()), QKeySequence::HelpContents); }
void menu_mplayer(ULONG menucode) { printf("menu num %d\n", ITEMNUM(menucode)); switch (ITEMNUM(menucode)) { case ID_load_file: cmd_load_file(); break; case ID_open_dvd: cmd_open_dvd(); break; case ID_open_dvdnav: cmd_open_dvdnav(); break; case ID_open_vcd: cmd_open_vcd(); break; case ID_open_network: cmd_open_network(); break; case ID_about: ShowAbout(); break; case ID_quit: put_command0(MP_CMD_QUIT); break; } }
long CMainWindow::OnCommand(unsigned short id, unsigned short cmd, HWND) { switch(id) { case ID_FILE_SAVE: SaveCurrentDocument(); break; case ID_FILE_QUIT: Destroy(); break; case ID_MAINMENU_MODIFY_ZONE: ShowZoneEditor(); break; case ID_MAINMENU_INSPECT_WEAPONS: ShowAppearanceViewer(); break; case ID_MAINMENU_INSPECT_WORLD_GRIDANIAINN: ShowWorldViewer(0xA09B0000); break; case ID_MAINMENU_INSPECT_WORLD_LIMSALOMINSAINN: ShowWorldViewer(0xA09B0001); break; case ID_MAINMENU_INSPECT_WORLD_ULDAHINN: ShowWorldViewer(0xA09B0002); break; case ID_MAINMENU_INSPECT_GAMEDATASHEETS: ShowSheetViewer(CSheetSchema::GAME_SCHEMA_FILE_ID); break; case ID_MAINMENU_INSPECT_VARDATASHEETS: ShowSheetViewer(CSheetSchema::VAR_SCHEMA_FILE_ID); break; case ID_MAINMENU_SETTINGS_GENERALSETTINGS: InsertDocument(std::move(std::make_unique<CSettingsPage>(m_hWnd))); break; case ID_MAINMENU_HELP_ABOUT: ShowAbout(); break; case ID_TABCONTEXT_CLOSETAB: if(m_tabs.GetItemCount()) { if(m_tabContextMenuSelection == -1) { CloseTab(m_tabs.GetSelection()); } else { CloseTab(m_tabContextMenuSelection); } } break; } return FALSE; }
OBSAbout::OBSAbout(QWidget *parent) : QDialog(parent), ui(new Ui::OBSAbout) { ui->setupUi(this); setFixedSize(size()); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); QString bitness; if(sizeof(void*) == 4) bitness = " (32 bit)"; else if(sizeof(void*) == 8) bitness = " (64 bit)"; ui->version->setText( QString::number(LIBOBS_API_MAJOR_VER) + "." + QString::number(LIBOBS_API_MINOR_VER) + "." + QString::number(LIBOBS_API_PATCH_VER) + bitness); ui->contribute->setText(QTStr("About.Contribute")); ui->donate->setText("<a href='https://obsproject.com/donate'>" + QTStr("About.Donate") + "</a>"); ui->donate->setTextInteractionFlags(Qt::TextBrowserInteraction); ui->donate->setOpenExternalLinks(true); ui->getInvolved->setText("<a href='https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst'>" + QTStr("About.GetInvolved") + "</a>"); ui->getInvolved->setTextInteractionFlags(Qt::TextBrowserInteraction); ui->getInvolved->setOpenExternalLinks(true); ui->about->setText("<a href='#'>" + QTStr("About") + "</a>"); ui->authors->setText("<a href='#'>" + QTStr("About.Authors") + "</a>"); ui->license->setText("<a href='#'>" + QTStr("About.License") + "</a>"); ui->textBrowser->hide(); ui->name->setProperty("themeID", "aboutName"); ui->version->setProperty("themeID", "aboutVersion"); ui->about->setProperty("themeID", "aboutHLayout"); ui->authors->setProperty("themeID", "aboutHLayout"); ui->license->setProperty("themeID", "aboutHLayout"); ui->info->setProperty("themeID", "aboutInfo"); connect(ui->about, SIGNAL(clicked()), this, SLOT(ShowAbout())); connect(ui->authors, SIGNAL(clicked()), this, SLOT(ShowAuthors())); connect(ui->license, SIGNAL(clicked()), this, SLOT(ShowLicense())); }
void Menu::MainMenu() { char *Way = "Main Menu"; int ch = 255; while (true) { puts(Way); puts("1. Work with general students list"); puts("2. Print statements"); puts("3. Find students on a any field of date base"); puts("4. About"); puts("0. Exit"); scanf("%d", &ch); if (!ch) break; switch (ch) { case 1: { WorkWithGeneralStudList(Way); break; } case 2: { db->PrintStatement(Way); break; } case 3: { FindStudents(Way); break; } case 4: { ShowAbout(Way); break; } default: { break; } } getchar(); } }
void WinFrame::OnMenuItem(wxCommandEvent& event) { switch (event.GetId()) { case MENU_QUIT: Close(); break; case MENU_INTRO: ShowIntro(); break; case MENU_DEMO: ShowDemo(); break; case MENU_INFO: ShowAbout(); break; } }
void Debugger::AboutRequested() { ShowAbout(); }
TazDlg::TazDlg(QWidget* pParent) : QMainWindow(pParent), m_settings("tobis_stuff", "takin"), m_pSettingsDlg(new SettingsDlg(this, &m_settings)), m_pStatusMsg(new QLabel(this)), m_pCoordQStatusMsg(new QLabel(this)), m_pCoordCursorStatusMsg(new QLabel(this)), m_sceneRecip(this), m_dlgRecipParam(this, &m_settings), m_dlgRealParam(this, &m_settings), m_pGotoDlg(new GotoDlg(this, &m_settings)) { //log_debug("In ", __func__, "."); const bool bSmallqVisible = 0; const bool bBZVisible = 1; const bool bWSVisible = 1; this->setupUi(this); this->setWindowTitle(s_strTitle.c_str()); this->setFont(g_fontGen); this->setWindowIcon(load_icon("res/icons/takin.svg")); btnAtoms->setEnabled(g_bHasScatlens); if(m_settings.contains("main/geo")) { QByteArray geo = m_settings.value("main/geo").toByteArray(); restoreGeometry(geo); } /*if(m_settings.contains("main/width") && m_settings.contains("main/height")) { int iW = m_settings.value("main/width").toInt(); int iH = m_settings.value("main/height").toInt(); resize(iW, iH); }*/ m_pStatusMsg->setFrameStyle(QFrame::Panel | QFrame::Sunken); m_pCoordQStatusMsg->setFrameStyle(QFrame::Panel | QFrame::Sunken); m_pCoordCursorStatusMsg->setFrameStyle(QFrame::Panel | QFrame::Sunken); for(QLabel* pLabel : {m_pStatusMsg/*, m_pCoordQStatusMsg, m_pCoordCursorStatusMsg*/}) pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred); QStatusBar *pStatusBar = new QStatusBar(this); pStatusBar->addWidget(m_pStatusMsg, 1); pStatusBar->addPermanentWidget(m_pCoordQStatusMsg, 0); pStatusBar->addPermanentWidget(m_pCoordCursorStatusMsg, 0); m_pCoordQStatusMsg->setMinimumWidth(350); m_pCoordQStatusMsg->setAlignment(Qt::AlignCenter); m_pCoordCursorStatusMsg->setMinimumWidth(325); m_pCoordCursorStatusMsg->setAlignment(Qt::AlignCenter); this->setStatusBar(pStatusBar); // -------------------------------------------------------------------------------- m_vecEdits_real = { editA, editB, editC, editAlpha, editBeta, editGamma }; m_vecEdits_recip = { editARecip, editBRecip, editCRecip, editAlphaRecip, editBetaRecip, editGammaRecip }; m_vecEdits_plane = { editScatX0, editScatX1, editScatX2, editScatY0, editScatY1, editScatY2, editRealX0, editRealX1, editRealX2, editRealY0, editRealY1, editRealY2, }; m_vecEdits_monoana = { editMonoD, editAnaD }; //m_vecSpinBoxesSample = { spinRotPhi, spinRotTheta, spinRotPsi }; m_vecCheckBoxesSenses = { checkSenseM, checkSenseS, checkSenseA }; m_vecEditNames_real = { "sample/a", "sample/b", "sample/c", "sample/alpha", "sample/beta", "sample/gamma" }; m_vecEditNames_recip = { "sample/a_recip", "sample/b_recip", "sample/c_recip", "sample/alpha_recip", "sample/beta_recip", "sample/gamma_recip" }; m_vecEditNames_plane = { "plane/x0", "plane/x1", "plane/x2", "plane/y0", "plane/y1", "plane/y2", "plane/real_x0", "plane/real_x1", "plane/real_x2", "plane/real_y0", "plane/real_y1", "plane/real_y2", }; m_vecEditNames_monoana = { "tas/mono_d", "tas/ana_d" }; m_vecSpinBoxNamesSample = {"sample/phi", "sample/theta", "sample/psi"}; m_vecCheckBoxNamesSenses = {"tas/sense_m", "tas/sense_s", "tas/sense_a"}; // recip m_pviewRecip = new ScatteringTriangleView(groupRecip); groupRecip->addTab(m_pviewRecip, "Reciprocal Lattice"); m_pviewProjRecip = new ProjLatticeView(groupRecip); groupRecip->addTab(m_pviewProjRecip, "Projection"); m_pviewRecip->setScene(&m_sceneRecip); m_pviewProjRecip->setScene(&m_sceneProjRecip); if(m_settings.contains("main/recip_tab")) groupRecip->setCurrentIndex(m_settings.value("main/recip_tab").value<int>()); // real m_pviewRealLattice = new LatticeView(groupReal); groupReal->addTab(m_pviewRealLattice, "Real Lattice"); m_pviewReal = new TasLayoutView(groupReal); groupReal->addTab(m_pviewReal, "TAS Instrument"); m_pviewTof = new TofLayoutView(groupReal); groupReal->addTab(m_pviewTof, "TOF Instrument"); m_pviewRealLattice->setScene(&m_sceneRealLattice); m_pviewReal->setScene(&m_sceneReal); m_pviewTof->setScene(&m_sceneTof); if(m_settings.contains("main/real_tab")) groupReal->setCurrentIndex(m_settings.value("main/real_tab").value<int>()); QObject::connect(m_pSettingsDlg, SIGNAL(SettingsChanged()), this, SLOT(SettingsChanged())); QObject::connect(&m_sceneReal, SIGNAL(nodeEvent(bool)), this, SLOT(RealNodeEvent(bool))); QObject::connect(&m_sceneRecip, SIGNAL(nodeEvent(bool)), this, SLOT(RecipNodeEvent(bool))); QObject::connect(&m_sceneTof, SIGNAL(nodeEvent(bool)), this, SLOT(TofNodeEvent(bool))); // TAS QObject::connect(&m_sceneRecip, SIGNAL(triangleChanged(const TriangleOptions&)), &m_sceneReal, SLOT(triangleChanged(const TriangleOptions&))); QObject::connect(&m_sceneReal, SIGNAL(tasChanged(const TriangleOptions&)), &m_sceneRecip, SLOT(tasChanged(const TriangleOptions&))); QObject::connect(&m_sceneRecip, SIGNAL(paramsChanged(const RecipParams&)), &m_sceneReal, SLOT(recipParamsChanged(const RecipParams&))); // TOF QObject::connect(&m_sceneRecip, SIGNAL(triangleChanged(const TriangleOptions&)), &m_sceneTof, SLOT(triangleChanged(const TriangleOptions&))); QObject::connect(&m_sceneTof, SIGNAL(tasChanged(const TriangleOptions&)), &m_sceneRecip, SLOT(tasChanged(const TriangleOptions&))); QObject::connect(&m_sceneRecip, SIGNAL(paramsChanged(const RecipParams&)), &m_sceneTof, SLOT(recipParamsChanged(const RecipParams&))); // connections between instruments QObject::connect(&m_sceneTof, SIGNAL(tasChanged(const TriangleOptions&)), &m_sceneReal, SLOT(triangleChanged(const TriangleOptions&))); QObject::connect(&m_sceneReal, SIGNAL(tasChanged(const TriangleOptions&)), &m_sceneTof, SLOT(triangleChanged(const TriangleOptions&))); // scale factor if(m_pviewRecip) QObject::connect(m_pviewRecip, SIGNAL(scaleChanged(t_real_glob)), &m_sceneRecip, SLOT(scaleChanged(t_real_glob))); if(m_pviewProjRecip) QObject::connect(m_pviewProjRecip, SIGNAL(scaleChanged(t_real_glob)), &m_sceneProjRecip, SLOT(scaleChanged(t_real_glob))); if(m_pviewRealLattice) QObject::connect(m_pviewRealLattice, SIGNAL(scaleChanged(t_real_glob)), &m_sceneRealLattice, SLOT(scaleChanged(t_real_glob))); if(m_pviewReal) QObject::connect(m_pviewReal, SIGNAL(scaleChanged(t_real_glob)), &m_sceneReal, SLOT(scaleChanged(t_real_glob))); if(m_pviewTof) QObject::connect(m_pviewTof, SIGNAL(scaleChanged(t_real_glob)), &m_sceneTof, SLOT(scaleChanged(t_real_glob))); // parameter dialogs QObject::connect(&m_sceneRecip, SIGNAL(paramsChanged(const RecipParams&)), &m_dlgRecipParam, SLOT(paramsChanged(const RecipParams&))); QObject::connect(&m_sceneReal, SIGNAL(paramsChanged(const RealParams&)), &m_dlgRealParam, SLOT(paramsChanged(const RealParams&))); // cursor position QObject::connect(&m_sceneRecip, SIGNAL(coordsChanged(t_real_glob, t_real_glob, t_real_glob, bool, t_real_glob, t_real_glob, t_real_glob)), this, SLOT(RecipCoordsChanged(t_real_glob, t_real_glob, t_real_glob, bool, t_real_glob, t_real_glob, t_real_glob))); QObject::connect(&m_sceneProjRecip, SIGNAL(coordsChanged(t_real_glob, t_real_glob, t_real_glob, bool, t_real_glob, t_real_glob, t_real_glob)), this, SLOT(RecipCoordsChanged(t_real_glob, t_real_glob, t_real_glob, bool, t_real_glob, t_real_glob, t_real_glob))); QObject::connect(&m_sceneRealLattice, SIGNAL(coordsChanged(t_real_glob, t_real_glob, t_real_glob, bool, t_real_glob, t_real_glob, t_real_glob)), this, SLOT(RealCoordsChanged(t_real_glob, t_real_glob, t_real_glob, bool, t_real_glob, t_real_glob, t_real_glob))); QObject::connect(&m_sceneRecip, SIGNAL(spurionInfo(const tl::ElasticSpurion&, const std::vector<tl::InelasticSpurion<t_real_glob>>&, const std::vector<tl::InelasticSpurion<t_real_glob>>&)), this, SLOT(spurionInfo(const tl::ElasticSpurion&, const std::vector<tl::InelasticSpurion<t_real_glob>>&, const std::vector<tl::InelasticSpurion<t_real_glob>>&))); QObject::connect(m_pGotoDlg, SIGNAL(vars_changed(const CrystalOptions&, const TriangleOptions&)), this, SLOT(VarsChanged(const CrystalOptions&, const TriangleOptions&))); QObject::connect(&m_sceneRecip, SIGNAL(paramsChanged(const RecipParams&)), m_pGotoDlg, SLOT(RecipParamsChanged(const RecipParams&))); QObject::connect(&m_sceneRecip, SIGNAL(paramsChanged(const RecipParams&)), this, SLOT(recipParamsChanged(const RecipParams&))); for(QLineEdit* pEdit : m_vecEdits_monoana) QObject::connect(pEdit, SIGNAL(textEdited(const QString&)), this, SLOT(UpdateDs())); for(QLineEdit* pEdit : m_vecEdits_real) { QObject::connect(pEdit, SIGNAL(textEdited(const QString&)), this, SLOT(CheckCrystalType())); QObject::connect(pEdit, SIGNAL(textEdited(const QString&)), this, SLOT(CalcPeaks())); } for(QLineEdit* pEdit : m_vecEdits_plane) { QObject::connect(pEdit, SIGNAL(textEdited(const QString&)), this, SLOT(CalcPeaks())); } //for(QDoubleSpinBox* pSpin : m_vecSpinBoxesSample) // QObject::connect(pSpin, SIGNAL(valueChanged(t_real)), this, SLOT(CalcPeaks())); for(QLineEdit* pEdit : m_vecEdits_recip) { QObject::connect(pEdit, SIGNAL(textEdited(const QString&)), this, SLOT(CheckCrystalType())); QObject::connect(pEdit, SIGNAL(textEdited(const QString&)), this, SLOT(CalcPeaksRecip())); } QObject::connect(checkSenseM, SIGNAL(stateChanged(int)), this, SLOT(UpdateMonoSense())); QObject::connect(checkSenseS, SIGNAL(stateChanged(int)), this, SLOT(UpdateSampleSense())); QObject::connect(checkSenseA, SIGNAL(stateChanged(int)), this, SLOT(UpdateAnaSense())); QObject::connect(editSpaceGroupsFilter, SIGNAL(textEdited(const QString&)), this, SLOT(RepopulateSpaceGroups())); QObject::connect(comboSpaceGroups, SIGNAL(currentIndexChanged(int)), this, SLOT(SetCrystalType())); QObject::connect(comboSpaceGroups, SIGNAL(currentIndexChanged(int)), this, SLOT(CalcPeaks())); QObject::connect(checkPowder, SIGNAL(stateChanged(int)), this, SLOT(CalcPeaks())); QObject::connect(btnAtoms, SIGNAL(clicked(bool)), this, SLOT(ShowAtomsDlg())); // -------------------------------------------------------------------------------- // file menu QMenu *pMenuFile = new QMenu("File", this); QAction *pNew = new QAction("New", this); pNew->setIcon(load_icon("res/icons/document-new.svg")); pMenuFile->addAction(pNew); pMenuFile->addSeparator(); QAction *pLoad = new QAction("Load...", this); pLoad->setIcon(load_icon("res/icons/document-open.svg")); pMenuFile->addAction(pLoad); m_pMenuRecent = new QMenu("Recently Loaded", this); tl::RecentFiles recent(&m_settings, "main/recent"); m_pMapperRecent = new QSignalMapper(m_pMenuRecent); QObject::connect(m_pMapperRecent, SIGNAL(mapped(const QString&)), this, SLOT(LoadFile(const QString&))); recent.FillMenu(m_pMenuRecent, m_pMapperRecent); pMenuFile->addMenu(m_pMenuRecent); QAction *pSave = new QAction("Save", this); pSave->setIcon(load_icon("res/icons/document-save.svg")); pMenuFile->addAction(pSave); QAction *pSaveAs = new QAction("Save as...", this); pSaveAs->setIcon(load_icon("res/icons/document-save-as.svg")); pMenuFile->addAction(pSaveAs); pMenuFile->addSeparator(); QAction *pImport = new QAction("Import...", this); pImport->setIcon(load_icon("res/icons/drive-harddisk.svg")); pMenuFile->addAction(pImport); m_pMenuRecentImport = new QMenu("Recently Imported", this); tl::RecentFiles recentimport(&m_settings, "main/recent_import"); m_pMapperRecentImport = new QSignalMapper(m_pMenuRecentImport); QObject::connect(m_pMapperRecentImport, SIGNAL(mapped(const QString&)), this, SLOT(ImportFile(const QString&))); recentimport.FillMenu(m_pMenuRecentImport, m_pMapperRecentImport); pMenuFile->addMenu(m_pMenuRecentImport); pMenuFile->addSeparator(); QAction *pSettings = new QAction("Settings...", this); pSettings->setIcon(load_icon("res/icons/preferences-system.svg")); pMenuFile->addAction(pSettings); pMenuFile->addSeparator(); QAction *pExit = new QAction("Exit", this); pExit->setIcon(load_icon("res/icons/system-log-out.svg")); pMenuFile->addAction(pExit); // -------------------------------------------------------------------------------- // recip menu m_pMenuViewRecip = new QMenu("Reciprocal Space", this); m_pGoto = new QAction("Go to Position...", this); m_pGoto->setIcon(load_icon("res/icons/goto.svg")); m_pMenuViewRecip->addAction(m_pGoto); QAction *pRecipParams = new QAction("Information...", this); m_pMenuViewRecip->addAction(pRecipParams); m_pMenuViewRecip->addSeparator(); m_pSmallq = new QAction("Show Reduced Scattering Vector q", this); m_pSmallq->setIcon(load_icon("res/icons/q.svg")); m_pSmallq->setCheckable(1); m_pSmallq->setChecked(bSmallqVisible); m_pMenuViewRecip->addAction(m_pSmallq); m_pSnapSmallq = new QAction("Snap G to Bragg Peak", this); m_pSnapSmallq->setCheckable(1); m_pSnapSmallq->setChecked(m_sceneRecip.getSnapq()); m_pMenuViewRecip->addAction(m_pSnapSmallq); QAction *pKeepAbsKiKf = new QAction("Keep |ki| and |kf| Fixed", this); pKeepAbsKiKf->setCheckable(1); pKeepAbsKiKf->setChecked(m_sceneRecip.getKeepAbsKiKf()); m_pMenuViewRecip->addAction(pKeepAbsKiKf); m_pBZ = new QAction("Show First Brillouin Zone", this); m_pBZ->setIcon(load_icon("res/icons/brillouin.svg")); m_pBZ->setCheckable(1); m_pBZ->setChecked(bBZVisible); m_pMenuViewRecip->addAction(m_pBZ); QMenu *pMenuEwald = new QMenu("Ewald Sphere", this); QActionGroup *pGroupEwald = new QActionGroup(this); m_pEwaldSphereNone = new QAction("Disabled", this); m_pEwaldSphereKi = new QAction("Around ki", this); m_pEwaldSphereKf = new QAction("Around kf", this); for(QAction* pAct : {m_pEwaldSphereNone, m_pEwaldSphereKi, m_pEwaldSphereKf}) { pAct->setCheckable(1); pGroupEwald->addAction(pAct); } m_pEwaldSphereKf->setChecked(1); pMenuEwald->addActions(pGroupEwald->actions()); m_pMenuViewRecip->addMenu(pMenuEwald); m_pMenuViewRecip->addSeparator(); QMenu *pMenuProj = new QMenu("Projection", this); pMenuProj->setTearOffEnabled(1); QActionGroup *pGroupProj = new QActionGroup(this); m_pProjGnom = new QAction("Gnomonic", this); m_pProjStereo = new QAction("Stereographic", this); m_pProjPara = new QAction("Parallel", this); m_pProjPersp = new QAction("Perspectivic", this); for(QAction *pAct : {m_pProjGnom, m_pProjStereo, m_pProjPara, m_pProjPersp}) { pAct->setCheckable(1); pGroupProj->addAction(pAct); } m_pProjStereo->setChecked(1); pMenuProj->addActions(pGroupProj->actions()); m_pMenuViewRecip->addMenu(pMenuProj); #if !defined NO_3D QAction *pView3D = new QAction("3D View...", this); //pView3D->setIcon(QIcon::fromTheme("applications-graphics")); m_pMenuViewRecip->addAction(pView3D); #endif m_pMenuViewRecip->addSeparator(); QAction *pRecipExport = new QAction("Export Lattice Graphics...", this); pRecipExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewRecip->addAction(pRecipExport); QAction *pProjExport = new QAction("Export Projection Graphics...", this); pProjExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewRecip->addAction(pProjExport); #ifdef USE_GIL QAction *pBZExport = new QAction("Export Brillouin Zone Image...", this); pBZExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewRecip->addAction(pBZExport); #endif // -------------------------------------------------------------------------------- // real menu m_pMenuViewReal = new QMenu("Real Space", this); m_pMenuViewReal->addAction(m_pGoto); QAction *pRealParams = new QAction("Information...", this); m_pMenuViewReal->addAction(pRealParams); m_pMenuViewReal->addSeparator(); m_pShowRealQDir = new QAction("Show Q Direction", this); m_pShowRealQDir->setCheckable(1); m_pShowRealQDir->setChecked(m_sceneReal.GetTasLayout()->GetRealQVisible()); m_pMenuViewReal->addAction(m_pShowRealQDir); m_pWS = new QAction("Show Wigner-Seitz Cell", this); m_pWS->setIcon(load_icon("res/icons/brillouin.svg")); m_pWS->setCheckable(1); m_pWS->setChecked(bWSVisible); m_pMenuViewReal->addAction(m_pWS); m_pMenuViewReal->addSeparator(); #if !defined NO_3D QAction *pView3DReal = new QAction("3D View...", this); //pView3DReal->setIcon(QIcon::fromTheme("applications-graphics")); m_pMenuViewReal->addAction(pView3DReal); m_pMenuViewReal->addSeparator(); #endif QAction *pRealLatticeExport = new QAction("Export Lattice Graphics...", this); pRealLatticeExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewReal->addAction(pRealLatticeExport); QAction *pRealExport = new QAction("Export TAS Layout...", this); pRealExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewReal->addAction(pRealExport); QAction *pTofExport = new QAction("Export TOF Layout...", this); pTofExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewReal->addAction(pTofExport); #ifdef USE_GIL QAction *pWSExport = new QAction("Export Wigner-Seitz Cell Image...", this); pWSExport->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewReal->addAction(pWSExport); #endif QAction *pExportUC = new QAction("Export Unit Cell Model...", this); pExportUC->setIcon(load_icon("res/icons/image-x-generic.svg")); m_pMenuViewReal->addAction(pExportUC); // -------------------------------------------------------------------------------- // resolution menu QMenu *pMenuReso = new QMenu("Resolution", this); QAction *pResoParams = new QAction("Parameters...", this); pResoParams->setIcon(load_icon("res/icons/accessories-calculator.svg")); pMenuReso->addAction(pResoParams); pMenuReso->addSeparator(); QAction *pResoEllipses = new QAction("Ellipses...", this); pResoEllipses->setIcon(load_icon("res/icons/ellipses.svg")); pMenuReso->addAction(pResoEllipses); #if !defined NO_3D QAction *pResoEllipses3D = new QAction("3D Ellipsoids...", this); pMenuReso->addAction(pResoEllipses3D); #endif pMenuReso->addSeparator(); QAction *pResoConv = new QAction("Convolution...", this); pMenuReso->addAction(pResoConv); // -------------------------------------------------------------------------------- // calc menu QMenu *pMenuCalc = new QMenu("Calculation", this); QAction *pNeutronProps = new QAction("Neutron Properties...", this); pNeutronProps->setIcon(load_icon("res/icons/x-office-spreadsheet-template.svg")); pMenuCalc->addAction(pNeutronProps); pMenuCalc->addSeparator(); QAction *pPowder = new QAction("Powder Lines...", this); pPowder->setIcon(load_icon("res/icons/weather-snow.svg")); pMenuCalc->addAction(pPowder); QAction *pDW = new QAction("Scattering Factors...", this); pMenuCalc->addAction(pDW); QAction *pFormfactor = nullptr; if(g_bHasFormfacts && g_bHasScatlens) { pFormfactor = new QAction("Form Factors...", this); pMenuCalc->addAction(pFormfactor); } QAction *pSgList = new QAction("Space Group Types...", this); pMenuCalc->addAction(pSgList); QAction *pDisp = new QAction("Dispersions...", this); //pDisp->setIcon(load_icon("disp.svg")); pMenuCalc->addAction(pDisp); pMenuCalc->addSeparator(); QAction *pDynPlane = new QAction("Kinematic Plane...", this); pMenuCalc->addAction(pDynPlane); QAction *pSpuri = new QAction("Spurious Scattering...", this); pMenuCalc->addAction(pSpuri); #if !defined NO_NET // -------------------------------------------------------------------------------- // network menu QMenu *pMenuNet = new QMenu("Network", this); QAction *pConn = new QAction("Connect to Instrument...", this); pConn->setIcon(load_icon("res/icons/network-transmit-receive.svg")); pMenuNet->addAction(pConn); QAction *pDisconn = new QAction("Disconnect", this); pDisconn->setIcon(load_icon("res/icons/network-offline.svg")); pMenuNet->addAction(pDisconn); pMenuNet->addSeparator(); QAction *pNetScanMon = new QAction("Scan Monitor...", this); pMenuNet->addAction(pNetScanMon); QAction *pNetCache = new QAction("Network Cache...", this); pMenuNet->addAction(pNetCache); QAction *pNetRefresh = new QAction("Refresh", this); pNetRefresh->setIcon(load_icon("res/icons/view-refresh.svg")); pMenuNet->addSeparator(); pMenuNet->addAction(pNetRefresh); #endif // -------------------------------------------------------------------------------- // tools menu QMenu *pMenuTools = new QMenu("Tools", this); QAction *pScanViewer = new QAction("Scan Viewer...", this); pMenuTools->addAction(pScanViewer); // -------------------------------------------------------------------------------- // help menu QMenu *pMenuHelp = new QMenu("Help", this); QAction *pHelp = new QAction("Show Help...", this); pHelp->setIcon(load_icon("res/icons/help-browser.svg")); pMenuHelp->addAction(pHelp); QAction *pDevelDoc = new QAction("Show Developer Help...", this); if(find_resource("doc/devel/html/index.html", 0) == "") pDevelDoc->setEnabled(0); pDevelDoc->setIcon(load_icon("res/icons/help-browser.svg")); pMenuHelp->addAction(pDevelDoc); pMenuHelp->addSeparator(); QAction *pAboutQt = new QAction("About Qt...", this); //pAboutQt->setIcon(QIcon::fromTheme("help-about")); pMenuHelp->addAction(pAboutQt); //pMenuHelp->addSeparator(); QAction *pAbout = new QAction("About Takin...", this); pAbout->setIcon(load_icon("res/icons/dialog-information.svg")); pMenuHelp->addAction(pAbout); // -------------------------------------------------------------------------------- QMenuBar *pMenuBar = new QMenuBar(this); pMenuBar->addMenu(pMenuFile); pMenuBar->addMenu(m_pMenuViewRecip); pMenuBar->addMenu(m_pMenuViewReal); pMenuBar->addMenu(pMenuReso); pMenuBar->addMenu(pMenuCalc); pMenuBar->addMenu(pMenuTools); #if !defined NO_NET pMenuBar->addMenu(pMenuNet); #endif pMenuBar->addMenu(pMenuHelp); QObject::connect(pNew, SIGNAL(triggered()), this, SLOT(New())); QObject::connect(pLoad, SIGNAL(triggered()), this, SLOT(Load())); QObject::connect(pSave, SIGNAL(triggered()), this, SLOT(Save())); QObject::connect(pSaveAs, SIGNAL(triggered()), this, SLOT(SaveAs())); QObject::connect(pImport, SIGNAL(triggered()), this, SLOT(Import())); QObject::connect(pScanViewer, SIGNAL(triggered()), this, SLOT(ShowScanViewer())); QObject::connect(pSettings, SIGNAL(triggered()), this, SLOT(ShowSettingsDlg())); QObject::connect(pExit, SIGNAL(triggered()), this, SLOT(close())); QObject::connect(m_pSmallq, SIGNAL(toggled(bool)), this, SLOT(EnableSmallq(bool))); QObject::connect(m_pBZ, SIGNAL(toggled(bool)), this, SLOT(EnableBZ(bool))); QObject::connect(m_pWS, SIGNAL(toggled(bool)), this, SLOT(EnableWS(bool))); for(QAction* pAct : {m_pEwaldSphereNone, m_pEwaldSphereKi, m_pEwaldSphereKf}) QObject::connect(pAct, SIGNAL(triggered()), this, SLOT(ShowEwaldSphere())); QObject::connect(m_pShowRealQDir, SIGNAL(toggled(bool)), this, SLOT(EnableRealQDir(bool))); QObject::connect(m_pSnapSmallq, SIGNAL(toggled(bool)), &m_sceneRecip, SLOT(setSnapq(bool))); QObject::connect(pKeepAbsKiKf, SIGNAL(toggled(bool)), &m_sceneRecip, SLOT(setKeepAbsKiKf(bool))); QObject::connect(pRecipParams, SIGNAL(triggered()), this, SLOT(ShowRecipParams())); QObject::connect(pRealParams, SIGNAL(triggered()), this, SLOT(ShowRealParams())); for(QAction *pProj : {m_pProjGnom, m_pProjStereo, m_pProjPara, m_pProjPersp}) QObject::connect(pProj, SIGNAL(triggered()), this, SLOT(RecipProjChanged())); #if !defined NO_3D QObject::connect(pView3D, SIGNAL(triggered()), this, SLOT(Show3D())); QObject::connect(pView3DReal, SIGNAL(triggered()), this, SLOT(Show3DReal())); QObject::connect(pResoEllipses3D, SIGNAL(triggered()), this, SLOT(ShowResoEllipses3D())); #endif QObject::connect(pRecipExport, SIGNAL(triggered()), this, SLOT(ExportRecip())); QObject::connect(pProjExport, SIGNAL(triggered()), this, SLOT(ExportProj())); QObject::connect(pRealExport, SIGNAL(triggered()), this, SLOT(ExportReal())); QObject::connect(pTofExport, SIGNAL(triggered()), this, SLOT(ExportTof())); QObject::connect(pRealLatticeExport, SIGNAL(triggered()), this, SLOT(ExportRealLattice())); QObject::connect(pExportUC, SIGNAL(triggered()), this, SLOT(ExportUCModel())); #ifdef USE_GIL QObject::connect(pBZExport, SIGNAL(triggered()), this, SLOT(ExportBZImage())); QObject::connect(pWSExport, SIGNAL(triggered()), this, SLOT(ExportWSImage())); #endif QObject::connect(pResoParams, SIGNAL(triggered()), this, SLOT(ShowResoParams())); QObject::connect(pResoEllipses, SIGNAL(triggered()), this, SLOT(ShowResoEllipses())); QObject::connect(pResoConv, SIGNAL(triggered()), this, SLOT(ShowResoConv())); QObject::connect(pNeutronProps, SIGNAL(triggered()), this, SLOT(ShowNeutronDlg())); QObject::connect(m_pGoto, SIGNAL(triggered()), this, SLOT(ShowGotoDlg())); QObject::connect(pPowder, SIGNAL(triggered()), this, SLOT(ShowPowderDlg())); QObject::connect(pDisp, SIGNAL(triggered()), this, SLOT(ShowDispDlg())); QObject::connect(pSpuri, SIGNAL(triggered()), this, SLOT(ShowSpurions())); QObject::connect(pDW, SIGNAL(triggered()), this, SLOT(ShowDWDlg())); QObject::connect(pDynPlane, SIGNAL(triggered()), this, SLOT(ShowDynPlaneDlg())); #if !defined NO_NET QObject::connect(pConn, SIGNAL(triggered()), this, SLOT(ShowConnectDlg())); QObject::connect(pDisconn, SIGNAL(triggered()), this, SLOT(Disconnect())); QObject::connect(pNetRefresh, SIGNAL(triggered()), this, SLOT(NetRefresh())); QObject::connect(pNetCache, SIGNAL(triggered()), this, SLOT(ShowNetCache())); QObject::connect(pNetScanMon, SIGNAL(triggered()), this, SLOT(ShowNetScanMonitor())); #endif QObject::connect(pSgList, SIGNAL(triggered()), this, SLOT(ShowSgListDlg())); if(pFormfactor) QObject::connect(pFormfactor, SIGNAL(triggered()), this, SLOT(ShowFormfactorDlg())); QObject::connect(pHelp, SIGNAL(triggered()), this, SLOT(ShowHelp())); QObject::connect(pDevelDoc, SIGNAL(triggered()), this, SLOT(ShowDevelDoc())); QObject::connect(pAbout, SIGNAL(triggered()), this, SLOT(ShowAbout())); QObject::connect(pAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); setMenuBar(pMenuBar); // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // context menus if(m_pviewRecip) m_pviewRecip->setContextMenuPolicy(Qt::CustomContextMenu); if(m_pviewProjRecip) m_pviewProjRecip->setContextMenuPolicy(Qt::CustomContextMenu); if(m_pviewRealLattice) m_pviewRealLattice->setContextMenuPolicy(Qt::CustomContextMenu); if(m_pviewReal) m_pviewReal->setContextMenuPolicy(Qt::CustomContextMenu); if(m_pviewTof) m_pviewTof->setContextMenuPolicy(Qt::CustomContextMenu); if(m_pviewRecip) QObject::connect(m_pviewRecip, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(RecipContextMenu(const QPoint&))); if(m_pviewProjRecip) QObject::connect(m_pviewProjRecip, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(RecipContextMenu(const QPoint&))); if(m_pviewRealLattice) QObject::connect(m_pviewRealLattice, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(RealContextMenu(const QPoint&))); if(m_pviewReal) QObject::connect(m_pviewReal, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(RealContextMenu(const QPoint&))); if(m_pviewTof) QObject::connect(m_pviewTof, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(RealContextMenu(const QPoint&))); // -------------------------------------------------------------------------------- // tool bars QToolBar *pFileTools = new QToolBar(this); pFileTools->setWindowTitle("File"); pFileTools->addAction(pNew); pFileTools->addAction(pLoad); pFileTools->addAction(pImport); pFileTools->addAction(pSave); pFileTools->addAction(pSaveAs); addToolBar(pFileTools); QToolBar *pRecipTools = new QToolBar(this); pRecipTools->setWindowTitle("Reciprocal Space"); pRecipTools->addAction(m_pGoto); pRecipTools->addAction(m_pSmallq); pRecipTools->addAction(m_pBZ); //pRecipTools->addAction(m_pEwaldSphere); addToolBar(pRecipTools); QToolBar *pResoTools = new QToolBar(this); pResoTools->setWindowTitle("Resolution"); pResoTools->addAction(pResoParams); pResoTools->addAction(pResoEllipses); addToolBar(pResoTools); QToolBar *pCalcTools = new QToolBar(this); pCalcTools->setWindowTitle("Calculation"); pCalcTools->addAction(pNeutronProps); pCalcTools->addAction(pPowder); addToolBar(pCalcTools); #if !defined NO_NET QToolBar *pNetTools = new QToolBar(this); pNetTools->setWindowTitle("Network"); pNetTools->addAction(pConn); pNetTools->addAction(pDisconn); pNetTools->addAction(pNetRefresh); addToolBar(pNetTools); #endif // -------------------------------------------------------------------------------- RepopulateSpaceGroups(); unsigned int iMaxPeaks = m_settings.value("main/max_peaks", 10).toUInt(); m_sceneRecip.GetTriangle()->SetMaxPeaks(iMaxPeaks); m_sceneRecip.GetTriangle()->SetPlaneDistTolerance(s_dPlaneDistTolerance); m_sceneProjRecip.GetLattice()->SetMaxPeaks(iMaxPeaks/2); m_sceneRealLattice.GetLattice()->SetMaxPeaks(iMaxPeaks); m_sceneRealLattice.GetLattice()->SetPlaneDistTolerance(s_dPlaneDistTolerance); #if !defined NO_3D if(m_pRecip3d) { m_pRecip3d->SetMaxPeaks((t_real)iMaxPeaks); m_pRecip3d->SetPlaneDistTolerance(s_dPlaneDistTolerance); } #endif m_bReady = 1; UpdateDs(); CalcPeaks(); m_sceneRecip.GetTriangle()->SetqVisible(bSmallqVisible); m_sceneRecip.GetTriangle()->SetBZVisible(bBZVisible); m_sceneRecip.GetTriangle()->SetEwaldSphereVisible(EWALD_KF); m_sceneRealLattice.GetLattice()->SetWSVisible(bWSVisible); m_sceneRecip.emitUpdate(); //m_sceneRecip.emitAllParams(); setAcceptDrops(1); }
static LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { int idc; POINT pt; PCOPYDATASTRUCT pcds; switch (msg) { case WM_COMMAND: idc = LOWORD(wParam); switch (idc) { case IDM_OPEN: SelectAndLoadFile(); break; case IDM_STOP: StopPlayback(); break; case IDM_FILE_INFO: showInfoDialog(hInst, hWnd, current_filename, current_song); break; case IDM_SAVE_WAV: SaveWav(); break; case IDM_ABOUT: ShowAbout(); break; case IDM_EXIT: PostQuitMessage(0); break; default: if (idc >= IDM_SONG1 && idc < IDM_SONG1 + songs) LoadAndPlay(idc - IDM_SONG1); break; } break; case WM_DESTROY: PostQuitMessage(0); break; case MYWM_NOTIFYICON: if (opening) { SetForegroundWindow(GetLastActivePopup(hWnd)); break; } switch (lParam) { case WM_LBUTTONDOWN: SelectAndLoadFile(); break; case WM_MBUTTONDOWN: if (songs <= 1) break; /* FALLTHROUGH */ case WM_RBUTTONUP: GetCursorPos(&pt); SetForegroundWindow(hWnd); TrackPopupMenu(lParam == WM_MBUTTONDOWN ? hSongMenu : hTrayMenu, TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hWnd, NULL); PostMessage(hWnd, WM_NULL, 0, 0); break; default: break; } break; case WM_COPYDATA: pcds = (PCOPYDATASTRUCT) lParam; if (pcds->dwData == 'O' && pcds->cbData <= sizeof(current_filename)) { if (errorShown) { HWND hChild = GetLastActivePopup(hWnd); if (hChild != hWnd) SendMessage(hChild, WM_CLOSE, 0, 0); } memcpy(current_filename, pcds->lpData, pcds->cbData); LoadAndPlay(-1); } break; default: if (msg == taskbarCreatedMessage) Shell_NotifyIcon(NIM_ADD, &nid); return DefWindowProc(hWnd, msg, wParam, lParam); } return 0; }
//------------------------------------------------------------------------------- // // DoAbout // // Pop a simple about box for this plug in. // // NOTE: The global gFilterRecord is NOT a FilterRecord*. You must cast it to // an AboutRecord*. See PIAbout.h // //------------------------------------------------------------------------------- void DoAbout(void) { AboutRecord* aboutRecord = (AboutRecord*)gFilterRecord; ShowAbout(aboutRecord); }
void DoAbout (AboutRecordPtr about) { ShowAbout(about); }
void DevicesApplication::AboutRequested() { ShowAbout(); }
void DoAbout (AboutRecordPtr /*about*/) { ShowAbout (AboutID); } // end DoAbout
void MainView::HandleMessage(Message* pcMessage) { switch(pcMessage->GetCode()) { case M_MENU_QUIT: cout << "You pressed Quit Button" << endl; OkToQuit(); break; case MSG_SEND: { cout << "You pressed Send" << endl; SendMsg(); break; } case MSG_FROMLOOPER_NEW_MESSAGE: cout << "MSG_FROMLOOPER_NEW_MESSAGE received" << endl; cout << "Starting Update" << endl; Update(); cout << "Update Done" << endl; break; case M_MENU_ABO: cout << "You pressed About" << endl; ShowAbout(); break; case M_MENU_CONNECT: cout << "You pressed Connect" << endl; Connect(); break; case M_MENU_LOGIN: cout << "You pressed Login" << endl; Login(); break; case MSG_JOINCHANNEL: cout << "You pressed Join" << endl; Join(); break; case MSG_SINGLEUPDATE: cout << "You pressed Single Update" << endl; Update(); break; case MSG_UPDATE: cout << "You pressed Update" << endl; if( m_CommThread ) m_CommThread->PostMessage( MSG_TOLOOPER_START, m_CommThread, m_CommThread ); cout << "Message send to MSG_TOLOOPER_START" << endl; break; case M_MENU_DISCONNECT: cout << "You pressed Disconnect" << endl; Disconnect(); break; case MSG_SETTINGS: { cout << "You pressed Settings" << endl; break; } default: LayoutView::HandleMessage(pcMessage); break; } }
void PaintMainWindow::CreateMenuBar() { //Create File Menu //File Menu Begin QPopupMenu* file = new QPopupMenu(this); //Create Image Section file->insertItem("&New image", this, SLOT(OnNewImage()), CTRL+Key_N); file->insertItem("&Load image", this, SLOT(OnLoadImage()), CTRL+Key_O); file->insertItem("&Save image", this, SLOT(OnSaveImage()), CTRL+Key_S); file->insertSeparator(); //Create Color Section file->insertItem("&Foreground color", this, SLOT(ChangeFGColor())); file->insertItem("&Background color", this, SLOT(ChangeBGColor())); file->insertSeparator(); //Create Exit Section file->insertItem("&Exit", this, SLOT(OnExit()), CTRL+Key_X); //Insert File Menu menuBar()->insertItem("&File", file); //File Menu End //Create Edit Menu //Edit Menu Begin QPopupMenu* edit = new QPopupMenu(this); //Create Edit items edit->insertItem("&Undo", canvas, SLOT(undo()), CTRL+Key_Z); edit->insertItem("&Redo", canvas, SLOT(redo()), CTRL+Key_Y); edit->insertItem("&Clear All", canvas, SLOT(clearAll())); edit->insertItem("Re&size", this, SLOT(OnResizeImage()), CTRL+Key_R); //Insert Edit Menu menuBar()->insertItem("&Edit", edit); //Edit Menu End //Create View Menu //View Menu Begin QPopupMenu* view = new QPopupMenu(this); //Create ToolBar toggler QAction *ToolBar_t = new QAction("&Tool Bar", 0, this); QObject::connect(ToolBar_t, SIGNAL(activated()), this, SLOT(ToggleToolBar())); //Set ToolBar toggler to be checkable ToolBar_t->setToggleAction(true); ToolBar_t->setOn(true); ToolBar_t->addTo(view); //Connect ToolBar state to ToolBar toggler QObject::connect(tools, SIGNAL(visibilityChanged(bool)), ToolBar_t, SLOT(toggle())); //Insert View Menu menuBar()->insertItem("&View", view); //View Menu End //Create Help Menu //Help Menu Begin QPopupMenu* help = new QPopupMenu(this); //Create Help items help->insertItem("&About", this, SLOT(ShowAbout())); //Insert Help Menu menuBar()->insertItem("&Help", help); //Help Menu End }
long CMainWindow::OnCommand(unsigned short nID, unsigned short nCmd, HWND hSender) { switch(nID) { case ID_MAIN_FILE_LOADELF: OpenELF(); break; case ID_MAIN_FILE_BOOTCDROM: BootCDROM(); break; case ID_MAIN_FILE_BOOTDISKIMAGE: BootDiskImage(); break; case ID_MAIN_FILE_RECORDAVI: RecordAvi(); break; case ID_MAIN_FILE_EXIT: DestroyWindow(m_hWnd); break; case ID_MAIN_VM_RESUME: ResumePause(); break; case ID_MAIN_VM_RESET: Reset(); break; case ID_MAIN_VM_PAUSEFOCUS: PauseWhenFocusLost(); break; case ID_MAIN_VM_SAVESTATE: SaveState(); break; case ID_MAIN_VM_LOADSTATE: LoadState(); break; case ID_MAIN_VM_STATESLOT_0 + 0: case ID_MAIN_VM_STATESLOT_0 + 1: case ID_MAIN_VM_STATESLOT_0 + 2: case ID_MAIN_VM_STATESLOT_0 + 3: case ID_MAIN_VM_STATESLOT_0 + 4: case ID_MAIN_VM_STATESLOT_0 + 5: case ID_MAIN_VM_STATESLOT_0 + 6: case ID_MAIN_VM_STATESLOT_0 + 7: case ID_MAIN_VM_STATESLOT_0 + 8: case ID_MAIN_VM_STATESLOT_0 + 9: ChangeStateSlot(nID - ID_MAIN_VM_STATESLOT_0); break; case ID_MAIN_VIEW_FITTOSCREEN: ChangeViewMode(CGSHandler::PRESENTATION_MODE_FIT); break; case ID_MAIN_VIEW_FILLSCREEN: ChangeViewMode(CGSHandler::PRESENTATION_MODE_FILL); break; case ID_MAIN_VIEW_ACTUALSIZE: ChangeViewMode(CGSHandler::PRESENTATION_MODE_ORIGINAL); break; case ID_MAIN_OPTIONS_RENDERER: ShowRendererSettings(); break; case ID_MAIN_OPTIONS_CONTROLLER: ShowControllerSettings(); break; case ID_MAIN_OPTIONS_VFSMANAGER: ShowVfsManager(); break; case ID_MAIN_OPTIONS_MCMANAGER: ShowMcManager(); break; case ID_MAIN_DEBUG_SHOWDEBUG: ShowDebugger(); break; case ID_MAIN_DEBUG_SHOWFRAMEDEBUG: ShowFrameDebugger(); break; case ID_MAIN_DEBUG_DUMPFRAME: DumpNextFrame(); break; case ID_MAIN_DEBUG_ENABLEGSDRAW: ToggleGsDraw(); break; case ID_MAIN_HELP_SYSINFO: ShowSysInfo(); break; case ID_MAIN_HELP_ABOUT: ShowAbout(); break; } return TRUE; }
// Handle WM_COMMAND messages separately void AudioP3Dlg::WMCommand(int id, int notify, HWND hCtrl) { int mmerr; AudioP3Control* af = (AudioP3Control *)GetWindowLongPtr(hWnd, DWLP_USER); switch (id) { case IDC_AUDAMP_ABSOLUTE: cont->absolute = IsDlgButtonChecked(hWnd,id); Change(); break; case IDC_QUICKDRAW: cont->quickdraw = IsDlgButtonChecked(hWnd,id); Change(); break; case IDC_AUDAMP_RECDEVICE: if (notify == CBN_SELCHANGE) { int devIdx = SendMessage(GetDlgItem(hWnd, IDC_AUDAMP_RECDEVICE), CB_GETCURSEL, 0, 0); cont->rtwave->SetDevice(devIdx); Change(); } break; case IDC_AUDAMP_RECENABLE: cont->enableRuntime = IsDlgButtonChecked(hWnd,id); // Startup or terminate runtime recording if (cont->enableRuntime) { if ((mmerr = cont->rtwave->StartRecording()) == 0) { EnableWindow(GetDlgItem(hWnd, IDC_AUDAMP_RECDEVICE), 0); } else { CheckDlgButton(hWnd, id, 0); MessageBox(hWnd, GetString(IDS_CJ_DEVICE_BUSY), GetString(IDS_CJ_PROGNAME), MB_OK); } } else { cont->rtwave->StopRecording(); EnableWindow(GetDlgItem(hWnd, IDC_AUDAMP_RECDEVICE), 1); } // Here we are just telling trackview to repaint its hierarchy. // We haven't actually changed anything, but the switch from file to record // will cause a change in TrackView line height - and we need to tell that // to TrackView cont->NotifyDependents(FOREVER,PART_ALL,REFMSG_SUBANIM_STRUCTURE_CHANGED); Change(); break; case IDC_BTN_BROWSE: { // Changed to open in the directory of the file. //CJ TSTR dir = cont->szFilename; if (dir.Length() == 0) { // Use sound dir if no file. dir = TSTR(ip->GetDir(APP_SOUND_DIR)); } else { int lc = dir.last((int)'\\'); if (lc == -1) { lc = dir.last((int)'/'); } if (lc != -1) { dir[lc] = '\0'; } } // Brings up file dialog box with sound "preview". GetSoundFileName(hCtrl, cont->szFilename, dir); if (!cont->szFilename.isNull()) { cont->wave->InitOpen(cont->szFilename); SendMessage(GetDlgItem(hWnd, IDC_AUDAMP_FILENAME), WM_SETTEXT, 0, (LPARAM)((char *)cont->szFilename)); EnableChannelUI(cont->wave->GetNumChannels() == 2); } Change(); } break; case IDC_BTN_REMOVESOUND: cont->wave->FreeSample(); cont->szFilename = ""; SendMessage(GetDlgItem(hWnd, IDC_AUDAMP_FILENAME), WM_SETTEXT, 0, (LPARAM)""); EnableChannelUI(FALSE); Change(); break; case IDC_AUDAMP_LEFT: cont->channel = 0; Change(); break; case IDC_AUDAMP_RIGHT: cont->channel = 1; Change(); break; case IDC_AUDAMP_MIX: cont->channel = 2; Change(); break; case IDC_ABOUT: ShowAbout(hWnd); break; case IDC_CLOSE: DestroyWindow(hWnd); break; } }
extern "C" int create_qt_ui(RC_CONF *my_rc, int argc, char **argv) { int i; char *homedir; char temp[FILENAME_MAX]; int fd; FILE *fp; QListViewItem *element; QCheckListItem *foo; MyDialogs my_dialogs; TableCallbacks my_tablecallbacks; thefish = new QApplication( argc, argv); // It's more convenient to have these // as global. my_rc_knobs = my_rc->knobs_ptr; my_rc_strings = my_rc->string_ptr; my_num_knobs = my_rc->knobs_size; my_num_strings = my_rc->string_size; mw = new QMainWindow; QVBox *vbox = new QVBox(mw, 0, 0); QTabWidget main_tab(vbox, 0, 0); knobs_table = new QListView; strings_table = new QListView; strings_table->setAllColumnsShowFocus(TRUE); knobs_table->addColumn("Variable Name", -1); strings_table->addColumn("Name", -1); strings_table->addColumn("Value",-1); QObject::connect(strings_table, SIGNAL(itemRenamed(QListViewItem*, int, const QString &)), &my_tablecallbacks, SLOT(StringChanged(QListViewItem*, int, const QString &))); QObject::connect(knobs_table, SIGNAL(clicked(QListViewItem *)), &my_tablecallbacks, SLOT(KnobChanged(QListViewItem*))); QObject::connect(strings_table, SIGNAL(clicked(QListViewItem *)), &my_tablecallbacks, SLOT(StringClicked(QListViewItem*))); main_tab.addTab(knobs_table, "Knobs"); main_tab.addTab(strings_table, "Strings"); QHBox *hbuttons = new QHBox(vbox, 0, 0); SaveButton = new QPushButton("&Save", hbuttons, 0); QPushButton AddButton("&Add", hbuttons, 0); QPushButton AboutButton("A&bout", hbuttons, 0); QPushButton QuitButton("&Quit", hbuttons, 0); // No save for now... SaveButton->setEnabled(false); QObject::connect(&QuitButton, SIGNAL(clicked()), &my_dialogs, SLOT(CheckSaved())); QObject::connect(&AboutButton, SIGNAL(clicked()), &my_dialogs, SLOT(ShowAbout())); QObject::connect(&AddButton, SIGNAL(clicked()), &my_dialogs, SLOT(DoAdd())); QObject::connect(SaveButton, SIGNAL(clicked()), &my_dialogs, SLOT(DoSave())); // We're now using human readable data, handle the migration // transparently for the user. homedir = getenv("HOME"); if (homedir != NULL) { snprintf(temp, FILENAME_MAX, "%s/%s", homedir, ".thefishrc"); fd = open(temp, O_RDONLY, 0); if (fd != -1 ) { i = lseek(fd, 0, SEEK_END); lseek(fd, 0, SEEK_SET); if (i == sizeof(oldsize)) { read(fd, &oldsize[0], sizeof(oldsize)); close(fd); } else { fp = fdopen(fd, "r"); fscanf(fp, "geometry=%i,%i", &oldsize[0], &oldsize[1]); fclose(fp); } } else { // Set some default values oldsize[0] = 400; oldsize[1] = 480; } } // Build the table knobs_table->setColumnWidthMode (1, QListView::Maximum); knobs_table->setRootIsDecorated(false); for (i = my_rc->knobs_size - 1; i >= 0; i--) { // No user comments yet (my_rc->knobs_ptr+i)->user_comment = 0; foo = new QCheckListItem( knobs_table, (my_rc->knobs_ptr+i)->name, QCheckListItem::CheckBox); if ((my_rc->knobs_ptr+i)->knob_val == KNOB_IS_NO) { foo->setOn(FALSE); } else { foo->setOn(TRUE); } } for (i = my_rc->string_size - 1; i >= 0; i--) { // No user comments yet (my_rc->string_ptr+i)->user_comment = 0; element = new QListViewItem(strings_table, (my_rc->string_ptr+i)->name, (my_rc->string_ptr+i)->value); element->setRenameEnabled(0, FALSE); element->setRenameEnabled(1, TRUE); } // Set the app icon QPixmap my_icon((const char **) fish64_xpm); mw->setIcon((const QPixmap ) my_icon); mw->setCaption("The Fish " THE_FISH_VERSION); mw->setCentralWidget( vbox ); thefish->setMainWidget(mw); mw->show(); mw->resize(oldsize[0], oldsize[1]); dirty = 0; my_status_bar = mw->statusBar(); my_status_bar->message("Ready"); return thefish->exec(); }
void __fastcall TMain::tbtnAboutClick(TObject * Sender) { ShowAbout(18, MAXBYTE, 3, NULL, NULL, NULL, NULL, NULL, "© П3тр0виЧъ (К.П. Дураев, Уральская Сталь, ЦВТС, 2004-2016)|@[email protected]"); }
void gtkShow(int type, char *param) { switch (type) { case evEqualizer: ShowEqualizer(); gtkSetLayer(Equalizer); break; case evSkinBrowser: ShowSkinBrowser(); // gtk_clist_clear(GTK_CLIST(SkinList)); if (FillSkinList(sbSkinDirInHome) && FillSkinList(sbSkinDirInData)) { gtkSelectInCList(SkinList, param); gtk_clist_sort(GTK_CLIST(SkinList)); gtk_widget_show(SkinBrowser); gtkSetLayer(SkinBrowser); } else { gtk_widget_destroy(SkinBrowser); gtkMessageBox(MSGBOX_ERROR, "Skin dirs not found ... Please install skins."); } break; case evPreferences: ShowPreferences(); break; case evPlaylist: ShowPlaylist(); gtkSetLayer(Playlist); break; case evLoad: ShowFileSelector(FILESELECT_VIDEO_AUDIO); gtkSetLayer(FileSelector); break; case evLoadSubtitle: ShowFileSelector(FILESELECT_SUBTITLE); gtkSetLayer(FileSelector); break; case evLoadAudioFile: ShowFileSelector(FILESELECT_AUDIO); gtkSetLayer(FileSelector); break; case evPlayImage: ShowFileSelector(FILESELECT_IMAGE); gtkSetLayer(FileSelector); break; case evAbout: ShowAbout(); gtkSetLayer(About); break; case ivShowPopUpMenu: gtkPopupMenu = evNone; gtkPopupMenuParam = 0; if (PopUpMenu) { gtk_widget_hide(PopUpMenu); gtk_widget_destroy(PopUpMenu); } PopUpMenu = CreatePopUpMenu(); gtk_menu_popup(GTK_MENU(PopUpMenu), NULL, NULL, NULL, NULL, 0, 0); break; case ivHidePopUpMenu: if (PopUpMenu) { gtk_widget_hide(PopUpMenu); gtk_widget_destroy(PopUpMenu); PopUpMenu = NULL; } break; case evLoadURL: ShowURLDialog(); gtkSetLayer(URLDialog); break; } }
void DoAbout (AboutRecordPtr about) { ShowAbout(about, hDllInstance, AboutID); }
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static UINT s_uTaskBarCreated = 0; switch(uMsg) { case WM_CREATE: { g_hwndMain = hwnd; // Register task bar (re)creation in order to reload systray icons after explorer crashes s_uTaskBarCreated = RegisterWindowMessage(REGISTER_MESSAGE); // Set Icons SendMessage(hwnd, WM_SETICON, ICON_BIG, (LONG)(LONG_PTR)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAIN_ICON), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR)); SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LONG)(LONG_PTR)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAIN_ICON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR)); ShowWindow(hwnd, SW_HIDE); // Clear the list g_IconTray.clear(); installHookKeyboard(); // Open the configuration if (openConfig() == FALSE) { uninstallHookKeyboard(); clearMenuSkin(); MessageBox(g_hwndMain, L"Configuration file not found or invalid", ERR_MSGBOX_TITLE, NULL); PostQuitMessage(0); return 0; } // Retreive the version of Windows (in order to know if it is a win200 or superior) windowsVersion = GetWindowsVersion(); // Initialisation of variables for menus InitMenuVars(); // Add the system tray icons (depends of the configuration) ShowTrayIcons(); // Show loading error messages if (g_loadingmessage != NULL) { ShowBalloon(ERR_MSGBOX_TITLE, g_loadingmessage, 0, NIIF_ERROR); free(g_loadingmessage); g_loadingmessage = NULL; } // Launch application in "autorun" mode fireEvent(PROG_EVENT_START); FlushMemory(); } break; case WM_HOTKEY: if( (wParam >= IDH_HOTKEY_MENU) && (wParam <= (IDH_HOTKEY_MENU + g_portal->hotkeys.size()) ) ) { // Detect application item or menu item in order to open a menu or launch the application PortalProg* l_sp = g_portal->hotkeys[ wParam - IDH_HOTKEY_MENU ]; while( l_sp ) { if( l_sp->progs.size() > 0 ) { ShowTrayMenu(l_sp, PORTAL_MENU_HOTKEY); } else { l_sp->run(false); // Some commands could call quitPortal. In this case g_portal is set to NULL. if(g_portal == NULL) return 0; } l_sp = l_sp->nextSameHotkey; } } FlushMemory(); break; case WM_DESTROY: { quitPortal(); } break; case WM_MYTRAYMSG: if ((wParam >= IDI_MAIN_ICON) && g_portal && (wParam <= (IDI_MAIN_ICON + g_portal->menus.size()))) { // Find the clicked systray int pos = (int)wParam - IDI_MAIN_ICON; if( ((UINT)lParam == WM_RBUTTONUP) || ((UINT)lParam == WM_LBUTTONUP) || ((UINT)lParam == WM_MOUSEMOVE) ) { // Left click : minimalist menu // Right click : Complete menu (with About/Reload/Quit) // Auto Open : Complete menu (like right click) with a automatic dismiss int param = PORTAL_MENU_SYSTRAY; if((UINT)lParam == WM_RBUTTONUP) { param = PORTAL_MENU_SYSTRAY_CMD; } if( ((UINT)lParam == WM_MOUSEMOVE) ) { if( (g_portal->menus[pos] != NULL) && (g_portal->menus[pos]->options & PROG_OPTION_AUTOOPEN) ) { param = PORTAL_MENU_SYSTRAY_AUTO; } else { return 0; } } // Detect if the icon is for a menu or a application if( (g_portal->menus[pos] != NULL) && ( g_portal->menus[pos]->progs.size() > 0 ) ) { ShowTrayMenu(g_portal->menus[pos], param); g_currentMenu = pos; } else if( (g_portal->menus[pos] != NULL) && (g_portal->menus[pos]->progExe != NULL )) { if((UINT)lParam == WM_LBUTTONUP) { g_portal->menus[pos]->run(true); g_currentMenu = pos; } else { ShowTrayMenu(g_portal->menus[pos], param); g_currentMenu = pos; } } else { ShowTrayMenu(NULL, param); g_currentMenu = 0; } FlushMemory(); } else if( (UINT)lParam == NIN_BALLOONUSERCLICK ) { if(g_aboutbaloon) checkGuiproVersion(); FlushMemory(); return 0; } } break; case WM_INITMENUPOPUP : OnInitMenuPopup(hwnd, wParam, lParam); break; case WM_UNINITMENUPOPUP: OnUninitMenuPopup(hwnd, wParam, lParam); break; case WM_MEASUREITEM : OnMeasureItem(hwnd, wParam, lParam); break; case WM_DRAWITEM : OnDrawItem(hwnd, wParam, lParam); break; case WM_MENUCHAR: return OnMenuCharItem(hwnd, wParam, lParam); case WM_COMMAND: // Retreive a menu command if( wParam == IDM_EXIT ) { quitPortal(); } else if( wParam == IDM_RELOAD ) { reloadPortalConfig(); } else if( wParam == IDM_ABOUT ) { ShowAbout(g_currentMenu); FlushMemory(); } else if( ((UINT)wParam >= (PORTAL_HK_ID)) && ( (UINT)wParam <= (UINT)(PORTAL_HK_ID + menuGetNbElem()) ) ) { PortalProg* l_sp = menuGetElem( (int)(wParam - 1 - PORTAL_HK_ID) ); l_sp->run(true); FlushMemory(); } else if( ((UINT)wParam >= (PORTAL_FILE_ID)) && ( (UINT)wParam < (UINT)(PORTAL_FILE_ID + menuGetNbFiles()) ) ) { PortalProg* l_sp = menuGetFile( (int)(wParam - PORTAL_FILE_ID) ); l_sp->run(true); FlushMemory(); for(PortalProgVector::iterator i = g_portal_files.begin(); i != g_portal_files.end(); i++) { delete (*i); } g_portal_files.clear(); } break; default: if( uMsg == s_uTaskBarCreated ) { // Traskbar (re)creation, we have to reset systray icons ReloadTrayIcons(); FlushMemory(); } else { return(DefWindowProc(hwnd, uMsg, wParam, lParam)); } break; } return 0; }