Browse Source

Pcbnew: Replace wxComboBoxes by wxChoice in auxiliary horizontal toolbar, to try to avoid issues on OSX (combo boxes not responding to mouse clicks).

pull/5/head
jean-pierre charras 11 years ago
parent
commit
c48a417dcd
  1. 55
      Documentation/wxWidgets_patch_notes.txt
  2. 2
      common/draw_frame.cpp
  3. 4
      include/draw_frame.h
  4. 4
      include/wxPcbStruct.h
  5. 8
      pcbnew/basepcbframe.cpp
  6. 4
      pcbnew/moduleframe.cpp
  7. 8
      pcbnew/pcbframe.cpp
  8. 12
      pcbnew/tool_modedit.cpp
  9. 21
      pcbnew/tool_pcb.cpp

55
Documentation/wxWidgets_patch_notes.txt

@ -1,52 +1,12 @@
--== notes about wxWidgets problems ==--
Last Revised: 28-Feb-2010
Last Revised: 02-jul-2015
Kicad needs wxWidgets, the multi platform G.U.I toolkit.
Kicad needs wxWidgets, the multi platform G.U.I.
Known problems:
wxMSW:
use *only* wxWidgets >= 3.0
wxGTK
Use wxWidgets 2.8.10 or later
Linux and macOSX
- Printing problems (all version).
Note old versions of wxWidgets give *very ugly results*
(poor printing resolution set to 72ppi)
So use a very recent version (>= 2.8.10 (that also solve other bugs)
wxWidgets patch:
wxWidgets 2.9.1 (all platforms)
Has a problem when using the built in string to double conversion:
In countries using a comm instead of a point as floating number separator
after calling this conversion function, the comma is changed in point.
(Happens after reading a parameter stored in a wxConfig structure, if this
parameter is a double)
Workaround:
Use a version >= 2.9.3
*************************************************************************************
wxGTK version: All before wxWidgets 3.0
*************************************************************************************
Patch for printing wide traces that were shown with missing rounded end caps.
Without this patch, printing boards and schematics under Linux, and perhaps OSX
gives ugly drawings.
wxGTK-2.8.11/src/generic/dcpsg.cpp
search for:
line 1636
PsPrint( "%%EndProlog\n" );
Add after this line:
PsPrint("%%BeginSetup\n");
PsPrint( "1 setlinecap\n" );
PsPrint("%%EndSetup\n");
use *only* wxWidgets
>= 3.0.1 On Windows
>= 3.0.2 on Linux (prevision versions have bugs which crash Kicad)
>= 3.0.2 on OSX (which need patches: see patches/wxwidgets-3.0.0_macosx_xxx)
Known bug on Windows:
Postscript printers print tracks like tin line.
@ -54,3 +14,6 @@ It happens only for PS drivers, and PDF printer.
Other drivers (PCL for instance) work fine,
so it is unlikely a bug inside Kicad/wxWidgets
on 3.0.2 Window version 64 bits:
the mirror mode gives a blanc sheet.
wxWidgets 3.0.2 must be patched (see patches/wxWidgets-3.0.2-msw-dc-orientation-fix.patch) and rebuilt.

2
common/draw_frame.cpp

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

4
include/draw_frame.h

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

4
include/wxPcbStruct.h

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

8
pcbnew/basepcbframe.cpp

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

4
pcbnew/moduleframe.cpp

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

8
pcbnew/pcbframe.cpp

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

12
pcbnew/tool_modedit.cpp

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

21
pcbnew/tool_pcb.cpp

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

Loading…
Cancel
Save