diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index e2fcead5ee..6ca5406b76 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -23,6 +23,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -56,18 +65,9 @@ #include #include #include -#include -#include #include #include #include -#include -#include -#include -#include - -#include -#include #define FR_HISTORY_LIST_CNT 10 ///< Maximum size of the find/replace history stacks. diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 36271d4e62..d62cad94ef 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -23,6 +23,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include +#include + #include #include #include @@ -55,15 +58,13 @@ #include // shared tools with other Pcbnew frames #include #include -#include -#include #include BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME ) EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow ) - EVT_CHOICE( ID_ON_ZOOM_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectZoom ) - EVT_CHOICE( ID_ON_GRID_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectGrid ) + EVT_COMBOBOX( ID_ON_ZOOM_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectZoom ) + EVT_COMBOBOX( ID_ON_GRID_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectGrid ) EVT_MENU( ID_GRID_SETTINGS, DISPLAY_FOOTPRINTS_FRAME::OnGridSettings ) END_EVENT_TABLE() @@ -303,9 +304,10 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar() m_mainToolBar->AddScaledSeparator( this ); - // Grid selection choice box. + // Grid selection combo box. if( !m_gridSelectBox ) - m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT ); + m_gridSelectBox = new wxComboBox( m_mainToolBar, ID_ON_GRID_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateGridSelectBox(); m_mainToolBar->AddControl( m_gridSelectBox ); @@ -314,7 +316,8 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar() // Zoom selection choice box. if( !m_zoomSelectBox ) - m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT ); + m_zoomSelectBox = new wxComboBox( m_mainToolBar, ID_ON_ZOOM_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateZoomSelectBox(); m_mainToolBar->AddControl( m_zoomSelectBox ); diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index b660b0b1e0..5b0377fb02 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -74,8 +74,8 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME ) EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice ) EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice ) - EVT_CHOICE( ID_ON_ZOOM_SELECT, GERBVIEW_FRAME::OnSelectZoom ) - EVT_CHOICE( ID_ON_GRID_SELECT, GERBVIEW_FRAME::OnSelectGrid ) + EVT_COMBOBOX( ID_ON_ZOOM_SELECT, GERBVIEW_FRAME::OnSelectZoom ) + EVT_COMBOBOX( ID_ON_GRID_SELECT, GERBVIEW_FRAME::OnSelectGrid ) EVT_MENU( ID_GRID_SETTINGS, GERBVIEW_FRAME::OnGridSettings ) EVT_UPDATE_UI( ID_ON_GRID_SELECT, GERBVIEW_FRAME::OnUpdateSelectGrid ) diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 3b20605980..3ceb582a19 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -179,8 +180,8 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar() if( !m_gridSelectBox ) { - m_gridSelectBox = new wxChoice( m_auxiliaryToolBar, ID_ON_GRID_SELECT, wxDefaultPosition, - wxDefaultSize, 0, nullptr ); + m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar, ID_ON_GRID_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); } m_auxiliaryToolBar->AddScaledSeparator( this ); @@ -188,8 +189,8 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar() if( !m_zoomSelectBox ) { - m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar, ID_ON_ZOOM_SELECT, wxDefaultPosition, - wxDefaultSize, 0, nullptr ); + m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar, ID_ON_ZOOM_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); } m_auxiliaryToolBar->AddScaledSeparator( this ); diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index 580df1d79b..3afc15df2f 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -499,8 +499,8 @@ protected: bool m_showBorderAndTitleBlock; // Show the drawing sheet (border & title block). - wxChoice* m_gridSelectBox; - wxChoice* m_zoomSelectBox; + wxComboBox* m_gridSelectBox; + wxComboBox* m_zoomSelectBox; ACTION_TOOLBAR* m_mainToolBar; ACTION_TOOLBAR* m_auxiliaryToolBar; // Additional tools under main toolbar diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 80d38c889d..95ce62fd09 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -71,8 +71,8 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, PL_EDITOR_FRAME::OnFileHistory ) EVT_MENU( ID_FILE_LIST_CLEAR, PL_EDITOR_FRAME::OnClearFileHistory ) - EVT_CHOICE( ID_SELECT_COORDINATE_ORIGIN, PL_EDITOR_FRAME::OnSelectCoordOriginCorner ) - EVT_CHOICE( ID_SELECT_PAGE_NUMBER, PL_EDITOR_FRAME::OnSelectPage ) + EVT_COMBOBOX( ID_SELECT_COORDINATE_ORIGIN, PL_EDITOR_FRAME::OnSelectCoordOriginCorner ) + EVT_COMBOBOX( ID_SELECT_PAGE_NUMBER, PL_EDITOR_FRAME::OnSelectPage ) // Drop files event EVT_DROP_FILES( PL_EDITOR_FRAME::OnDropFiles ) @@ -968,4 +968,4 @@ void PL_EDITOR_FRAME::UpdateMsgPanelInfo() SetMsgPanel( msgItems ); } -#endif \ No newline at end of file +#endif diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.cpp index 26cc2b0f0e..83b27540b8 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -113,13 +113,11 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE m_staticTextLayer->Wrap( -1 ); fgSizerTrackViaPopups->Add( m_staticTextLayer, 0, wxALL, 5 ); - wxArrayString m_trackWidthSelectBoxChoices; - m_trackWidthSelectBox = new wxChoice( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_trackWidthSelectBoxChoices, 0 ); + m_trackWidthSelectBox = new wxComboBox( sbAction->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ); m_trackWidthSelectBox->SetSelection( 0 ); fgSizerTrackViaPopups->Add( m_trackWidthSelectBox, 4, wxEXPAND|wxRIGHT, 5 ); - wxArrayString m_viaSizesSelectBoxChoices; - m_viaSizesSelectBox = new wxChoice( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_viaSizesSelectBoxChoices, 0 ); + m_viaSizesSelectBox = new wxComboBox( sbAction->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ); m_viaSizesSelectBox->SetSelection( 0 ); fgSizerTrackViaPopups->Add( m_viaSizesSelectBox, 5, wxEXPAND|wxLEFT|wxRIGHT, 5 ); @@ -189,7 +187,6 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE // Connect Events m_netclassFilter->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnNetclassFilterSelect ), NULL, this ); m_layerFilter->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnLayerFilterSelect ), NULL, this ); - m_trackWidthSelectBox->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::onSpecifiedValuesUpdateUi ), NULL, this ); m_viaSizesSelectBox->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::onSpecifiedValuesUpdateUi ), NULL, this ); m_netclassGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSizeNetclassGrid ), NULL, this ); } @@ -199,7 +196,6 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BAS // Disconnect Events m_netclassFilter->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnNetclassFilterSelect ), NULL, this ); m_layerFilter->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnLayerFilterSelect ), NULL, this ); - m_trackWidthSelectBox->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::onSpecifiedValuesUpdateUi ), NULL, this ); m_viaSizesSelectBox->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::onSpecifiedValuesUpdateUi ), NULL, this ); m_netclassGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSizeNetclassGrid ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp index abbb81e7f5..89530fac92 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_global_edit_tracks_and_vias_base 1000 none + 1 dialog_global_edit_tracks_and_vias_base @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -34,6 +36,7 @@ 1 + 0 1 impl_virtual @@ -50,6 +53,7 @@ DIALOG_SHIM; dialog_shim.h Set Track and Via Properties + 0 @@ -105,6 +109,7 @@ Dock 0 Left + 0 1 1 @@ -169,6 +174,7 @@ Dock 0 Left + 0 1 1 @@ -263,6 +269,7 @@ Dock 0 Left + 0 1 1 @@ -329,6 +336,7 @@ Dock 0 Left + 0 1 1 @@ -389,6 +397,7 @@ Dock 0 Left + 0 1 1 @@ -453,6 +462,7 @@ Dock 0 Left + 0 1 1 @@ -538,6 +548,7 @@ Dock 0 Left + 0 1 1 @@ -602,6 +613,7 @@ Dock 0 Left + 0 1 1 @@ -668,6 +680,7 @@ Dock 0 Left + 0 1 1 @@ -749,6 +762,7 @@ Dock 0 Left + 0 1 1 @@ -829,6 +843,7 @@ Dock 0 Left + 0 1 1 @@ -890,6 +905,7 @@ Dock 0 Left + 0 1 1 @@ -951,6 +967,7 @@ Dock 0 Left + 0 1 1 @@ -991,7 +1008,7 @@ 5 wxEXPAND|wxRIGHT 4 - + 1 1 1 @@ -1013,6 +1030,7 @@ Dock 0 Left + 0 1 1 @@ -1038,25 +1056,25 @@ 0 1 - - ; forward_declare + wxCB_READONLY + 0 wxFILTER_NONE wxDefaultValidator + - onSpecifiedValuesUpdateUi 5 wxEXPAND|wxLEFT|wxRIGHT 5 - + 1 1 1 @@ -1078,6 +1096,7 @@ Dock 0 Left + 0 1 1 @@ -1103,14 +1122,15 @@ 0 1 - - ; forward_declare + wxCB_READONLY + 0 wxFILTER_NONE wxDefaultValidator + @@ -1143,6 +1163,7 @@ Dock 0 Left + 0 1 1 @@ -1209,6 +1230,7 @@ Dock 0 Left + 0 1 1 @@ -1286,6 +1308,7 @@ Dock 0 Left + 0 0 0 0 diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.h b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.h index 993688b3ef..8e476c9ce2 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.h +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -26,6 +26,7 @@ class PCB_LAYER_BOX_SELECTOR; #include #include #include +#include #include #include #include @@ -56,8 +57,8 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public DIALOG_SHIM wxStaticText* m_staticTextTrackWidth; wxStaticText* m_staticTextViaSize; wxStaticText* m_staticTextLayer; - wxChoice* m_trackWidthSelectBox; - wxChoice* m_viaSizesSelectBox; + wxComboBox* m_trackWidthSelectBox; + wxComboBox* m_viaSizesSelectBox; PCB_LAYER_BOX_SELECTOR* m_layerBox; wxRadioButton* m_setToNetclassValues; wxGrid* m_netclassGrid; @@ -65,7 +66,7 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public DIALOG_SHIM wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; - // Virtual event handlers, overide them in your derived class + // Virtual event handlers, override them in your derived class virtual void OnNetclassFilterSelect( wxCommandEvent& event ) { event.Skip(); } virtual void OnLayerFilterSelect( wxCommandEvent& event ) { event.Skip(); } virtual void onSpecifiedValuesUpdateUi( wxUpdateUIEvent& event ) { event.Skip(); } @@ -75,6 +76,7 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public DIALOG_SHIM public: DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Set Track and Via Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE(); }; diff --git a/pcbnew/edit_track_width.cpp b/pcbnew/edit_track_width.cpp index 281a0ef3fc..285af981b4 100644 --- a/pcbnew/edit_track_width.cpp +++ b/pcbnew/edit_track_width.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include void PCB_EDIT_FRAME::SetTrackSegmentWidth( PCB_TRACK* aTrackItem, PICKED_ITEMS_LIST* aItemsListPicker, diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 21d6bb2e06..a8b5ba9912 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -81,8 +81,8 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME ) EVT_SIZE( FOOTPRINT_EDIT_FRAME::OnSize ) - EVT_CHOICE( ID_ON_ZOOM_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectZoom ) - EVT_CHOICE( ID_ON_GRID_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectGrid ) + EVT_COMBOBOX( ID_ON_ZOOM_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectZoom ) + EVT_COMBOBOX( ID_ON_GRID_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectGrid ) EVT_TOOL( ID_FPEDIT_SAVE_PNG, FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng ) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 549b547aed..a4ef2695a4 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -85,8 +85,8 @@ BEGIN_EVENT_TABLE( FOOTPRINT_VIEWER_FRAME, PCB_BASE_FRAME ) EVT_TOOL( ID_MODVIEW_NEXT, FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList ) EVT_TOOL( ID_MODVIEW_PREVIOUS, FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList ) EVT_TOOL( ID_ADD_FOOTPRINT_TO_BOARD, FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB ) - EVT_CHOICE( ID_ON_ZOOM_SELECT, FOOTPRINT_VIEWER_FRAME::OnSelectZoom ) - EVT_CHOICE( ID_ON_GRID_SELECT, FOOTPRINT_VIEWER_FRAME::OnSelectGrid ) + EVT_COMBOBOX( ID_ON_ZOOM_SELECT, FOOTPRINT_VIEWER_FRAME::OnSelectZoom ) + EVT_COMBOBOX( ID_ON_GRID_SELECT, FOOTPRINT_VIEWER_FRAME::OnSelectGrid ) EVT_MENU( ID_GRID_SETTINGS, FOOTPRINT_VIEWER_FRAME::OnGridSettings ) EVT_UPDATE_UI( ID_ADD_FOOTPRINT_TO_BOARD, FOOTPRINT_VIEWER_FRAME::OnUpdateFootprintButton ) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 79c602df75..b4ffba1800 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -119,8 +119,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_SOCKET( ID_EDA_SOCKET_EVENT, PCB_EDIT_FRAME::OnSockRequest ) - EVT_CHOICE( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom ) - EVT_CHOICE( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid ) + EVT_COMBOBOX( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom ) + EVT_COMBOBOX( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid ) EVT_SIZE( PCB_EDIT_FRAME::OnSize ) @@ -158,8 +158,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_TOOL( ID_GEN_PLOT_SVG, PCB_EDIT_FRAME::ExportSVG ) EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions ) - EVT_CHOICE( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) - EVT_CHOICE( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) + EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) + EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) // Tracks and vias sizes general options EVT_MENU_RANGE( ID_POPUP_PCB_SELECT_WIDTH_START_RANGE, ID_POPUP_PCB_SELECT_WIDTH_END_RANGE, diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index f594edde71..af838614c2 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -166,8 +166,8 @@ public: void RunEeschema(); - void UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, bool aEdit = true ); - void UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool aEdit = true ); + void UpdateTrackWidthSelectBox( wxComboBox* aTrackWidthSelectBox, bool aEdit = true ); + void UpdateViaSizeSelectBox( wxComboBox* aViaSizeSelectBox, bool aEdit = true ); /** * Return the angle used for rotate operations. @@ -808,8 +808,8 @@ protected: public: PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer - wxChoice* m_SelTrackWidthBox; // a choice box to display and select current track width - wxChoice* m_SelViaSizeBox; // a choice box to display and select current via diameter + wxComboBox* m_SelTrackWidthBox; // a choice box to display and select current track width + wxComboBox* m_SelViaSizeBox; // a choice box to display and select current via diameter bool m_show_layer_manager_tools; bool m_show_search; diff --git a/pcbnew/toolbars_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp index a49bd4ff2b..e29b3ade0c 100644 --- a/pcbnew/toolbars_footprint_editor.cpp +++ b/pcbnew/toolbars_footprint_editor.cpp @@ -20,6 +20,10 @@ * with this program. If not, see . */ +#include +#include +#include + #include #include #include @@ -29,8 +33,6 @@ #include #include #include -#include -#include #include void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() @@ -99,8 +101,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() // Grid selection choice box. if( m_gridSelectBox == nullptr ) - m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, - wxDefaultPosition, wxDefaultSize, 0, nullptr ); + m_gridSelectBox = new wxComboBox( m_mainToolBar, ID_ON_GRID_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateGridSelectBox(); m_mainToolBar->AddControl( m_gridSelectBox ); @@ -109,8 +111,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() // Zoom selection choice box. if( m_zoomSelectBox == nullptr ) - m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT, - wxDefaultPosition, wxDefaultSize, 0, nullptr ); + m_zoomSelectBox = new wxComboBox( m_mainToolBar, ID_ON_ZOOM_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateZoomSelectBox(); m_mainToolBar->AddControl( m_zoomSelectBox ); diff --git a/pcbnew/toolbars_footprint_viewer.cpp b/pcbnew/toolbars_footprint_viewer.cpp index 9d8ffd5fa4..3b53af9888 100644 --- a/pcbnew/toolbars_footprint_viewer.cpp +++ b/pcbnew/toolbars_footprint_viewer.cpp @@ -20,6 +20,7 @@ * with this program. If not, see . */ +#include #include #include @@ -32,7 +33,6 @@ #include "footprint_viewer_frame.h" #include "pcbnew_id.h" #include -#include void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar() @@ -82,8 +82,8 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar() // Grid selection choice box. if( m_gridSelectBox == nullptr ) { - m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, wxDefaultPosition, - wxDefaultSize, 0, nullptr ); + m_gridSelectBox = new wxComboBox( m_mainToolBar, ID_ON_GRID_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); } UpdateGridSelectBox(); @@ -94,8 +94,8 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar() // Zoom selection choice box. if( m_zoomSelectBox == nullptr ) { - m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT, wxDefaultPosition, - wxDefaultSize, 0, nullptr ); + m_zoomSelectBox = new wxComboBox( m_mainToolBar, ID_ON_ZOOM_SELECT, wxEmptyString, wxDefaultPosition, + wxDefaultSize, 0, nullptr, wxCB_READONLY ); } UpdateZoomSelectBox(); diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 7435727dc1..993ab8f0d3 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -549,8 +549,8 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() // Creates box to display and choose tracks widths: if( m_SelTrackWidthBox == nullptr ) - m_SelTrackWidthBox = new wxChoice( m_auxiliaryToolBar, ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, - wxDefaultPosition, wxDefaultSize, 0, nullptr ); + m_SelTrackWidthBox = new wxComboBox( m_auxiliaryToolBar, ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateTrackWidthSelectBox( m_SelTrackWidthBox ); m_auxiliaryToolBar->AddControl( m_SelTrackWidthBox ); @@ -570,8 +570,8 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() // Creates box to display and choose vias diameters: if( m_SelViaSizeBox == nullptr ) - m_SelViaSizeBox = new wxChoice( m_auxiliaryToolBar, ID_AUX_TOOLBAR_PCB_VIA_SIZE, - wxDefaultPosition, wxDefaultSize, 0, nullptr ); + m_SelViaSizeBox = new wxComboBox( m_auxiliaryToolBar, ID_AUX_TOOLBAR_PCB_VIA_SIZE, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateViaSizeSelectBox( m_SelViaSizeBox ); m_auxiliaryToolBar->AddControl( m_SelViaSizeBox ); @@ -580,8 +580,8 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() m_auxiliaryToolBar->AddScaledSeparator( this ); if( m_gridSelectBox == nullptr ) - m_gridSelectBox = new wxChoice( m_auxiliaryToolBar, ID_ON_GRID_SELECT, - wxDefaultPosition, wxDefaultSize, 0, nullptr ); + m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar, ID_ON_GRID_SELECT, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateGridSelectBox(); @@ -591,8 +591,8 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() m_auxiliaryToolBar->AddScaledSeparator( this ); if( m_zoomSelectBox == nullptr ) - m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar, ID_ON_ZOOM_SELECT, - wxDefaultPosition, wxDefaultSize, 0, nullptr ); + m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar, ID_ON_ZOOM_SELECT, wxEmptyString, + wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY ); UpdateZoomSelectBox(); m_auxiliaryToolBar->AddControl( m_zoomSelectBox ); @@ -653,7 +653,7 @@ static wxString ComboBoxUnits( EDA_UNITS aUnits, double aValue, bool aIncludeLab } -void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, bool aEdit ) +void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxComboBox* aTrackWidthSelectBox, bool aEdit ) { if( aTrackWidthSelectBox == nullptr ) return; @@ -692,7 +692,7 @@ void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, } -void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool aEdit ) +void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxComboBox* aViaSizeSelectBox, bool aEdit ) { if( aViaSizeSelectBox == nullptr ) return;