X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fctsim.cpp;h=2d85a4739f9fae7144f06380c059a24a3323d0a3;hb=e89023477e02d9332f87cab5a7975407625dbd60;hp=9befa24c35cbc67c036c3e0d36df8b51d6adf6a5;hpb=52e0918dbbadcf53d4f4a9d1ec1748f854a4e4bf;p=ctsim.git diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 9befa24..2d85a47 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -93,18 +93,18 @@ CTSimApp::CTSimApp() void CTSimApp::OnInitCmdLine(wxCmdLineParser& parser) { static const wxCmdLineEntryDesc cmdLineDesc[] = { - { wxCMD_LINE_SWITCH, _T("l"), _T("verbose"), _T("verbose logging") }, - { wxCMD_LINE_SWITCH, _T("v"), _T("version"), _T("print version") }, - { wxCMD_LINE_SWITCH, _T("p"), _T("print"), _T("print images from command line"), + { wxCMD_LINE_SWITCH, wxT_2("l"), wxT_2("verbose"), wxT_2("verbose logging") }, + { wxCMD_LINE_SWITCH, wxT_2("v"), wxT_2("version"), wxT_2("print version") }, + { wxCMD_LINE_SWITCH, wxT_2("p"), wxT_2("print"), wxT_2("print images from command line"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("print this help message"), + { wxCMD_LINE_SWITCH, wxT_2("h"), wxT_2("help"), wxT_2("print this help message"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_OPTION_HELP }, - { wxCMD_LINE_PARAM, NULL, NULL, _T("input file"), + { wxCMD_LINE_PARAM, NULL, NULL, wxT_2("input file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE }, - { wxCMD_LINE_NONE } + wxCMD_LINE_DESC_END }; parser.SetDesc(cmdLineDesc); @@ -247,10 +247,11 @@ CTSimApp::OnInit() m_docManager->OnFileClose (nullEvent); } } + if (m_bPrintCmdLineImages) { wxCommandEvent closeEvent; closeEvent.SetInt (MAINMENU_FILE_EXIT); - m_pFrame->AddPendingEvent(closeEvent); + m_pFrame->GetEventHandler()->ProcessEvent(closeEvent); } if (getStartupTips()) @@ -388,7 +389,9 @@ EVT_MENU(MAINMENU_HELP_SECONDARY, MainFrame::OnHelpSecondary) EVT_MENU(MAINMENU_FILE_CREATE_PHANTOM, MainFrame::OnCreatePhantom) EVT_MENU(MAINMENU_FILE_CREATE_FILTER, MainFrame::OnCreateFilter) EVT_MENU(MAINMENU_FILE_EXIT, MainFrame::OnExit) + EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, MainFrame::OnMRUFile) + EVT_MENU(MAINMENU_WINDOW_BASE, MainFrame::OnWindowMenu0) EVT_MENU(MAINMENU_WINDOW_BASE+1, MainFrame::OnWindowMenu1) EVT_MENU(MAINMENU_WINDOW_BASE+2, MainFrame::OnWindowMenu2) @@ -727,7 +730,7 @@ MainFrame::OnUpdateUI (wxUpdateUIEvent& rEvent) strFilename += _T("\tCtrl-"); strFilename += static_cast('0' + iPos); } - static_cast(m_apWindowMenuItems[iPos])->SetName (strFilename); + static_cast(m_apWindowMenuItems[iPos])->SetItemLabel (strFilename); m_apWindowMenuData[iPos] = pDoc; m_pWindowMenu->Enable (MAINMENU_WINDOW_BASE+iPos, true); iPos++; @@ -735,7 +738,7 @@ MainFrame::OnUpdateUI (wxUpdateUIEvent& rEvent) } for (int i = iPos; i < MAX_WINDOW_MENUITEMS; i++) { m_pWindowMenu->Enable (MAINMENU_WINDOW_BASE+i, false); - static_cast(m_apWindowMenuItems[i])->SetName (_T("[EMPTY]")); + static_cast(m_apWindowMenuItems[i])->SetItemLabel (_T("[EMPTY]")); m_apWindowMenuData[i] = NULL; } #endif @@ -891,7 +894,7 @@ public: }; BitmapDialog::BitmapDialog (wxBitmap* pBitmap, char const* pszTitle) - : wxDialog(theApp->getMainFrame(), -1, wxString(pszTitle,*wxConvCurrent), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE) + : wxDialog(theApp->getMainFrame(), -1, wxString(pszTitle,*wxConvCurrent)) { wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL); @@ -961,7 +964,7 @@ MainFrame::OnImport (wxCommandEvent& WXUNUSED(event) ) } wxString strFilename = wxFileSelector (wxString(wxConvUTF8.cMB2WX("Import Filename")), wxString(wxConvUTF8.cMB2WX("")), - wxString(wxConvUTF8.cMB2WX("")), strExt, strWildcard, wxOPEN); + wxString(wxConvUTF8.cMB2WX("")), strExt, strWildcard, wxFD_OPEN); if (! strFilename.IsEmpty()) { if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PPM || m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PNG) {