From 4cd4990bc2ca13478f5ef3d046e24ba6f4996e04 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 20 Jun 2014 19:29:35 +0200 Subject: [PATCH] Fix compil issue with KICAD_SCRIPTING_WXPYTHON option ON. Minor enhancements. --- common/draw_frame.cpp | 2 +- common/draw_panel.cpp | 2 +- pcbnew/dialogs/dialog_pns_settings_base.cpp | 29 +++--- pcbnew/dialogs/dialog_pns_settings_base.fbp | 109 +++++++++++++++++--- pcbnew/dialogs/dialog_pns_settings_base.h | 11 +- pcbnew/pcbframe.cpp | 2 +- 6 files changed, 123 insertions(+), 32 deletions(-) diff --git a/common/draw_frame.cpp b/common/draw_frame.cpp index b94c2c67b5..82b65f6c99 100644 --- a/common/draw_frame.cpp +++ b/common/draw_frame.cpp @@ -119,7 +119,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, m_GridColor = DARKGRAY; // Grid color m_showPageLimits = false; m_drawBgColor = BLACK; // the background color of the draw canvas: - // BLACK for Pcbnew, BLACK or WHITeEfor eeschema + // BLACK for Pcbnew, BLACK or WHITE for eeschema m_snapToGrid = true; m_MsgFrameHeight = EDA_MSG_PANEL::GetRequiredHeight(); m_movingCursorWithKeyboard = false; diff --git a/common/draw_panel.cpp b/common/draw_panel.cpp index 73864ad2db..d977f17c4c 100644 --- a/common/draw_panel.cpp +++ b/common/draw_panel.cpp @@ -114,7 +114,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, m_ClipBox.SetY( 0 ); m_canStartBlock = -1; // Command block can start if >= 0 m_abortRequest = false; - m_enableMiddleButtonPan = false; + m_enableMiddleButtonPan = true; m_enableZoomNoCenter = false; m_panScrollbarLimits = false; m_enableAutoPan = true; diff --git a/pcbnew/dialogs/dialog_pns_settings_base.cpp b/pcbnew/dialogs/dialog_pns_settings_base.cpp index 82318f7e32..2642caf845 100644 --- a/pcbnew/dialogs/dialog_pns_settings_base.cpp +++ b/pcbnew/dialogs/dialog_pns_settings_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 30 2013) +// C++ code generated with wxFormBuilder (version Nov 6 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_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 ); @@ -19,29 +19,29 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID wxString m_modeChoices[] = { _("Highlight collisions"), _("Shove"), _("Walk around"), _("Figure out what's best") }; int m_modeNChoices = sizeof( m_modeChoices ) / sizeof( wxString ); m_mode = new wxRadioBox( this, wxID_ANY, _("Mode"), wxDefaultPosition, wxDefaultSize, m_modeNChoices, m_modeChoices, 1, wxRA_SPECIFY_COLS ); - m_mode->SetSelection( 1 ); - bMainSizer->Add( m_mode, 0, wxALL, 5 ); + m_mode->SetSelection( 0 ); + bMainSizer->Add( m_mode, 0, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* bOptions; bOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); m_shoveVias = new wxCheckBox( this, wxID_ANY, _("Shove vias"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptions->Add( m_shoveVias, 0, wxALL, 5 ); + bOptions->Add( m_shoveVias, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_backPressure = new wxCheckBox( this, wxID_ANY, _("Jump over obstacles"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptions->Add( m_backPressure, 0, wxALL, 5 ); + bOptions->Add( m_backPressure, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_removeLoops = new wxCheckBox( this, wxID_ANY, _("Remove redundant tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptions->Add( m_removeLoops, 0, wxALL, 5 ); + bOptions->Add( m_removeLoops, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_autoNeckdown = new wxCheckBox( this, wxID_ANY, _("Automatic neckdown"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptions->Add( m_autoNeckdown, 0, wxALL, 5 ); + bOptions->Add( m_autoNeckdown, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_smoothDragged = new wxCheckBox( this, wxID_ANY, _("Smooth dragged segments"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptions->Add( m_smoothDragged, 0, wxALL, 5 ); + bOptions->Add( m_smoothDragged, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_violateDrc = new wxCheckBox( this, wxID_ANY, _("Allow DRC violations"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptions->Add( m_violateDrc, 0, wxALL, 5 ); + bOptions->Add( m_violateDrc, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_suggestEnding = new wxCheckBox( this, wxID_ANY, _("Suggest track finish"), wxDefaultPosition, wxDefaultSize, 0 ); m_suggestEnding->Enable( false ); @@ -89,7 +89,10 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID bEffort->Add( bSlider, 1, wxEXPAND, 5 ); - bOptions->Add( bEffort, 1, wxEXPAND, 5 ); + bOptions->Add( bEffort, 0, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bOptions->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); m_stdButtons = new wxStdDialogButtonSizer(); m_stdButtonsOK = new wxButton( this, wxID_OK ); @@ -98,10 +101,10 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID m_stdButtons->AddButton( m_stdButtonsCancel ); m_stdButtons->Realize(); - bOptions->Add( m_stdButtons, 1, wxEXPAND, 5 ); + bOptions->Add( m_stdButtons, 0, wxEXPAND, 5 ); - bMainSizer->Add( bOptions, 1, wxEXPAND, 5 ); + bMainSizer->Add( bOptions, 1, wxEXPAND|wxALL, 5 ); this->SetSizer( bMainSizer ); diff --git a/pcbnew/dialogs/dialog_pns_settings_base.fbp b/pcbnew/dialogs/dialog_pns_settings_base.fbp index 729449a9c0..d635feb8ee 100644 --- a/pcbnew/dialogs/dialog_pns_settings_base.fbp +++ b/pcbnew/dialogs/dialog_pns_settings_base.fbp @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -42,9 +44,9 @@ DIALOG_PNS_SETTINGS_BASE - 313,528 + 277,404 wxDEFAULT_DIALOG_STYLE - + DIALOG_SHIM; dialog_shim.h Interactive Router settings @@ -93,7 +95,7 @@ none 5 - wxALL + wxALL|wxEXPAND 0 1 @@ -141,7 +143,7 @@ 1 Resizable - 1 + 0 1 wxRA_SPECIFY_COLS @@ -183,7 +185,7 @@ 5 - wxEXPAND + wxEXPAND|wxALL 1 wxID_ANY @@ -195,7 +197,7 @@ 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -283,7 +285,7 @@ 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -371,7 +373,7 @@ 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -459,7 +461,7 @@ 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -547,7 +549,7 @@ 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -635,7 +637,7 @@ 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -812,7 +814,7 @@ 5 wxEXPAND - 1 + 0 bEffort @@ -1219,10 +1221,91 @@ + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND - 1 + 0 0 1 diff --git a/pcbnew/dialogs/dialog_pns_settings_base.h b/pcbnew/dialogs/dialog_pns_settings_base.h index e67d0a72a6..5ba9eb21e3 100644 --- a/pcbnew/dialogs/dialog_pns_settings_base.h +++ b/pcbnew/dialogs/dialog_pns_settings_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 30 2013) +// C++ code generated with wxFormBuilder (version Nov 6 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,9 @@ #include #include #include +class DIALOG_SHIM; + +#include "dialog_shim.h" #include #include #include @@ -21,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +35,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_PNS_SETTINGS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PNS_SETTINGS_BASE : public wxDialog +class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM { private: @@ -48,6 +52,7 @@ class DIALOG_PNS_SETTINGS_BASE : public wxDialog wxSlider* m_effort; wxStaticText* m_lowLabel; wxStaticText* m_highLabel; + wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; @@ -60,7 +65,7 @@ class DIALOG_PNS_SETTINGS_BASE : public wxDialog public: - DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Interactive Router settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 313,528 ), long style = wxDEFAULT_DIALOG_STYLE ); + DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Interactive Router settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 277,404 ), long style = wxDEFAULT_DIALOG_STYLE ); ~DIALOG_PNS_SETTINGS_BASE(); }; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 4d9095d040..c5487afa12 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -1085,7 +1085,7 @@ void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent ) { // Add the scripting panel EDA_PANEINFO pythonAuiPane; - pythonAuiPane.ScriptingToolbarPane(); + pythonAuiPane.ScriptingConsolePane(); pythonAuiPane.Caption( wxT( "Python Scripting" ) ); pythonAuiPane.MinSize( 300, 150 );