Replace wxComboBoxes by wxChoice in auxiliary horizontal toolbar, to try to avoid issues on OSX.

This commit is contained in:
jean-pierre charras 2015-07-02 11:50:38 +02:00
parent 5c7f073a28
commit 1311f81448
8 changed files with 27 additions and 36 deletions

View File

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

View File

@ -97,10 +97,10 @@ protected:
bool m_showBorderAndTitleBlock;
/// Choice box to choose the grid size.
wxComboBox* m_gridSelectBox;
wxChoice* m_gridSelectBox;
/// Choice box to choose the zoom value.
wxComboBox* m_zoomSelectBox;
wxChoice* m_zoomSelectBox;
/// The tool bar that contains the buttons for quick access to the application draw
/// tools. It typically is located on the right side of the main window.

View File

@ -217,8 +217,8 @@ protected:
public:
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer
wxComboBox* m_SelTrackWidthBox; // a combo box to display and select current track width
wxComboBox* m_SelViaSizeBox; // a combo box to display and select current via diameter
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
bool m_show_microwave_tools;
bool m_show_layer_manager_tools;

View File

@ -858,7 +858,7 @@ void PCB_BASE_FRAME::SetFastGrid1()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_COMMAND_COMBOBOX_SELECTED );
wxCommandEvent cmd( wxEVT_CHOICE );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}
@ -877,7 +877,7 @@ void PCB_BASE_FRAME::SetFastGrid2()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_COMMAND_COMBOBOX_SELECTED );
wxCommandEvent cmd( wxEVT_CHOICE );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}
@ -891,7 +891,7 @@ void PCB_BASE_FRAME::SetNextGrid()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_COMMAND_COMBOBOX_SELECTED );
wxCommandEvent cmd( wxEVT_CHOICE );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}
@ -906,7 +906,7 @@ void PCB_BASE_FRAME::SetPrevGrid()
if( m_gridSelectBox )
{
wxCommandEvent cmd( wxEVT_COMMAND_COMBOBOX_SELECTED );
wxCommandEvent cmd( wxEVT_CHOICE );
cmd.SetEventObject( this );
OnSelectGrid( cmd );
}

View File

@ -77,8 +77,8 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
EVT_SIZE( FOOTPRINT_EDIT_FRAME::OnSize )
EVT_COMBOBOX( ID_ON_ZOOM_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectZoom )
EVT_COMBOBOX( ID_ON_GRID_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectGrid )
EVT_CHOICE( ID_ON_ZOOM_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectZoom )
EVT_CHOICE( ID_ON_GRID_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectGrid )
EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )

View File

@ -92,8 +92,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_COMBOBOX( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom )
EVT_COMBOBOX( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid )
EVT_CHOICE( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom )
EVT_CHOICE( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid )
EVT_CLOSE( PCB_EDIT_FRAME::OnCloseWindow )
EVT_SIZE( PCB_EDIT_FRAME::OnSize )
@ -201,8 +201,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_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 )
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_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool )

View File

@ -247,8 +247,6 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
{
wxString msg;
if( m_auxiliaryToolBar )
return;
@ -259,22 +257,20 @@ void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
m_auxiliaryToolBar->AddSeparator();
// Grid selection choice box.
m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar,
m_gridSelectBox = new wxChoice( m_auxiliaryToolBar,
ID_ON_GRID_SELECT,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
0, NULL );
// Update tool bar to reflect setting.
updateGridSelectBox();
m_auxiliaryToolBar->AddControl( m_gridSelectBox );
// Zoom selection choice box.
m_auxiliaryToolBar->AddSeparator();
m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar,
m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar,
ID_ON_ZOOM_SELECT,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
0, NULL );
updateZoomSelectBox();
m_auxiliaryToolBar->AddControl( m_zoomSelectBox );

View File

@ -565,21 +565,18 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
/* Set up toolbar items */
// Creates box to display and choose tracks widths:
m_SelTrackWidthBox = new wxComboBox( m_auxiliaryToolBar,
m_SelTrackWidthBox = new wxChoice( m_auxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
0, NULL );
updateTraceWidthSelectBox();
m_auxiliaryToolBar->AddControl( m_SelTrackWidthBox );
// m_auxiliaryToolBar->AddSeparator();
// Creates box to display and choose vias diameters:
m_SelViaSizeBox = new wxComboBox( m_auxiliaryToolBar,
m_SelViaSizeBox = new wxChoice( m_auxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
0, NULL );
updateViaSizeSelectBox();
m_auxiliaryToolBar->AddControl( m_SelViaSizeBox );
m_auxiliaryToolBar->AddSeparator();
@ -594,21 +591,19 @@ an existing track use its width\notherwise, use current width setting" ),
// Add the box to display and select the current grid size:
m_auxiliaryToolBar->AddSeparator();
m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar,
m_gridSelectBox = new wxChoice( m_auxiliaryToolBar,
ID_ON_GRID_SELECT,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
0, NULL );
updateGridSelectBox();
m_auxiliaryToolBar->AddControl( m_gridSelectBox );
// Add the box to display and select the current Zoom
m_auxiliaryToolBar->AddSeparator();
m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar,
m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar,
ID_ON_ZOOM_SELECT,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
0, NULL );
updateZoomSelectBox();
m_auxiliaryToolBar->AddControl( m_zoomSelectBox );