这篇教程C++ wxMessageBox函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxMessageBox函数的典型用法代码示例。如果您正苦于以下问题:C++ wxMessageBox函数的具体用法?C++ wxMessageBox怎么用?C++ wxMessageBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxMessageBox函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ExportMultipleDatasetsSelect//.........这里部分代码省略......... { wxGxObjectContainer* pGxCont = wxDynamicCast(pGxParentObj, wxGxObjectContainer); if (NULL != pGxCont && pGxCont->CanCreate(enumGISFeatureDataset, eDefaulSubType)) { break; } else { pGxParentObj = pGxParentObj->GetParent(); } } if (pGxParentObj) { sStartLoc = pGxParentObj->GetFullName(); } } wxGISAppConfig oConfig = GetConfig(); if (oConfig.IsOk()) { if (eType == enumGISFeatureDataset) { sStartLoc = oConfig.Read(enumGISHKCU, dlg.GetAppName() + wxT("/lastpath/expm_vector_ds/path"), sStartLoc); } else if (eType == enumGISRasterDataset) { sStartLoc = oConfig.Read(enumGISHKCU, dlg.GetAppName() + wxT("/lastpath/expm_raster_ds/path"), sStartLoc); } else if (eType == enumGISTableDataset) { sStartLoc = oConfig.Read(enumGISHKCU, dlg.GetAppName() + wxT("/lastpath/expm_table_ds/path"), sStartLoc); } } if (!sStartLoc.IsEmpty()) dlg.SetStartingLocation(sStartLoc); if (dlg.ShowModal() == wxID_OK) { wxGxObjectFilter* pFilter = dlg.GetCurrentFilter(); if (NULL == pFilter) { wxMessageBox(_("Unexpected error"), _("Error"), wxCENTRE | wxOK | wxICON_ERROR, pWnd); wxLogError(_("Null wxGxObjectFilter returned")); return; } CPLString sPath = dlg.GetPath(); wxString sCatalogPath = dlg.GetLocation()->GetFullName(); if (oConfig.IsOk()) { if (eType == enumGISFeatureDataset) { oConfig.Write(enumGISHKCU, dlg.GetAppName() + wxT("/lastpath/expm_vector_ds/path"), sCatalogPath); } else if (eType == enumGISRasterDataset) { oConfig.Write(enumGISHKCU, dlg.GetAppName() + wxT("/lastpath/expm_raster_ds/path"), sCatalogPath); } else if (eType == enumGISTableDataset) { oConfig.Write(enumGISHKCU, dlg.GetAppName() + wxT("/lastpath/expm_table_ds/path"), sCatalogPath); } } //TODO: Now we create the copies (new names) instead of overwrite, but should show table with exist names and new names. If user set the same name - overwrite // |----------------|------------------| // | dataset1 | dataset1 (1) | // | dataset2 | dataset2 (1) | // | dataset3 | dataset3 (2) | // |----------------|------------------| wxVector<EXPORTED_DATASET> paExportDatasets; for (size_t i = 0; i < paDatasets.size(); ++i) { wxGxObject* pGxSrcDatasetObj = dynamic_cast<wxGxObject*>(paDatasets[i]); if (NULL == pGxSrcDatasetObj) { continue; } wxString sNewName = CheckUniqName(sPath, pGxSrcDatasetObj->GetBaseName(), pFilter->GetExt()); EXPORTED_DATASET ds = { sNewName, paDatasets[i] }; paExportDatasets.push_back(ds); } if (eType == enumGISFeatureDataset) { ExportMultipleVectorDatasets(pWnd, sPath, pFilter, paExportDatasets); } else if (eType == enumGISRasterDataset) { ExportMultipleRasterDatasets(pWnd, sPath, pFilter, paExportDatasets); } else if (eType == enumGISTableDataset) { ExportMultipleTableDatasets(pWnd, sPath, pFilter, paExportDatasets); } }}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:101,
示例2: ExportMultipleVectorDatasetsvoid ExportMultipleVectorDatasets(wxWindow* pWnd, const CPLString &sPath, wxGxObjectFilter* const pFilter, wxVector<EXPORTED_DATASET> &paDatasets){ wxCHECK_RET(pWnd && pFilter && paDatasets.size() > 1, wxT("The input pointer is NULL or datasets array is empty")); wxGISProgressDlg ProgressDlg(_("Exporting..."), _("Begin operation..."), 100, pWnd); ProgressDlg.SetAddPercentToMessage(false); ProgressDlg.ShowProgress(true); for (size_t i = 0; i < paDatasets.size(); ++i) { ProgressDlg.SetTitle(wxString::Format(_("Proceed %ld of %ld..."), i + 1, paDatasets.size())); wxGISDataset* pDataset = paDatasets[i].pDSet->GetDataset(false, &ProgressDlg); wxVector<wxGISFeatureDataset*> apFeatureDatasets; if (pDataset->GetSubsetsCount() == 0) { wxGISFeatureDataset* pFeatureDataset = wxDynamicCast(pDataset, wxGISFeatureDataset); if (NULL != pFeatureDataset) { pFeatureDataset->Reference(); apFeatureDatasets.push_back(pFeatureDataset); } } else { for (size_t j = 0; j < pDataset->GetSubsetsCount(); ++j) { wxGISFeatureDataset* pFeatureDataset = wxDynamicCast(pDataset->GetSubset(j), wxGISFeatureDataset); if (NULL != pFeatureDataset) { pFeatureDataset->Reference(); apFeatureDatasets.push_back(pFeatureDataset); } } } if (apFeatureDatasets.size() == 0) { wxMessageBox(_("The dataset is empty"), _("Error"), wxCENTRE | wxICON_ERROR | wxOK, pWnd); wxLogError(_("wxGISFeatureDataset pointer is null returned")); return; } for (size_t j = 0; j < apFeatureDatasets.size(); ++j) { if(!ProgressDlg.Continue()) break; if (!apFeatureDatasets[j]->IsOpened()) { if (!apFeatureDatasets[j]->Open(0, TRUE, false, &ProgressDlg)) { wxMessageBox(ProgressDlg.GetLastMessage(), _("Error"), wxCENTRE | wxICON_ERROR | wxOK, pWnd); wxLogError(ProgressDlg.GetLastMessage()); wsDELETE(apFeatureDatasets[j]); continue; } } if (!ExportFormat(apFeatureDatasets[j], sPath, paDatasets[i].sName, pFilter, wxGISNullSpatialFilter, NULL, NULL, true, static_cast<ITrackCancel*>(&ProgressDlg))) { wxMessageBox(ProgressDlg.GetLastMessage(), _("Error"), wxCENTRE | wxICON_ERROR | wxOK, pWnd); wxLogError(ProgressDlg.GetLastMessage()); wsDELETE(apFeatureDatasets[j]); continue; } wsDELETE(apFeatureDatasets[j]); } } if (ProgressDlg.GetWarningCount() > 0 && ProgressDlg.Continue()) { ShowMessageDialog(pWnd, ProgressDlg.GetWarnings()); }}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:73,
示例3: GetScreen/* init board, route traces*/void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode ){ int start, stop; MODULE* Module = NULL; D_PAD* Pad = NULL; int autoroute_net_code = -1; wxString msg; if( GetBoard()->GetCopperLayerCount() > 1 ) { Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP; Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM; } else { Route_Layer_TOP = Route_Layer_BOTTOM = LAYER_N_BACK; } switch( mode ) { case ROUTE_NET: if( GetScreen()->GetCurItem() ) { switch( GetScreen()->GetCurItem()->Type() ) { case PCB_PAD_T: Pad = (D_PAD*) GetScreen()->GetCurItem(); autoroute_net_code = Pad->GetNet(); break; default: break; } } if( autoroute_net_code <= 0 ) { wxMessageBox( _( "Net not selected" ) ); return; } break; case ROUTE_MODULE: Module = (MODULE*) GetScreen()->GetCurItem(); if( (Module == NULL) || (Module->Type() != PCB_MODULE_T) ) { wxMessageBox( _( "Module not selected" ) ); return; } break; case ROUTE_PAD: Pad = (D_PAD*) GetScreen()->GetCurItem(); if( (Pad == NULL) || (Pad->Type() != PCB_PAD_T) ) { wxMessageBox( _( "Pad not selected" ) ); return; } break; } if( (GetBoard()->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK ) == 0 ) Compile_Ratsnest( DC, true ); /* Set the flag on the ratsnest to CH_ROUTE_REQ. */ for( unsigned ii = 0; ii < GetBoard()->GetRatsnestsCount(); ii++ ) { RATSNEST_ITEM* ptmp = &GetBoard()->m_FullRatsnest[ii]; ptmp->m_Status &= ~CH_ROUTE_REQ; switch( mode ) { case ROUTE_ALL: ptmp->m_Status |= CH_ROUTE_REQ; break; case ROUTE_NET: if( autoroute_net_code == ptmp->GetNet() ) ptmp->m_Status |= CH_ROUTE_REQ; break; case ROUTE_MODULE: { D_PAD* pt_pad = (D_PAD*) Module->m_Pads; for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) { if( ptmp->m_PadStart == pt_pad ) ptmp->m_Status |= CH_ROUTE_REQ; if( ptmp->m_PadEnd == pt_pad ) ptmp->m_Status |= CH_ROUTE_REQ; } break; } case ROUTE_PAD: if( ( ptmp->m_PadStart == Pad ) || ( ptmp->m_PadEnd == Pad ) )//.........这里部分代码省略.........
开发者ID:peabody124,项目名称:kicad,代码行数:101,
示例4: wxFileSelector//------------------------------------------------------------------------------void OutputTree::OnCompareNumericColumns(wxCommandEvent &event){ #ifdef DEBUG_COMPARE MessageInterface::ShowMessage("OutputTree::OnCompareNumericColumns() entered/n"); #endif ReportFile *theReport = (ReportFile*) theGuiInterpreter->GetConfiguredObject(theSubscriberName.c_str()); if (!theReport) { MessageInterface::ShowMessage ("OutputTree::OnCompareNumericColumns() The ReportFile: %s is NULL./n", theSubscriberName.WX_TO_C_STRING); return; } std::string basefilename = theReport->GetFullPathFileName(); StringArray colTitles = theReport->GetRefObjectNameArray(Gmat::PARAMETER); wxString filename1 = wxFileSelector("Choose a file to open", "", "", "report|eph|txt", "Report files (*.report)|*.report|" "Text files (*.txt)|*.txt|" "Text ephemeris files (*.eph)|*.eph|" "All files (*.*)|*.*"); if (filename1.empty()) return; Real tol = GmatFileUtil::COMPARE_TOLERANCE; wxString tolStr; tolStr.Printf("%e", tol); tolStr = wxGetTextFromUser("Enter absolute tolerance to be used in flagging: ", "Tolerance", tolStr, this); if (!tolStr.ToDouble(&tol)) { wxMessageBox("Entered Invalid Tolerance", "Error", wxOK, this); return; } StringArray output = GmatFileUtil::CompareNumericColumns(1, basefilename.c_str(), filename1.c_str(), "", "", tol); ViewTextFrame *compWindow = GmatAppData::Instance()->GetCompareWindow(); if (compWindow == NULL) { compWindow = new ViewTextFrame(GmatAppData::Instance()->GetMainFrame(), _T("Compare Utility"), 50, 50, 800, 500, "Permanent"); GmatAppData::Instance()->SetCompareWindow(compWindow); wxString msg; msg.Printf(_T("GMAT Build Date: %s %s/n/n"), __DATE__, __TIME__); compWindow->AppendText(msg); } compWindow->Show(true); for (unsigned int i=0; i<output.size(); i++) { compWindow->AppendText(wxString(output[i].c_str())); MessageInterface::ShowMessage(output[i].c_str()); }}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:66,
示例5: definedvoid NyqBench::OnFindDialog(wxFindDialogEvent & e){ wxEventType type = e.GetEventType(); if (type == wxEVT_COMMAND_FIND_CLOSE) { wxFindReplaceDialog *dlg = e.GetDialog(); dlg->Destroy(); int flags = mFindData.GetFlags(); gPrefs->Write(wxT("NyqBench/Find/Down"), (flags & wxFR_DOWN) != 0); gPrefs->Write(wxT("NyqBench/Find/Word"), (flags & wxFR_WHOLEWORD) != 0); gPrefs->Write(wxT("NyqBench/Find/Case"), (flags & wxFR_MATCHCASE) != 0); mFindDlg = NULL; mFindText = NULL; return; } wxString text = mFindText->GetValue();#if defined(__WXMSW__) // We cheat on Windows. We know that the Windows text control // uses CRLF for line endings and if we don't account for that, // the selection positions will be off. // // Not sure why I thought I needed this, but it appears not to // be. Leaving just in case. // // text.Replace(wxT("/n"), wxT("/r/n"));#endif size_t startpos = mFindText->GetInsertionPoint(); size_t len = mFindText->GetLastPosition(); size_t pos; wxString find = e.GetFindString(); bool down = (e.GetFlags() & wxFR_DOWN) != 0; bool mixed = (e.GetFlags() & wxFR_MATCHCASE) != 0; if (!mixed) { text.MakeUpper(); find.MakeUpper(); } if (down) { pos = text.find(find, startpos); if (type == wxEVT_COMMAND_FIND_NEXT && pos == startpos && pos < len) { pos = text.find(find, startpos + 1); } } else { pos = text.rfind(find, startpos); if (type == wxEVT_COMMAND_FIND_NEXT && pos == startpos && pos > 0) { pos = text.rfind(find, startpos - 1); } } if (pos == wxString::npos) { wxMessageBox(_("No matches found"), _("Nyquist Effect Workbench"), wxOK | wxCENTER, e.GetDialog()); return; } mFindText->SetInsertionPoint((long)pos);#if defined(__WXGTK__) // GTK's selection and intertion pointer interact where the insertion // pointer winds up after the second parameter, so we reverse them to // force the pointer at the beginning of the selection. Doing so // allows reverse find to work properly. mFindText->SetSelection((long)(pos + find.Length()), (long)pos);#else mFindText->SetSelection((long)pos, (long)(pos + find.Length()));#endif#if defined(__WXMAC__) // Doing this coaxes the text control to update the selection. Without // it the selection doesn't appear to change if the found string is within // the currently displayed text, i.e., no reposition is needed. mFindText->Show(false); mFindText->Show(true);#endif}
开发者ID:dot-Sean,项目名称:audio,代码行数:89,
示例6: wxT/** * /brief */bool NewClassDlg::ValidateInput(){ // validate the class name if(!IsValidCppIndetifier(m_textClassName->GetValue())) { wxString msg; msg << wxT("'") << m_textClassName->GetValue() << _("' is not a valid C++ qualifier"); wxMessageBox(msg, _("CodeLite"), wxOK | wxICON_WARNING); return false; } // validate the namespace if(!m_textCtrlNamespace->GetValue().IsEmpty()) { wxArrayString namespacesList; this->GetNamespacesList(namespacesList); // validate each namespace for(unsigned int i = 0; i < namespacesList.Count(); i++) { if(!IsValidCppIndetifier(namespacesList[i])) { wxString msg; msg << wxT("'") << namespacesList[i] << _("' is not a valid C++ qualifier"); wxMessageBox(msg, _("CodeLite"), wxOK | wxICON_WARNING); return false; } } } // validate the path of the class wxString path(m_textCtrlGenFilePath->GetValue()); if(!wxDir::Exists(path)) { wxString msg; msg << wxT("'") << path << _("': directory does not exist"); wxMessageBox(msg, _("CodeLite"), wxOK | wxICON_WARNING); return false; } if(GetClassFile().IsEmpty()) { wxMessageBox(_("Empty file name"), _("CodeLite"), wxOK | wxICON_WARNING); return false; } wxString cpp_file; cpp_file << GetClassPath() << wxFileName::GetPathSeparator() << GetClassFile() << wxT(".cpp"); if(wxFileName::FileExists(cpp_file)) { if(wxMessageBox( wxString::Format(_("A file with this name: '%s' already exists, continue anyway?"), cpp_file.GetData()), _("CodeLite"), wxYES_NO | wxICON_WARNING) == wxNO) { return false; } } wxString h_file; h_file << GetClassPath() << wxFileName::GetPathSeparator() << GetClassFile() << wxT(".h"); if(wxFileName::FileExists(h_file)) { if(wxMessageBox( wxString::Format(_("A file with this name: '%s' already exists, continue anyway?"), h_file.GetData()), _("CodeLite"), wxYES_NO | wxICON_WARNING) == wxNO) { return false; } } if(GetVirtualDirectoryPath().IsEmpty()) { wxMessageBox(_("Please select a virtual directory"), _("CodeLite"), wxOK | wxICON_WARNING); return false; } return true;}
开发者ID:huan5765,项目名称:codelite-translate2chinese,代码行数:69,
示例7: wxMessageBoxvoid MyFrame::OnAbout(wxCommandEvent& event){ wxMessageBox("This is a wxWidgets app for testing OneDrive Cloud.", "About OneDriveTest", wxOK | wxICON_INFORMATION);}
开发者ID:richardkoszegi,项目名称:WxWidgetsOneDriveTester,代码行数:5,
示例8: ROSMain_featuresbool ROSMain_features() { CoSLAM& coSLAM = MyApp::coSLAM; /////////////////////////1.GPU initilization///////////////////////// //initialization for CG; glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow(" "); glutHideWindow(); glewInit(); V3D_GPU::Cg_ProgramBase::initializeCg(); //////////////////////////2.read video information////////////////// try {// for(int c = 0; c < coSLAM.numCams; c++){// coSLAM.slam[c].videoReader = &MyApp::aviReader[c];// } coSLAM.init(false); MyApp::bInitSucc = true; logInfo("Loading video sequences.. OK!/n"); } catch (SL_Exception& e) { logInfo(e.what());#ifdef WIN32 wxMessageBox(e.what());#endif return 0; } //notify the GUI thread to create GUIs MyApp::broadcastCreateGUI(); //wait for the accomplishment of creating GUIs MyApp::waitCreateGUI(); for (int i = 0; i < coSLAM.numCams; i++){ MyApp::videoWnd[i]->setSLAMData(i, &coSLAM); vector<float> reprojErrStatic, reprojErrDynamic; vector<int> frameNumber; MyApp::s_reprojErrDynamic.push_back(reprojErrStatic); MyApp::s_reprojErrStatic.push_back(reprojErrDynamic); MyApp::s_frameNumber.push_back(frameNumber); } MyApp::modelWnd1->setSLAMData(&coSLAM); MyApp::modelWnd2->setSLAMData(&coSLAM); MyApp::broadcastCreateGUI(); //for measuring the timings Timings timingsPerStep; Timings timingsReadFrame; Timings timingsNewMapPonits; /* start the SLAM process*/ try { coSLAM.readFrame(); //copy the data to buffers for display updateDisplayData(); //initialise the map points for (int i = 0; i < coSLAM.numCams; i++) { printf("slam[%d].m_camPos.size(): %d/n", i, coSLAM.slam[i].m_camPos.size()); }// tic();// coSLAM.initMap();// toc(); cout <<"debug/n";// redis->setPose(1, 2, 3.6); while (!MyApp::bExit){ pthread_mutex_lock(&MyApp::_mutexImg); if (!coSLAM.grabReadFrame()) pthread_cond_wait(&MyApp::_condImg, &MyApp::_mutexImg); pthread_mutex_unlock(&MyApp::_mutexImg);// //copy the data to buffers for display updateDisplayData(); //printf("current frame: %d/n", coSLAM.curFrame); if (MyApp::bStartInit){ MyApp::publishMapInit(); printf("Start initializing map.../n"); coSLAM.curFrame = 0; //initialise the map points if (coSLAM.initMap()){ // Need this in real test coSLAM.calibGlobal2Cam();// return 0; for (int i = 0; i < coSLAM.numCams; i++) coSLAM.state[i] = SLAM_STATE_NORMAL; printf("Init map success!/n"); break; } else{ MyApp::bStartInit = false; MyApp::publishMapInit(); } }//.........这里部分代码省略.........
开发者ID:caomw,项目名称:CoSLAM_for_Target_Following,代码行数:101,
示例9: wxUnusedVarvoid QMakePlugin::OnNewQmakeBasedProject(wxCommandEvent& event){ wxUnusedVar(event); if(m_conf->GetAllConfigurations().IsEmpty()) { wxMessageBox(_("There is no qmake defined, please define one from 'Plugins -> Qmake -> Settings'"), _("CodeLite"), wxOK | wxICON_WARNING | wxCENTER, m_mgr->GetTheApp()->GetTopWindow()); return; } NewQtProjDlg dlg(m_mgr->GetTheApp()->GetTopWindow(), m_conf, m_mgr); if(dlg.ShowModal() == wxID_OK) { wxString kind = dlg.GetProjectKind(); wxString name = dlg.GetProjectName(); wxString path = dlg.GetProjectPath(); wxString configRelease = wxT("0000"); wxString config = wxT("0000"); wxString templateFile = m_mgr->GetStartupDirectory(); wxString type = wxEmptyString; wxString qmakeSettings = dlg.GetQmake(); wxString qmake; wxString content; if(kind == wxT("Static Library")) { type = PROJECT_TYPE_STATIC_LIBRARY; } else if(kind == wxT("Dynamic Library")) { type = PROJECT_TYPE_DYNAMIC_LIBRARY; } else if(kind == wxT("Console")) { type = PROJECT_TYPE_EXECUTABLE; configRelease = wxT("0017CONFIG += console"); config = wxT("0023CONFIG += console debug"); } else { type = PROJECT_TYPE_EXECUTABLE; config = wxT("0015CONFIG += debug"); configRelease = wxT("0000"); } wxString filename(m_mgr->GetStartupDirectory() + wxT("/templates/qmake/qmake.project")); if(!ReadFileWithConversion(filename, content)) { return; } // prepend the string lenght qmake = wxString::Format(wxT("%04d%s"), qmakeSettings.Length(), qmakeSettings.c_str()); content.Replace(wxT("$(TYPE)"), type); content.Replace(wxT("$(NAME)"), name); content.Replace(wxT("$(CONFIG)"), config); content.Replace(wxT("$(RELEASE_CONFIG)"), configRelease); content.Replace(wxT("$(QMAKE)"), qmake); // save the file to the disk { DirSaver ds; if(!wxSetWorkingDirectory(path)) { wxMessageBox(_("Invalid project path!"), _("CodeLite"), wxOK | wxCENTER | wxICON_WARNING); return; } if(dlg.GetCreateDirectory()) { wxMkdir(name); wxSetWorkingDirectory(name); } if(!WriteFileWithBackup(name + wxT(".project"), content, false)) { wxMessageBox(wxString::Format(_("Failed to create .project file '%s'"), wxString(name + wxT(".project")).c_str()), _("CodeLite"), wxOK | wxCENTER | wxICON_WARNING); return; } path = wxGetCwd(); path << wxFileName::GetPathSeparator() << name << wxT(".project"); m_mgr->AddProject(path); } }}
开发者ID:eranif,项目名称:codelite,代码行数:82,
示例10: dc//.........这里部分代码省略......... msg = AddHotkeyName( _( "Move Dimension Text" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST, msg, KiBitmap( move_text_xpm ) ); msg = AddHotkeyName( _( "Delete Dimension" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION, msg, KiBitmap( delete_xpm ) ); } break; case PCB_TARGET_T: if( !flags ) { msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, msg, KiBitmap( move_xpm ) ); msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) ); msg = AddHotkeyName( _( "Delete Target" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, msg, KiBitmap( delete_xpm ) ); } break; case PCB_MODULE_EDGE_T: case SCREEN_T: case TYPE_NOT_INIT: case PCB_T: msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ), item->Type() ); wxMessageBox( msg ); SetCurItem( NULL ); break; default: msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ), item->Type() ); wxMessageBox( msg ); // Attempt to clear error (but should no occurs ) if( item->Type() >= MAX_STRUCT_TYPE_ID ) SetCurItem( NULL ); break; } aPopMenu->AppendSeparator(); } if( !flags ) { msg = AddHotkeyName( _( "Get and Move Footprint" ), g_Board_Editor_Hokeys_Descr, HK_GET_AND_MOVE_FOOTPRINT ); AddMenuItem( aPopMenu, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST, msg, KiBitmap( move_module_xpm ) ); } // Display context sensitive commands: switch( GetToolId() ) { case ID_PCB_ZONES_BUTT: if( GetBoard()->m_ZoneDescriptorList.size() > 0 ) {
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:67,
示例11: switchvoid PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ){ int id = event.GetId(); wxFileName fn; switch( id ) { case ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG: m_show_layer_manager_tools = ! m_show_layer_manager_tools; m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools ); m_auimgr.Update(); GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, m_show_layer_manager_tools ? _("Hide &Layers Manager" ) : _("Show &Layers Manager" )); break; case ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR: m_show_microwave_tools = ! m_show_microwave_tools; m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools ); m_auimgr.Update(); GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR, m_show_microwave_tools ? _( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" )); break; case ID_PCB_LAYERS_SETUP: if( InvokeLayerSetup( this, GetBoard() ) ) { LAYER_ID cur_layer = GetActiveLayer(); // If after showing the dialog the user has removed the active layer, // then select a new active layer (front copper layer). if( !GetBoard()->GetEnabledLayers()[ cur_layer ] ) cur_layer = F_Cu; SetActiveLayer( cur_layer ); OnModify(); ReCreateLayerBox(); ReFillLayerWidget(); if( IsGalCanvasActive() ) static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( GetBoard() ); } break; case ID_PCB_LIB_WIZARD: case ID_PCB_LIB_TABLE_EDIT: { bool tableChanged = false; int r = 0; if( id == ID_PCB_LIB_TABLE_EDIT ) r = InvokePcbLibTableEditor( this, &GFootprintTable, Prj().PcbFootprintLibs() ); else r = InvokeFootprintWizard( this, &GFootprintTable, Prj().PcbFootprintLibs() ); if( r & 1 ) { try { FILE_OUTPUTFORMATTER sf( FP_LIB_TABLE::GetGlobalTableFileName() ); GFootprintTable.Format( &sf, 0 ); tableChanged = true; } catch( const IO_ERROR& ioe ) { wxString msg = wxString::Format( _( "Error occurred saving the global footprint library " "table:/n/n%s" ), GetChars( ioe.errorText.GetData() ) ); wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR ); } } // If no board file is defined, do not save the project specific library table. It // is kept in memory and created in the path when the new board is saved. if( (r & 2) && !GetBoard()->GetFileName().IsEmpty() ) { wxString tblName = Prj().FootprintLibTblName(); try { Prj().PcbFootprintLibs()->Save( tblName ); tableChanged = true; } catch( const IO_ERROR& ioe ) { wxString msg = wxString::Format( _( "Error occurred saving project specific footprint library " "table:/n/n%s" ), GetChars( ioe.errorText ) ); wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR ); }//.........这里部分代码省略.........
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:101,
示例12: errorstringbool HDRMergeOptionsDialog::BuildCommandLineArgument(){ int selection=m_mode->GetSelection(); m_cmd.Clear(); bool correct_input=true; double i = 0; wxString errorstring(_("Invalid input/n")); switch(selection) { case 0: m_cmd.Append(wxT("-m avg")); if(m_option_c->IsChecked()) m_cmd.Append(wxT(" -c")); break; case 1: m_cmd.Append(wxT("-m avg_slow")); break; case 2: m_cmd.Append(wxT("-m khan")); if(m_khan_iter->GetValue()) { m_cmd.Append(wxString::Format(wxT(" -i %d"),m_khan_iter->GetValue())); } else { correct_input=false; errorstring.Append(wxString::Format(_("Input /"%s/" for %s is not a valid number/n"), m_khan_iter->GetValue(),_("Iteration"))); }; if(m_khan_sigma->GetValue().ToDouble(&i)) { //change locale for correct numeric output char * p = setlocale(LC_NUMERIC,NULL); char * old_locale = strdup(p); setlocale(LC_NUMERIC,"C"); m_cmd.Append(wxString::Format(wxT(" -s %f"),i)); //reset locale setlocale(LC_NUMERIC,old_locale); free(old_locale); } else { correct_input=false; errorstring.Append(wxString::Format(_("Input /"%s/" for %s is not a valid number/n"), m_khan_iter->GetValue(),_("Sigma"))); }; if(m_option_khan_af->IsChecked() || m_option_khan_ag->IsChecked() || m_option_khan_am->IsChecked()) { m_cmd.Append(wxT(" -a ")); if(m_option_khan_af->IsChecked()) m_cmd.Append(wxT("f")); if(m_option_khan_ag->IsChecked()) m_cmd.Append(wxT("g")); if(m_option_khan_am->IsChecked()) m_cmd.Append(wxT("m")); } break; }; if(!correct_input) wxMessageBox(errorstring,_("Wrong input"),wxOK | wxICON_INFORMATION); return correct_input;};
开发者ID:xelmirage,项目名称:hugin-2012.0.0,代码行数:63,
示例13: wxMessageBoxvoid ParamEdit::ParamInsertUpdateError(wxString error) { wxMessageBox(_("Error while editing network set: ") + error, _("Editing network set error"), wxOK | wxICON_ERROR, this);}
开发者ID:marta09,项目名称:szarp,代码行数:4,
示例14: SelectReferenceNumberbool DIALOG_TEXT_PROPERTIES::TransferDataToWindow(){ if( m_SingleLineText->IsShown() ) { m_SingleLineText->SetValue( m_edaText->GetText() ); if( m_modText && m_modText->GetType() == TEXTE_MODULE::TEXT_is_REFERENCE ) SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) ); else m_SingleLineText->SetSelection( -1, -1 ); } else if( m_MultiLineText->IsShown() ) { m_MultiLineText->SetValue( m_edaText->GetText() ); m_MultiLineText->SetSelection( -1, -1 ); } else if (m_DimensionText->IsShown() ) { m_DimensionText->SetValue( m_edaText->GetText() ); m_DimensionText->SetSelection( -1, -1 ); DIMENSION* dimension = (DIMENSION*) m_item; EDA_UNITS_T units; bool useMils; dimension->GetUnits( units, useMils ); m_DimensionUnitsOpt->SetSelection( units == MILLIMETRES ? 2 : useMils ? 1 : 0 ); } if( m_item->Type() == PCB_MODULE_TEXT_T && m_modText ) { MODULE* module = dynamic_cast<MODULE*>( m_modText->GetParent() ); wxString msg; if( module ) { msg.Printf( _("Footprint %s (%s), %s, rotated %.1f deg"), module->GetReference(), module->GetValue(), module->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ), module->GetOrientation() / 10.0 ); } m_statusLine->SetLabel( msg ); } else { m_statusLine->Show( false ); } if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 ) { wxMessageBox( _( "This item was on a non-existing or forbidden layer./n" "It has been moved to the first allowed layer." ) ); m_LayerSelectionCtrl->SetSelection( 0 ); } m_textWidth.SetValue( m_edaText->GetTextSize().x ); m_textHeight.SetValue( m_edaText->GetTextSize().y ); m_thickness.SetValue( m_edaText->GetThickness() ); m_posX.SetValue( m_edaText->GetTextPos().x ); m_posY.SetValue( m_edaText->GetTextPos().y ); m_Visible->SetValue( m_edaText->IsVisible() ); m_Italic->SetValue( m_edaText->IsItalic() ); EDA_TEXT_HJUSTIFY_T hJustify = m_edaText->GetHorizJustify(); m_JustifyChoice->SetSelection( (int) hJustify + 1 ); m_OrientValue = m_edaText->GetTextAngleDegrees(); m_Mirrored->SetValue( m_edaText->IsMirrored() ); if( m_modText ) m_KeepUpright->SetValue( m_modText->IsKeepUpright() ); return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:75,
示例15: SetFocusvoid DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::initDlg(){ SetFocus(); m_StandardButtonsSizerOK->SetDefault(); // Set unit symbol wxStaticText * texts_unit[] = { m_StartPointXUnit, m_StartPointYUnit, m_EndPointXUnit, m_EndPointYUnit, m_ThicknessTextUnit, m_DefaulThicknessTextUnit, NULL }; for( int ii = 0; ; ii++ ) { if( texts_unit[ii] == NULL ) break; texts_unit[ii]->SetLabel( GetAbbreviatedUnitsLabel() ); } wxString msg; // Change texts according to the segment shape: switch ( m_item->GetShape() ) { case S_CIRCLE: m_StartPointXLabel->SetLabel(_("Center X")); m_StartPointYLabel->SetLabel(_("Center Y")); m_EndPointXLabel->SetLabel(_("Point X")); m_EndPointYLabel->SetLabel(_("Point Y")); m_Angle_Text->Show(false); m_Angle_Ctrl->Show(false); m_AngleUnit->Show(false); break; case S_ARC: m_StartPointXLabel->SetLabel(_("Center X")); m_StartPointYLabel->SetLabel(_("Center Y")); m_EndPointXLabel->SetLabel(_("Start Point X")); m_EndPointYLabel->SetLabel(_("Start Point Y")); // Here the angle is a double, but the UI is still working // with integers msg << int( m_item->GetAngle() ); m_Angle_Ctrl->SetValue(msg); break; default: m_Angle_Text->Show(false); m_Angle_Ctrl->Show(false); m_AngleUnit->Show(false); break; } PutValueInLocalUnits( *m_Center_StartXCtrl, m_item->GetStart().x ); PutValueInLocalUnits( *m_Center_StartYCtrl, m_item->GetStart().y ); PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_item->GetEnd().x ); PutValueInLocalUnits( *m_EndY_Ctrl, m_item->GetEnd().y ); PutValueInLocalUnits( *m_ThicknessCtrl, m_item->GetWidth() ); PutValueInLocalUnits( *m_DefaultThicknessCtrl, m_brdSettings.m_ModuleSegmentWidth ); // Configure the layers list selector m_LayerSelectionCtrl->SetLayersHotkeys( false ); m_LayerSelectionCtrl->SetLayerSet( LSET::InternalCuMask().set( Edge_Cuts ) ); m_LayerSelectionCtrl->SetBoardFrame( m_parent ); m_LayerSelectionCtrl->Resync(); if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 ) { wxMessageBox( _( "This item has an illegal layer id./n" "Now, forced on the front silk screen layer. Please, fix it" ) ); m_LayerSelectionCtrl->SetLayerSelection( F_SilkS ); }}
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:84,
示例16: dialog//.........这里部分代码省略......... PMResolution res; PMPrinter printer; wxOSXPrintData* nativeData = (wxOSXPrintData*) (m_printDialogData.GetPrintData().GetNativeData()); if (PMSessionGetCurrentPrinter(nativeData->GetPrintSession(), &printer) == noErr) {#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if ( PMPrinterGetOutputResolution != NULL ) { if (PMPrinterGetOutputResolution( printer, nativeData->GetPrintSettings(), &res) == -9589 /* kPMKeyNotFound */ ) { res.hRes = res.vRes = 300; } } else#endif {#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 PMPrinterGetPrinterResolution(printer, kPMCurrentValue, &res);#endif } } printout->SetPPIPrinter(int(res.hRes), int(res.vRes)); // Set printout parameters printout->SetDC(dc); int w, h; dc->GetSize(&w, &h); printout->SetPageSizePixels((int)w, (int)h); printout->SetPaperRectPixels(dc->GetPaperRect()); wxCoord mw, mh; dc->GetSizeMM(&mw, &mh); printout->SetPageSizeMM((int)mw, (int)mh); // Create an abort window wxBeginBusyCursor(); printout->OnPreparePrinting(); // Get some parameters from the printout, if defined int fromPage, toPage; int minPage, maxPage; printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); if (maxPage == 0) { sm_lastError = wxPRINTER_ERROR; return false; } // Only set min and max, because from and to will be // set by the user m_printDialogData.SetMinPage(minPage); m_printDialogData.SetMaxPage(maxPage); printout->OnBeginPrinting(); bool keepGoing = true; if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage())) { wxEndBusyCursor(); wxMessageBox(wxT("Could not start printing."), wxT("Print Error"), wxOK, parent); } int pn; for (pn = m_printDialogData.GetFromPage(); keepGoing && (pn <= m_printDialogData.GetToPage()) && printout->HasPage(pn); pn++) { if (sm_abortIt) { break; } else { dc->StartPage(); keepGoing = printout->OnPrintPage(pn); dc->EndPage(); } } printout->OnEndDocument(); printout->OnEndPrinting(); if (sm_abortWindow) { sm_abortWindow->Show(false); wxDELETE(sm_abortWindow); } wxEndBusyCursor(); delete dc; return true;}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:101,
示例17: wxMessageBoxvoid CQuickconnectBar::OnQuickconnect(wxCommandEvent& event){ CState* pState = CContextManager::Get()->GetCurrentContext(); if (!pState || !pState->m_pEngine) { wxMessageBox(_("FTP Engine not initialized, can't connect"), _("FileZilla Error"), wxICON_EXCLAMATION); return; } wxString host = m_pHost->GetValue(); wxString user = m_pUser->GetValue(); wxString pass = m_pPass->GetValue(); wxString port = m_pPort->GetValue(); CServer server; wxString error; CServerPath path; if (!server.ParseUrl(host, port, user, pass, error, path)) { wxString msg = _("Could not parse server address:"); msg += _T("/n"); msg += error; wxMessageBox(msg, _("Syntax error"), wxICON_EXCLAMATION); return; } host = server.FormatHost(true); ServerProtocol protocol = server.GetProtocol(); switch (protocol) { case FTP: case UNKNOWN: if (CServer::GetProtocolFromPort(server.GetPort()) != FTP && CServer::GetProtocolFromPort(server.GetPort()) != UNKNOWN) host = _T("ftp://") + host; break; default: { const wxString prefix = server.GetPrefixFromProtocol(protocol); if (prefix != _T("")) host = prefix + _T("://") + host; } break; } m_pHost->SetValue(host); if (server.GetPort() != server.GetDefaultPort(server.GetProtocol())) m_pPort->SetValue(wxString::Format(_T("%d"), server.GetPort())); else m_pPort->SetValue(_T("")); m_pUser->SetValue(server.GetUser()); m_pPass->SetValue(server.GetPass()); if (protocol == HTTP || protocol == HTTPS) { wxString error = _("Invalid protocol specified. Valid protocols are:/nftp:// for normal FTP,/nsftp:// for SSH file transfer protocol,/nftps:// for FTP over SSL (implicit) and/nftpes:// for FTP over SSL (explicit)."); wxMessageBox(error, _("Syntax error"), wxICON_EXCLAMATION); return; } if (event.GetId() == 1) server.SetBypassProxy(true); if (!m_pMainFrame->ConnectToServer(server, path)) return; CRecentServerList::SetMostRecentServer(server);}
开发者ID:Andais,项目名称:FileZilla,代码行数:71,
示例18: Export_IDF3/** * Function Export_IDF3 * generates IDFv3 compliant board (*.emn) and library (*.emp) * files representing the user's PCB design. */bool Export_IDF3( BOARD* aPcb, const wxString& aFullFileName, bool aUseThou, double aXRef, double aYRef ){ IDF3_BOARD idfBoard( IDF3::CAD_ELEC ); SetLocaleTo_C_standard(); bool ok = true; double scale = MM_PER_IU; // we must scale internal units to mm for IDF IDF3::IDF_UNIT idfUnit; if( aUseThou ) { idfUnit = IDF3::UNIT_THOU; idfBoard.SetUserPrecision( 1 ); } else { idfUnit = IDF3::UNIT_MM; idfBoard.SetUserPrecision( 5 ); } wxFileName brdName = aPcb->GetFileName(); idfBoard.SetUserScale( scale ); idfBoard.SetBoardThickness( aPcb->GetDesignSettings().GetBoardThickness() * scale ); idfBoard.SetBoardName( TO_UTF8( brdName.GetFullName() ) ); idfBoard.SetBoardVersion( 0 ); idfBoard.SetLibraryVersion( 0 ); std::ostringstream ostr; ostr << "KiCad " << TO_UTF8( GetBuildVersion() ); idfBoard.SetIDFSource( ostr.str() ); try { // set up the board reference point idfBoard.SetUserOffset( -aXRef, aYRef ); // Export the board outline idf_export_outline( aPcb, idfBoard ); // Output the drill holes and module (library) data. for( MODULE* module = aPcb->m_Modules; module != 0; module = module->Next() ) idf_export_module( aPcb, module, idfBoard ); if( !idfBoard.WriteFile( aFullFileName, idfUnit, false ) ) { wxString msg; msg << _( "IDF Export Failed:/n" ) << FROM_UTF8( idfBoard.GetError().c_str() ); wxMessageBox( msg ); ok = false; } } catch( const IO_ERROR& ioe ) { wxString msg; msg << _( "IDF Export Failed:/n" ) << ioe.errorText; wxMessageBox( msg ); ok = false; } catch( const std::exception& e ) { wxString msg; msg << _( "IDF Export Failed:/n" ) << FROM_UTF8( e.what() ); wxMessageBox( msg ); ok = false; } SetLocaleTo_Default(); return ok;}
开发者ID:JOE-JOE-NGIGI,项目名称:kicad,代码行数:80,
示例19: switchvoid VAutoDialog::OnNotifyCameraShoot (wxCommandEvent& ev){ bool accidentalStop = false; CameraNotifier::CameraShootAction shootAction = (CameraNotifier::CameraShootAction) ev.GetInt ();// wxLogDebug (wxString::Format("Camera notification arrived: %d", shootAction)); switch (shootAction) { case CameraNotifier::SHOOT_NOTIFY_TIME: { SetStatusText (ev.GetString ()); return; } break; case CameraNotifier::SHOOT_STOP_NORMALLY:// ObservationLog::Instance().SetStatus (wxT("OK"));// ObservationLog::Instance().Flush (); break; case CameraNotifier::SHOOT_TIMEOUT: m_camera->AbortShooting ();// ObservationLog::Instance().SetStatus (LOG_STATUS_TIMEOUT);// ObservationLog::Instance().Flush (); wxMessageBox (_("The camera is not stop shooting before timeout expired."), _("Shooting"), wxICON_EXCLAMATION | wxOK, this); accidentalStop = true; break; case CameraNotifier::SHOOT_ABORT:// ObservationLog::Instance().SetStatus (wxT("Failed:abort"));// ObservationLog::Instance().Flush (); wxMessageBox (_("The exposition stopped by the user."), _("Shooting"), wxICON_EXCLAMATION | wxOK, this); accidentalStop = true; break; } if (!m_Auto) { if (m_HasPlan) NextPlanTarget (); SetState (STATE_READY); DoDisableControls (false); m_MoveButton->SetFocus (); } else { if (!NextPlanTarget ()) { // TODO: A plan file-t t C++ wxMessageBoxEx函数代码示例 C++ wxMax函数代码示例
|