Move via/track/grid selection widget to wxComboBox

The wxComboBox drops nicely from the top of the screen, showing the full
element list, opposed to the choice widget that centers the selection
and places the list off the top of the screen if there are many
elements.  This was broke for MacOS until wx3.2

Fixes https://gitlab.com/kicad/code/kicad/issues/1866
This commit is contained in:
Seth Hillbrand 2023-03-09 11:44:02 -08:00
parent bc0d59801a
commit d2cc252fc7
17 changed files with 107 additions and 80 deletions

View File

@ -23,6 +23,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/combobox.h>
#include <wx/dirdlg.h>
#include <wx/event.h>
#include <wx/fdrepdlg.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/snglinst.h>
#include <wx/socket.h>
#include <base_screen.h>
#include <bitmaps.h>
#include <confirm.h>
@ -56,18 +65,9 @@
#include <view/view.h>
#include <drawing_sheet/ds_draw_item.h>
#include <widgets/msgpanel.h>
#include <wx/event.h>
#include <wx/snglinst.h>
#include <dialogs/dialog_grid_settings.h>
#include <widgets/ui_common.h>
#include <widgets/search_pane.h>
#include <wx/dirdlg.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/socket.h>
#include <wx/snglinst.h>
#include <wx/fdrepdlg.h>
#define FR_HISTORY_LIST_CNT 10 ///< Maximum size of the find/replace history stacks.

View File

@ -23,6 +23,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/combobox.h>
#include <wx/debug.h>
#include <bitmaps.h>
#include <board.h>
#include <footprint.h>
@ -55,15 +58,13 @@
#include <tools/pcb_viewer_tools.h> // shared tools with other Pcbnew frames
#include <tools/cvpcb_fpviewer_selection_tool.h>
#include <widgets/wx_infobar.h>
#include <wx/choice.h>
#include <wx/debug.h>
#include <cvpcb_id.h>
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 );

View File

@ -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 )

View File

@ -21,6 +21,7 @@
#include <wx/wupdlock.h>
#include <wx/stattext.h>
#include <wx/combobox.h>
#include <gerbview.h>
#include <gerbview_frame.h>
@ -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 );

View File

@ -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

View File

@ -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
#endif

View File

@ -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 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">dialog_global_edit_tracks_and_vias_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_global_edit_tracks_and_vias_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -34,6 +36,7 @@
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
@ -50,6 +53,7 @@
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Set Track and Via Properties</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -105,6 +109,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -169,6 +174,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -263,6 +269,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -329,6 +336,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -389,6 +397,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -453,6 +462,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -538,6 +548,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -602,6 +613,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -668,6 +680,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -749,6 +762,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -829,6 +843,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -890,6 +905,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -951,6 +967,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -991,7 +1008,7 @@
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT</property>
<property name="proportion">4</property>
<object class="wxChoice" expanded="1">
<object class="wxComboBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1013,6 +1030,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1038,25 +1056,25 @@
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="style">wxCB_READONLY</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnUpdateUI">onSpecifiedValuesUpdateUi</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">5</property>
<object class="wxChoice" expanded="1">
<object class="wxComboBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1078,6 +1096,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1103,14 +1122,15 @@
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="style">wxCB_READONLY</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -1143,6 +1163,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1209,6 +1230,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1286,6 +1308,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">0</property>
<property name="drag_grid_size">0</property>

View File

@ -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 <wx/bmpcbox.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/combobox.h>
#include <wx/grid.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -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();
};

View File

@ -28,7 +28,7 @@
#include <pcb_track.h>
#include <tools/pcb_actions.h>
#include <tool/tool_manager.h>
#include <wx/choice.h>
#include <wx/combobox.h>
void PCB_EDIT_FRAME::SetTrackSegmentWidth( PCB_TRACK* aTrackItem,
PICKED_ITEMS_LIST* aItemsListPicker,

View File

@ -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 )

View File

@ -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 )

View File

@ -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,

View File

@ -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;

View File

@ -20,6 +20,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/choice.h>
#include <wx/combobox.h>
#include <wx/wupdlock.h>
#include <tool/actions.h>
#include <footprint_edit_frame.h>
#include <pcbnew_id.h>
@ -29,8 +33,6 @@
#include <tools/pcb_actions.h>
#include <tools/pcb_selection_tool.h>
#include <pcb_layer_box_selector.h>
#include <wx/choice.h>
#include <wx/wupdlock.h>
#include <advanced_config.h>
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 );

View File

@ -20,6 +20,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/combobox.h>
#include <advanced_config.h>
#include <macros.h>
@ -32,7 +33,6 @@
#include "footprint_viewer_frame.h"
#include "pcbnew_id.h"
#include <widgets/wx_menubar.h>
#include <wx/choice.h>
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();

View File

@ -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;