Change top selection drop-down to combobox

wxChoice centers the selection on GTK.  So when switching from a
mid-list item to an item at the top, the list is always cut off for
choice lists located on the top toolbar.  Using a combobox provides a
drop-down that allows easier access to all elements in the box.

Fixes: lp:1808569
* https://bugs.launchpad.net/kicad/+bug/1808569
This commit is contained in:
Seth Hillbrand 2018-12-18 14:46:03 -08:00
parent 8de12094d8
commit 7d06651a10
18 changed files with 1282 additions and 1811 deletions

View File

@ -518,7 +518,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
int* clientData;
int eventId = ID_POPUP_GRID_LEVEL_100;
if( event.GetEventType() == wxEVT_CHOICE )
if( event.GetEventType() == wxEVT_COMBOBOX )
{
if( m_gridSelectBox == NULL ) // Should not happen
return;

View File

@ -519,7 +519,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
int* clientData;
int eventId = ID_POPUP_GRID_LEVEL_100;
if( event.GetEventType() == wxEVT_CHOICE )
if( event.GetEventType() == wxEVT_COMBOBOX )
{
if( m_gridSelectBox == NULL ) // Should not happen
return;

View File

@ -68,8 +68,8 @@ BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay )
EVT_TOOL( ID_CVPCB_SHOW3D_FRAME, DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame )
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_UPDATE_UI( ID_NO_TOOL_SELECTED, DISPLAY_FOOTPRINTS_FRAME::OnUIToolSelection )
EVT_UPDATE_UI( ID_TB_MEASUREMENT_TOOL, DISPLAY_FOOTPRINTS_FRAME::OnUIToolSelection )
@ -305,16 +305,16 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
KiScaledSeparator( m_mainToolBar, this );
// Grid selection choice box.
m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL );
m_gridSelectBox = new wxComboBox( m_mainToolBar, ID_ON_GRID_SELECT, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
UpdateGridSelectBox();
m_mainToolBar->AddControl( m_gridSelectBox );
KiScaledSeparator( m_mainToolBar, this );
// Zoom selection choice box.
m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL );
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

