void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event ) { SetReturnCode( wxID_OK ); SetDrcParmeters(); m_tester->DestroyDialog( wxID_OK ); }
DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) : DIALOG_COPPER_ZONE_BASE( aParent ) { m_Parent = aParent; m_Config = Kiface().KifaceSettings(); m_ptr = aSettings; m_settings = *aSettings; m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort m_OnExitCode = ZONE_ABORT; SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click // Fix static text widget minimum width to a suitable value so that // resizing the dialog is not necessary when changing the corner smoothing type. // Depends on the default text in the widget. m_cornerSmoothingTitle->SetMinSize( m_cornerSmoothingTitle->GetSize() ); initDialog(); m_sdbSizerOK->SetDefault(); GetSizer()->SetSizeHints( this ); Center(); }
void DlgSaveLayout::OnOkClick( wxCommandEvent& event ) { if(!m_ComboLayout->GetValue().IsEmpty()) { if(bSave) { wxMainFrame::Get()->AddLayout(m_ComboLayout->GetValue()); } else { wxMainFrame::Get()->RemoveLayout(m_ComboLayout->GetValue()); } if ( IsModal() ) EndModal(wxID_OK); // If modal else { SetReturnCode(wxID_OK); this->Show(false); // If modeless } } else { wxMessageBox(wxT("You must enter a layout name"), wxT("Error")); } }
void DIALOG_NON_COPPER_ZONES_EDITOR::Init() { BOARD* board = m_parent->GetBoard(); SetReturnCode( ZONE_ABORT ); // Will be changed on button click AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit ); wxString msg = StringFromValue( g_UserUnit, m_settings.m_ZoneMinThickness ); m_ZoneMinThicknessCtrl->SetValue( msg ); if( m_settings.m_Zone_45_Only ) m_OrientEdgesOpt->SetSelection( 1 ); switch( m_settings.m_Zone_HatchingStyle ) { case CPolyLine::NO_HATCH: m_OutlineAppearanceCtrl->SetSelection( 0 ); break; case CPolyLine::DIAGONAL_EDGE: m_OutlineAppearanceCtrl->SetSelection( 1 ); break; case CPolyLine::DIAGONAL_FULL: m_OutlineAppearanceCtrl->SetSelection( 2 ); break; } // Create one column in m_LayerSelectionCtrl wxListItem column0; column0.SetId( 0 ); m_LayerSelectionCtrl->InsertColumn( 0, column0 ); // Create an icon list: wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL ); int ii = 0; int lyrSelect = ( (PCB_SCREEN*) m_parent->GetScreen() )->m_Active_Layer; if( m_zone ) lyrSelect = m_zone->GetLayer(); for( LSEQ seq = LSET::AllNonCuMask().Seq(); seq; ++seq, ++ii ) { LAYER_ID layer = *seq; EDA_COLOR_T layerColor = board->GetLayerColor( layer ); imageList->Add( makeLayerBitmap( layerColor ) ); wxString msg = board->GetLayerName( layer ); msg.Trim(); int itemIndex = m_LayerSelectionCtrl->InsertItem( m_LayerSelectionCtrl->GetItemCount(), msg, ii ); if(lyrSelect == layer ) m_LayerSelectionCtrl->Select( itemIndex ); } }
void ParamEdit::Close() { if (IsModal()) EndModal(wxID_OK); else { SetReturnCode(wxID_OK); Show(false); } }
void ParamEdit::OnCancel(wxCommandEvent & event) { if (IsModal()) EndModal(wxID_CANCEL); else { SetReturnCode(wxID_CANCEL); Show(false); } }
void wxDialog::EndModal(int retCode) { wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") ); SetReturnCode(retCode); Hide(); }
void DIALOG_DRC_CONTROL::OnCancelClick( wxCommandEvent& event ) { SetReturnCode( wxID_CANCEL ); // The dialog can be modal or not modal. // Leave the DRC caller destroy (or not) the dialog m_tester->DestroyDRCDialog( wxID_CANCEL ); }
// NB: this function (surprisingly) may be called for both modal and modeless // dialogs and should work for both of them void wxDialog::EndModal(int retCode) { if ( m_eventLoop ) m_eventLoop->Exit(retCode); SetReturnCode(retCode); Show(false); }
void CConfigChooser::onCancel(wxCommandEvent& WXUNUSED(event)) { if (IsModal()) { EndModal(wxID_CANCEL); } else { SetReturnCode(wxID_CANCEL); Show(false); } }
void wxDialog::EndModal(int retCode) { wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") ); // m_endModalCalled = true; SetReturnCode(retCode); Hide(); }
void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event ) { SetReturnCode( wxID_OK ); SetDrcParmeters(); // The dialog can be modal or not modal. // Leave the DRC caller destroy (or not) the dialog m_tester->DestroyDRCDialog( wxID_OK ); }
//---------------------------------------------------------------- void CommandDialog::OnButtonCancelClick(wxCommandEvent& event) /** * \brief Occurs when the Cancel Button is clicked. Closes the Dialog. * \param event CommandEvent. **/ { SetReturnCode(wxID_CANCEL); Destroy(); }
//---------------------------------------------------------------- void CommandDialog::OnClose(wxCloseEvent& event) /** * \brief Closes the dialog, sets the return code to cancel. * \param event CommandEvent. **/ { SetReturnCode(wxID_CANCEL); Destroy(); }
void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { if ( IsModal() ) EndModal(wxID_CANCEL); else { SetReturnCode(wxID_CANCEL); this->Show(false); } }
void DIALOG_ANNOTATE::OnCancelClick( wxCommandEvent& event ) { if( IsModal() ) EndModal( wxID_CANCEL ); else { SetReturnCode( wxID_CANCEL ); this->Show( false ); } }
void wxDialogBase::ShowWindowModal () { int retval = ShowModal(); // wxWindowModalDialogEvent relies on GetReturnCode() returning correct // code. Rather than doing it manually in all ShowModal() overrides for // native dialogs (and getting accidentally broken again), set it here. // The worst that can happen is that it will be set twice to the same // value. SetReturnCode(retval); SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); }
//---------------------------------------------------------------- void CommandDialog::OnButtonOkClick(wxCommandEvent& event) /** * \brief Occurs when the Ok button is clicked. Saves and closes * the dialog. * \param event CommandEvent. **/ { SetReturnCode(wxID_OK); SaveContent(); Destroy(); }
void wxDialog::EndModal( int nRetCode ) { wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") ); m_endModalCalled = true; SetReturnCode(nRetCode); Hide(); } // end of wxDialog::EndModal
void filter_dlg::OnOK(wxCommandEvent &event) { if (Validate() && TransferDataFromWindow()) { ApplyLimit(); ExecFilter(); if (IsModal()) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Show(false); } } }
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) : DIALOG_GENDRILL_BASE( parent ) { m_parent = parent; m_board = parent->GetBoard(); m_config = Kiface().KifaceSettings(); m_plotOpts = m_parent->GetPlotSettings(); SetReturnCode( 1 ); initDialog(); GetSizer()->SetSizeHints( this ); }
void ImageMessageBox::OnNo(wxCommandEvent& event) { if ( Validate() && TransferDataFromWindow() ) { if ( IsModal() ) EndModal(wxNO); // If modal else { SetReturnCode(wxNO); this->Show(false); // If modeless } } }
// Standard buttons void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { if ( Validate() && TransferDataFromWindow() ) { if ( IsModal() ) EndModal(wxID_OK); else { SetReturnCode(wxID_OK); this->Show(false); } } }
void wxDialog::EndModal(int retCode) { if (!m_modalShowing) return; SetReturnCode(retCode); // Strangely, we don't seem to need this now. // XtRemoveGrab((Widget) m_mainWidget); Show(false); m_modalShowing = false; m_eventLoop->Exit(); }
void wxDialog::EndModal( int retCode ) { SetReturnCode( retCode ); if (!IsModal()) { wxFAIL_MSG( wxT("wxDialog:EndModal called twice") ); return; } m_modalShowing = false; gtk_main_quit(); Show( false ); }
/*********************************************************************** * Method: ButtonChoiceDialog::OnChoice2 * Params: wxCommandEvent &event * Returns: void * Effects: ***********************************************************************/ void ButtonChoiceDialog::OnChoice2(wxCommandEvent &event) { if ( Validate() && TransferDataFromWindow() ) { if ( IsModal() ) { EndModal(BUTTON_CHOICE_2); } else { SetReturnCode(BUTTON_CHOICE_2); Show(false); } } }
void CConfigChooser::onOK(wxCommandEvent& WXUNUSED(event)) { int choice = m_configChoice->GetSelection(); if (choice == wxNOT_FOUND) { ::wxMessageBox(_("No SDR Name has been chosen"), _("UWSDR Error"), wxICON_ERROR); return; } m_name = m_configChoice->GetString(choice); if (IsModal()) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Show(false); } }
void ddTableNameDialog::OnEnterPressed( wxCommandEvent& event ) { if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { if ( Validate() && TransferDataFromWindow() ) { if ( IsModal() ) EndModal(wxID_OK); // If modal else { SetReturnCode(wxID_OK); this->Show(false); // If modeless } } } }
void wxDialog::EndModal(int retCode) { wxASSERT_MSG( m_eventLoop, wxT("wxDialog is not modal") ); SetReturnCode(retCode); if ( !IsModal() ) { wxFAIL_MSG( wxT("wxDialog:EndModal called twice") ); return; } m_isShowingModal = false; m_eventLoop->Exit(); Show(false); }
bool MyApp::OnInit() { m_frame = NULL; wxLogDebug(_T("Starting App")); SetReturnCode(0); m_isTimerRunning = false; // Seed random number generator (for grid scrambling) srand( time(NULL) ); SetupConfig(); SetupPrinting(); return ReadCommandLine(); }