void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) { unsigned ii = m_PadType->GetSelection(); if( ii >= NBTYPES ) // catches < 0 also ii = 0; LAYER_MSK layer_mask = Std_Pad_Layers[ii]; setPadLayersList( layer_mask ); // Enable/disable drill dialog items: event.SetId( m_DrillShapeCtrl->GetSelection() ); OnDrillShapeSelected( event ); if( ii == 0 || ii == NBTYPES-1 ) m_DrillShapeCtrl->Enable( true ); else m_DrillShapeCtrl->Enable( false ); // Enable/disable Pad name,and pad length die // (disable for NPTH pads (mechanical pads) bool enable = ii != 3; m_PadNumCtrl->Enable( enable ); m_PadNetNameCtrl->Enable( enable ); m_LengthPadToDieCtrl->Enable( enable ); }
void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) { unsigned ii = m_PadType->GetSelection(); if( ii >= DIM( code_type ) ) // catches < 0 also ii = 0; LSET layer_mask = std_pad_layers[ii]; setPadLayersList( layer_mask ); // Enable/disable drill dialog items: event.SetId( m_DrillShapeCtrl->GetSelection() ); OnDrillShapeSelected( event ); if( ii == 0 || ii == DIM( code_type )-1 ) m_DrillShapeCtrl->Enable( true ); else m_DrillShapeCtrl->Enable( false ); // Enable/disable Pad name,and pad length die // (disable for NPTH pads (mechanical pads) bool enable = ii != 3; m_PadNumCtrl->Enable( enable ); m_PadNetNameCtrl->Enable( m_canEditNetName && enable && m_currentPad != NULL ); m_LengthPadToDieCtrl->Enable( enable ); }
void CscopeTab::OnCreateDB(wxCommandEvent &e) { // There's no easy way afaict to reach the class Cscope direct, so... e.SetId(XRCID("cscope_create_db")); e.SetEventType(wxEVT_COMMAND_MENU_SELECTED); wxPostEvent(m_mgr->GetTheApp(), e); }
void RuleBoxClass::ToggleEnabled(wxCommandEvent& event) { if (event.IsChecked()) ruleContent->Enable(true); else ruleContent->Enable(false); Refresh(); event.SetId(ruleIndex); GetGrandParent()->ProcessWindowEvent(event); }
void wxTimeSpinCtrl::OnText(wxCommandEvent &ev) { long time = GetTextTime(); if (time >= 0) { spinValue = time; ev.SetEventObject(this); ev.SetId(GetId()); #if wxCHECK_VERSION(2, 9, 0) GetParent()->GetEventHandler()->ProcessEvent(ev); #else GetParent()->ProcessEvent(ev); #endif } }
void GitConsole::OnDropDownMenuEvent(wxCommandEvent& event) { int id = event.GetId(); GitCommandData* userdata = static_cast<GitCommandData*>(event.GetEventUserData()); wxCHECK_RET((int)userdata->arr.GetCount() > event.GetId(), "Out-of-range ID"); event.SetString(userdata->arr.Item(id)); event.SetId(userdata->id); wxPostEvent(m_git, event); // We've now populated the event object with useful data, so get GitPlugin to process it clConfig conf("git.conf"); GitEntry data; conf.ReadItem(&data); GitCommandsEntries& ce = data.GetGitCommandsEntries(userdata->name); ce.SetLastUsedCommandIndex(id); conf.WriteItem(&data); conf.Save(); }
/* Creates a new project folder, copy a template into this new folder. * and open this new project as working project */ void KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate( wxCommandEvent& event ) { wxString default_dir = wxFileName( Prj().GetProjectFullName() ).GetPathWithSep(); wxString title = _("New Project Folder"); wxDirDialog dlg( this, title, default_dir ); if( dlg.ShowModal() == wxID_CANCEL ) return; // Builds the project .pro filename, from the new project folder name wxFileName fn; fn.AssignDir( dlg.GetPath() ); fn.SetName( dlg.GetPath().AfterLast( SEP() ) ); fn.SetExt( wxT( "pro" ) ); // Launch the template selector dialog, and copy files CreateNewProject( fn.GetFullPath(), true ); // Initialize the project event.SetId( wxID_ANY ); OnLoadProject( event ); }
void BFBackupTree::OnProjectSaveAs (wxCommandEvent& rEvent) { rEvent.SetId(BF_ID_MAINFRAME_SAVEPRJAS); BFMainFrame::Instance()->OnProject(rEvent); }
/// Notes the selection when a new button is pressed void DragButtonList::OnRadioButton(wxCommandEvent& event) { mSelected = event.GetId() - wxID_HIGHEST - 1; event.SetId(mSelected); event.Skip(); //pass to the parent to select the source }