@ -138,12 +138,12 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, GERBVIEW_FRAME::OnSelectOptionToolbar )
// Auxiliary horizontal toolbar
EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE,
EVT_COMBOBOX( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
EVT_COMBOBOX( ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
EVT_COMBOBOX( 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 )
// Right click context menu
EVT_MENU( ID_HIGHLIGHT_CMP_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )

View File

@ -170,9 +170,9 @@ protected:
wxString m_lastFileName;
public:
wxChoice* m_SelComponentBox; // a choice box to display and highlight component graphic items
wxChoice* m_SelNetnameBox; // a choice box to display and highlight netlist graphic items
wxChoice* m_SelAperAttributesBox; // a choice box to display aperture attributes and highlight items
wxComboBox* m_SelComponentBox; // a choice box to display and highlight component graphic items
wxComboBox* m_SelNetnameBox; // a choice box to display and highlight netlist graphic items
wxComboBox* m_SelAperAttributesBox; // a choice box to display aperture attributes and highlight items
GBR_LAYER_BOX_SELECTOR* m_SelLayerBox; // The combobox to select the current active graphic layer
// (which is drawn on top on the other layers
DCODE_SELECTION_BOX* m_DCodeSelector; // a list box to select the dcode Id to highlight.

View File

@ -119,8 +119,9 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar()
// Creates box to display and choose components:
if( !m_SelComponentBox )
{
m_SelComponentBox = new wxChoice( m_auxiliaryToolBar,
ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE );
m_SelComponentBox = new wxComboBox( m_auxiliaryToolBar,
ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
m_SelComponentBox->SetToolTip( _("Highlight items belonging to this component") );
text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Cmp: ") );
m_auxiliaryToolBar->AddControl( text );
@ -131,8 +132,9 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar()
// Creates choice box to display net names and highlight selected:
if( !m_SelNetnameBox )
{
m_SelNetnameBox = new wxChoice( m_auxiliaryToolBar,
ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE );
m_SelNetnameBox = new wxComboBox( m_auxiliaryToolBar,
ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
m_SelNetnameBox->SetToolTip( _("Highlight items belonging to this net") );
text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Net:" ) );
m_auxiliaryToolBar->AddControl( text );
@ -143,8 +145,9 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar()
// Creates choice box to display aperture attributes and highlight selected:
if( !m_SelAperAttributesBox )
{
m_SelAperAttributesBox = new wxChoice( m_auxiliaryToolBar,
ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE );
m_SelAperAttributesBox = new wxComboBox( m_auxiliaryToolBar,
ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
m_SelAperAttributesBox->SetToolTip( _("Highlight items with this aperture attribute") );
text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Attr:" ) );
m_auxiliaryToolBar->AddControl( text );
@ -165,16 +168,16 @@ void GERBVIEW_FRAME::ReCreateAuxiliaryToolbar()
if( !m_gridSelectBox )
{
KiScaledSeparator( m_auxiliaryToolBar, this );
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->AddControl( m_gridSelectBox );
}
if( !m_zoomSelectBox )
{
KiScaledSeparator( m_auxiliaryToolBar, this );
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->AddControl( m_zoomSelectBox );
}

View File

@ -145,7 +145,7 @@ protected:
/// Key to control whether first run dialog is shown on startup
long m_firstRunDialogSetting;
wxChoice* m_gridSelectBox;
wxComboBox* m_gridSelectBox;
wxChoice* m_zoomSelectBox;
/// Auxiliary tool bar typically shown below the main tool bar at the top of the

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 2 2018)
// C++ code generated with wxFormBuilder (version Nov 23 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -14,117 +14,113 @@
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbScope;
sbScope = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Scope") ), wxVERTICAL );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer1->AddGrowableCol( 0 );
fgSizer1->AddGrowableCol( 1 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_tracks = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_tracks->SetValue(true);
m_tracks->SetValue(true);
fgSizer1->Add( m_tracks, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_vias = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_vias->SetValue(true);
m_vias->SetValue(true);
fgSizer1->Add( m_vias, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbScope->Add( fgSizer1, 0, wxEXPAND, 5 );
bMainSizer->Add( sbScope, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbFilters;
sbFilters = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Filters") ), wxVERTICAL );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 0, 3, 3, 0 );
fgSizer3->AddGrowableCol( 1 );
fgSizer3->AddGrowableCol( 2 );
fgSizer3->SetFlexibleDirection( wxHORIZONTAL );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_netFilterOpt = new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY, _("Filter items by net:"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_netFilterOpt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_netFilter = new NET_SELECTOR( sbFilters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_netFilter = new NET_SELECTOR( sbFilters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_netFilter, 1, wxEXPAND|wxRIGHT, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 100 );
m_netclassFilterOpt = new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY, _("Filter items by net class:"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_netclassFilterOpt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
wxArrayString m_netclassFilterChoices;
m_netclassFilter = new wxChoice( sbFilters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_netclassFilterChoices, 0 );
m_netclassFilter->SetSelection( 0 );
fgSizer3->Add( m_netclassFilter, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
m_layerFilterOpt = new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY, _("Filter items by layer:"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_layerFilterOpt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_layerFilter = new PCB_LAYER_BOX_SELECTOR( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_layerFilter = new PCB_LAYER_BOX_SELECTOR( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fgSizer3->Add( m_layerFilter, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
sbFilters->Add( fgSizer3, 1, wxEXPAND, 5 );
bMainSizer->Add( sbFilters, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbAction;
sbAction = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Action") ), wxVERTICAL );
m_setToSpecifiedValues = new wxRadioButton( sbAction->GetStaticBox(), ID_SPECIFIED_NET_TO_SPECIFIED_VALUES, _("Set to specified values:"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_setToSpecifiedValues->SetValue( true );
m_setToSpecifiedValues->SetValue( true );
sbAction->Add( m_setToSpecifiedValues, 0, wxTOP|wxBOTTOM, 5 );
wxBoxSizer* bSizerTrackViaPopups;
bSizerTrackViaPopups = new wxBoxSizer( wxHORIZONTAL );
wxArrayString m_trackWidthSelectBoxChoices;
m_trackWidthSelectBox = new wxChoice( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_trackWidthSelectBoxChoices, 0 );
m_trackWidthSelectBox->SetSelection( 0 );
m_trackWidthSelectBox = new wxComboBox( sbAction->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
bSizerTrackViaPopups->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->SetSelection( 0 );
bSizerTrackViaPopups->Add( m_viaSizesSelectBox, 5, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_layerBox = new PCB_LAYER_BOX_SELECTOR( sbAction->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_viaSizesSelectBox = new wxComboBox( sbAction->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
bSizerTrackViaPopups->Add( m_viaSizesSelectBox, 5, wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_layerBox = new PCB_LAYER_BOX_SELECTOR( sbAction->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizerTrackViaPopups->Add( m_layerBox, 0, wxRIGHT|wxLEFT, 3 );
sbAction->Add( bSizerTrackViaPopups, 0, wxEXPAND|wxBOTTOM|wxLEFT, 15 );
m_setToNetclassValues = new wxRadioButton( sbAction->GetStaticBox(), ID_SPECIFIED_NET_TO_NETCLASS_VALUES, _("Set to net class values:"), wxDefaultPosition, wxDefaultSize, 0 );
sbAction->Add( m_setToNetclassValues, 0, wxTOP|wxBOTTOM, 5 );
m_netclassGrid = new wxGrid( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_DEFAULT|wxVSCROLL );
// Grid
m_netclassGrid->CreateGrid( 1, 6 );
m_netclassGrid->EnableEditing( false );
m_netclassGrid->EnableGridLines( true );
m_netclassGrid->EnableDragGridSize( false );
m_netclassGrid->SetMargins( 0, 0 );
// Columns
m_netclassGrid->SetColSize( 0, 95 );
m_netclassGrid->SetColSize( 1, 95 );
@ -135,41 +131,41 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
m_netclassGrid->EnableDragColMove( false );
m_netclassGrid->EnableDragColSize( false );
m_netclassGrid->SetColLabelSize( 0 );
m_netclassGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_netclassGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
m_netclassGrid->EnableDragRowSize( false );
m_netclassGrid->SetRowLabelSize( 0 );
m_netclassGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_netclassGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Label Appearance
// Cell Defaults
m_netclassGrid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_netclassGrid->SetDefaultCellFont( wxFont( 11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
sbAction->Add( m_netclassGrid, 0, wxEXPAND|wxLEFT, 15 );
sbAction->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
bMainSizer->Add( sbAction, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bMainSizer->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnUpdateUI ) );
m_netclassFilter->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnNetclassFilterSelect ), NULL, this );
@ -184,5 +180,5 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BAS
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_netclassGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnSizeNetclassGrid ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 2 2018)
// C++ code generated with wxFormBuilder (version Nov 23 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_H__
#define __DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@ -26,6 +25,7 @@ class PCB_LAYER_BOX_SELECTOR;
#include <wx/choice.h>
#include <wx/bmpcbox.h>
#include <wx/radiobut.h>
#include <wx/combobox.h>
#include <wx/grid.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -41,38 +41,37 @@ class PCB_LAYER_BOX_SELECTOR;
class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public DIALOG_SHIM
{
private:
protected:
wxCheckBox* m_tracks;
wxCheckBox* m_vias;
wxCheckBox* m_netFilterOpt;
NET_SELECTOR* m_netFilter;
NET_SELECTOR* m_netFilter;
wxCheckBox* m_netclassFilterOpt;
wxChoice* m_netclassFilter;
wxCheckBox* m_layerFilterOpt;
PCB_LAYER_BOX_SELECTOR* m_layerFilter;
wxRadioButton* m_setToSpecifiedValues;
wxChoice* m_trackWidthSelectBox;
wxChoice* m_viaSizesSelectBox;
wxComboBox* m_trackWidthSelectBox;
wxComboBox* m_viaSizesSelectBox;
PCB_LAYER_BOX_SELECTOR* m_layerBox;
wxRadioButton* m_setToNetclassValues;
wxGrid* m_netclassGrid;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnNetclassFilterSelect( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLayerFilterSelect( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSizeNetclassGrid( wxSizeEvent& event ) { event.Skip(); }
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( 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();
};
#endif //__DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_H__

View File

@ -92,8 +92,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_MODEDIT_SAVE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SAVE_AS, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )

View File

@ -94,8 +94,8 @@ BEGIN_EVENT_TABLE( FOOTPRINT_VIEWER_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_MODVIEW_PREVIOUS, FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList )
EVT_TOOL( ID_MODVIEW_EXPORT_TO_BOARD, FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint )
EVT_TOOL( ID_MODVIEW_SHOW_3D_VIEW, FOOTPRINT_VIEWER_FRAME::Show3D_Frame )
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_UPDATE_UI( ID_ON_GRID_SELECT, FOOTPRINT_VIEWER_FRAME::OnUpdateSelectGrid )
EVT_UPDATE_UI( ID_ON_ZOOM_SELECT, FOOTPRINT_VIEWER_FRAME::OnUpdateSelectZoom )

View File

@ -1075,7 +1075,7 @@ void PCB_BASE_FRAME::SetFastGrid1()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_CHOICE );
wxCommandEvent cmd( wxEVT_COMBOBOX );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}
@ -1094,7 +1094,7 @@ void PCB_BASE_FRAME::SetFastGrid2()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_CHOICE );
wxCommandEvent cmd( wxEVT_COMBOBOX );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}
@ -1108,7 +1108,7 @@ void PCB_BASE_FRAME::SetNextGrid()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_CHOICE );
wxCommandEvent cmd( wxEVT_COMBOBOX );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}
@ -1123,7 +1123,7 @@ void PCB_BASE_FRAME::SetPrevGrid()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_CHOICE );
wxCommandEvent cmd( wxEVT_COMBOBOX );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}

View File

@ -96,8 +96,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, PCB_EDIT_FRAME::OnSockRequestServer )
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_CLOSE( PCB_EDIT_FRAME::OnCloseWindow )
EVT_SIZE( PCB_EDIT_FRAME::OnSize )
@ -197,8 +197,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions )
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 )
#if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)

View File

@ -262,8 +262,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_microwave_tools;
bool m_show_layer_manager_tools;
@ -353,8 +353,8 @@ public:
void OnUpdatePCBFromSch( wxCommandEvent& event );
void OnRunEeschema( wxCommandEvent& event );
void UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox );
void UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox );
void UpdateTrackWidthSelectBox( wxComboBox* aTrackWidthSelectBox );
void UpdateViaSizeSelectBox( wxComboBox* aViaSizeSelectBox );
void GetKicadAbout( wxCommandEvent& event );

View File

@ -115,16 +115,16 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
KiScaledSeparator( m_mainToolBar, this );
// Grid selection choice box.
m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL );
m_gridSelectBox = new wxComboBox( m_mainToolBar, ID_ON_GRID_SELECT, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
UpdateGridSelectBox();
m_mainToolBar->AddControl( m_gridSelectBox );
KiScaledSeparator( m_mainToolBar, this );
// Zoom selection choice box.
m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL );
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

@ -102,16 +102,16 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar()
KiScaledSeparator( m_mainToolBar, this );
// Grid selection choice box.
m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL );
m_gridSelectBox = new wxComboBox( m_mainToolBar, ID_ON_GRID_SELECT, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
UpdateGridSelectBox();
m_mainToolBar->AddControl( m_gridSelectBox );
KiScaledSeparator( m_mainToolBar, this );
// Zoom selection choice box.
m_zoomSelectBox = new wxChoice( m_mainToolBar, ID_ON_ZOOM_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL );
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

@ -583,18 +583,16 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
/* Set up toolbar items */
// Creates box to display and choose tracks widths:
m_SelTrackWidthBox = new wxChoice( m_auxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
wxDefaultPosition, wxDefaultSize,
0, NULL );
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 );
// Creates box to display and choose vias diameters:
m_SelViaSizeBox = new wxChoice( m_auxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
wxDefaultPosition, wxDefaultSize,
0, NULL );
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 );
KiScaledSeparator( m_auxiliaryToolBar, this );
@ -609,20 +607,17 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
// Add the box to display and select the current grid size:
KiScaledSeparator( m_auxiliaryToolBar, this );
m_gridSelectBox = new wxChoice( m_auxiliaryToolBar,
ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize,
0, NULL );
m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar, ID_ON_GRID_SELECT, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
UpdateGridSelectBox();
m_auxiliaryToolBar->AddControl( m_gridSelectBox );
// Add the box to display and select the current Zoom
KiScaledSeparator( m_auxiliaryToolBar, this );
m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar,
ID_ON_ZOOM_SELECT,
wxDefaultPosition, wxDefaultSize,
0, NULL );
m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar,
ID_ON_ZOOM_SELECT, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY );
updateZoomSelectBox();
m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
@ -631,7 +626,7 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
}
void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox )
void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxComboBox* aTrackWidthSelectBox )
{
if( aTrackWidthSelectBox == NULL )
return;
@ -672,7 +667,7 @@ void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox )
}
void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox )
void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxComboBox* aViaSizeSelectBox )
{
if( aViaSizeSelectBox == NULL )
return;