From c01a9d02857fb06492933764ab26795e7755eaa7 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 11 Jul 2015 19:11:34 -0400 Subject: [PATCH 1/2] Footprint editor dialog improvments and UI policy fixes. * Clean up formatting and make OK button the default in the array dialog. * Make the OK button the default in the move exact dialog. * Change the directory picker control from wxGenericDirCtrl to wxDirPickerCtrl so the native directory picker dialog is used to select the directory in the select pretty library path dialog. * Make the OK button the default in the select pretty library path dialog. --- pcbnew/dialogs/dialog_create_array.cpp | 4 +- pcbnew/dialogs/dialog_create_array_base.cpp | 45 ++--- pcbnew/dialogs/dialog_create_array_base.fbp | 180 +++++------------- pcbnew/dialogs/dialog_create_array_base.h | 3 +- pcbnew/dialogs/dialog_move_exact.cpp | 14 +- pcbnew/dialogs/dialog_move_exact.fbp | 4 +- pcbnew/dialogs/dialog_move_exact_base.cpp | 3 +- pcbnew/dialogs/dialog_move_exact_base.h | 4 +- pcbnew/dialogs/dialog_select_pretty_lib.cpp | 5 +- pcbnew/dialogs/dialog_select_pretty_lib.h | 2 +- .../dialogs/dialog_select_pretty_lib_base.cpp | 21 +- .../dialogs/dialog_select_pretty_lib_base.fbp | 48 ++--- .../dialogs/dialog_select_pretty_lib_base.h | 8 +- 13 files changed, 120 insertions(+), 221 deletions(-) diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 0c1bb7af8f..45389a732e 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -93,7 +93,6 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrig Add( m_entryGridPriNumberingOffset, m_options.m_gridPriNumberingOffset ); Add( m_entryGridSecNumberingOffset, m_options.m_gridSecNumberingOffset ); - RestoreConfigToControls(); // Load units into labels @@ -112,7 +111,9 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrig setControlEnablement(); calculateCircularArrayProperties(); + m_stdButtonsOK->SetDefault(); Fit(); + SetMinSize( GetSize() ); } @@ -126,6 +127,7 @@ void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) { setControlEnablement(); } + if( evObj == m_entryCentreX || evObj == m_entryCentreY ) { calculateCircularArrayProperties(); diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index 304cba593d..821376e8da 100644 --- a/pcbnew/dialogs/dialog_create_array_base.cpp +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -26,21 +26,21 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_labelNx = new wxStaticText( m_gridPanel, wxID_ANY, _("x Count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelNx = new wxStaticText( m_gridPanel, wxID_ANY, _("Horizontal count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelNx->Wrap( -1 ); gbSizer1->Add( m_labelNx, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_entryNx = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryNx, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - m_labelNy = new wxStaticText( m_gridPanel, wxID_ANY, _("y Count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelNy = new wxStaticText( m_gridPanel, wxID_ANY, _("Vertical count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelNy->Wrap( -1 ); gbSizer1->Add( m_labelNy, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_entryNy = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryNy, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - m_labelDx = new wxStaticText( m_gridPanel, wxID_ANY, _("x Spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelDx = new wxStaticText( m_gridPanel, wxID_ANY, _("Horizontal spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelDx->Wrap( -1 ); gbSizer1->Add( m_labelDx, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -51,7 +51,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_unitLabelDx->Wrap( -1 ); gbSizer1->Add( m_unitLabelDx, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_labelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("y Spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("Vertical spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelDy->Wrap( -1 ); gbSizer1->Add( m_labelDy, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -62,7 +62,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_unitLabelDy->Wrap( -1 ); gbSizer1->Add( m_unitLabelDy, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_labelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("x Offset:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("Horizontal offset:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelOffsetX->Wrap( -1 ); gbSizer1->Add( m_labelOffsetX, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -73,7 +73,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_unitLabelOffsetX->Wrap( -1 ); gbSizer1->Add( m_unitLabelOffsetX, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_labelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("y Offset:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("Vertical offset:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelOffsetY->Wrap( -1 ); gbSizer1->Add( m_labelOffsetY, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -93,13 +93,9 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID wxString m_radioBoxGridStaggerTypeChoices[] = { _("Rows"), _("Columns") }; int m_radioBoxGridStaggerTypeNChoices = sizeof( m_radioBoxGridStaggerTypeChoices ) / sizeof( wxString ); - m_radioBoxGridStaggerType = new wxRadioBox( m_gridPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS ); - m_radioBoxGridStaggerType->SetSelection( 0 ); - gbSizer1->Add( m_radioBoxGridStaggerType, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALL|wxEXPAND, 5 ); - - m_labelGridStaggerType = new wxStaticText( m_gridPanel, wxID_ANY, _("Stagger type:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_labelGridStaggerType->Wrap( -1 ); - gbSizer1->Add( m_labelGridStaggerType, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + m_radioBoxGridStaggerType = new wxRadioBox( m_gridPanel, wxID_ANY, _("Stagger Type"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridStaggerType->SetSelection( 1 ); + gbSizer1->Add( m_radioBoxGridStaggerType, wxGBPosition( 7, 0 ), wxGBSpan( 2, 2 ), wxALL|wxEXPAND, 5 ); bSizer2->Add( gbSizer1, 1, wxEXPAND, 5 ); @@ -109,26 +105,26 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID wxString m_radioBoxGridNumberingAxisChoices[] = { _("Horizontal, then vertical"), _("Vertical, then horizontal") }; int m_radioBoxGridNumberingAxisNChoices = sizeof( m_radioBoxGridNumberingAxisChoices ) / sizeof( wxString ); - m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering direction:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering Direction"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxGridNumberingAxis->SetSelection( 0 ); bSizer3->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 ); - m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse numbering on \nalternate rows/columns"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse numbering on alternate rows or columns"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer3->Add( m_checkBoxGridReverseNumbering, 0, wxALL, 5 ); m_checkBoxGridRestartNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxGridRestartNumbering->SetValue(true); bSizer3->Add( m_checkBoxGridRestartNumbering, 0, wxALL, 5 ); - wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Co-ordinate (A1, A2, ... B1, ...)") }; + wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Coordinate (A1, A2, ... B1, ...)") }; int m_radioBoxGridNumberingSchemeNChoices = sizeof( m_radioBoxGridNumberingSchemeChoices ) / sizeof( wxString ); - m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering scheme:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS ); - m_radioBoxGridNumberingScheme->SetSelection( 0 ); + m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering Scheme"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingScheme->SetSelection( 1 ); bSizer3->Add( m_radioBoxGridNumberingScheme, 0, wxALL|wxEXPAND, 5 ); m_labelPriAxisNumbering = new wxStaticText( m_gridPanel, wxID_ANY, _("Primary axis numbering:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelPriAxisNumbering->Wrap( -1 ); - bSizer3->Add( m_labelPriAxisNumbering, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer3->Add( m_labelPriAxisNumbering, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); wxArrayString m_choicePriAxisNumberingChoices; m_choicePriAxisNumbering = new wxChoice( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePriAxisNumberingChoices, 0 ); @@ -165,7 +161,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID bSizer3->Add( bSizer5, 0, wxEXPAND, 5 ); - bSizer2->Add( bSizer3, 1, wxEXPAND, 5 ); + bSizer2->Add( bSizer3, 0, wxALL|wxEXPAND, 5 ); m_gridPanel->SetSizer( bSizer2 ); @@ -181,7 +177,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID gbSizer2->SetFlexibleDirection( wxBOTH ); gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_labelCentreX = new wxStaticText( m_circularPanel, wxID_ANY, _("x Centre:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCentreX = new wxStaticText( m_circularPanel, wxID_ANY, _("Horizontal center:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCentreX->Wrap( -1 ); gbSizer2->Add( m_labelCentreX, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); @@ -192,7 +188,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_unitLabelCentreX->Wrap( -1 ); gbSizer2->Add( m_unitLabelCentreX, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_labelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("y Centre:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("Vertical center:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCentreY->Wrap( -1 ); gbSizer2->Add( m_labelCentreY, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); @@ -244,7 +240,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID gbSizer2->Add( m_entryRotateItemsCb, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - bSizer4->Add( gbSizer2, 1, wxEXPAND, 5 ); + bSizer4->Add( gbSizer2, 0, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizer6; bSizer6 = new wxBoxSizer( wxVERTICAL ); @@ -276,7 +272,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID bSizer6->Add( bSizer7, 0, wxEXPAND, 5 ); - bSizer4->Add( bSizer6, 1, wxEXPAND, 5 ); + bSizer4->Add( bSizer6, 1, wxALL|wxEXPAND, 5 ); m_circularPanel->SetSizer( bSizer4 ); @@ -298,6 +294,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID this->SetSizer( bMainSizer ); this->Layout(); + bMainSizer->Fit( this ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) ); diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index b59af79c9d..eb976c477c 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -44,10 +44,10 @@ -1,-1 DIALOG_CREATE_ARRAY_BASE - 576,428 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Create array + Create Array @@ -258,11 +258,11 @@ bSizer2 wxHORIZONTAL none - + 5 wxEXPAND 1 - + wxBOTH @@ -308,7 +308,7 @@ 0 0 wxID_ANY - x Count: + Horizontal count: 0 @@ -488,7 +488,7 @@ 0 0 wxID_ANY - y Count: + Vertical count: 0 @@ -668,7 +668,7 @@ 0 0 wxID_ANY - x Spacing: + Horizontal spacing: 0 @@ -934,7 +934,7 @@ 0 0 wxID_ANY - y Spacing: + Vertical spacing: 0 @@ -1200,7 +1200,7 @@ 0 0 wxID_ANY - x Offset: + Horizontal offset: 0 @@ -1466,7 +1466,7 @@ 0 0 wxID_ANY - y Offset: + Vertical offset: 0 @@ -1880,10 +1880,10 @@ 5 2 - 1 + 0 wxALL|wxEXPAND 7 - 1 + 2 1 1 @@ -1913,7 +1913,7 @@ 0 0 wxID_ANY - + Stagger Type 1 0 @@ -1930,7 +1930,7 @@ 1 Resizable - 0 + 1 1 wxRA_SPECIFY_COLS @@ -1970,99 +1970,13 @@ - - 5 - 1 - 0 - wxALL - 7 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Stagger type: - - 0 - - - 0 - - 1 - m_labelGridStaggerType - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 - wxEXPAND - 1 - + wxALL|wxEXPAND + 0 + bSizer3 wxVERTICAL @@ -2100,7 +2014,7 @@ 0 0 wxID_ANY - Numbering direction: + Numbering Direction 1 0 @@ -2190,7 +2104,7 @@ 0 0 wxID_ANY - Reverse numbering on alternate rows/columns + Reverse numbering on alternate rows or columns 0 @@ -2351,7 +2265,7 @@ 1 0 - "Continuous (1, 2, 3...)" "Co-ordinate (A1, A2, ... B1, ...)" + "Continuous (1, 2, 3...)" "Coordinate (A1, A2, ... B1, ...)" 1 1 @@ -2366,7 +2280,7 @@ 0 0 wxID_ANY - Numbering scheme: + Numbering Scheme 1 0 @@ -2383,7 +2297,7 @@ 1 Resizable - 0 + 1 1 wxRA_SPECIFY_COLS @@ -2425,7 +2339,7 @@ 5 - wxTOP|wxRIGHT|wxLEFT + wxLEFT|wxRIGHT|wxTOP 0 1 @@ -3129,11 +3043,11 @@ bSizer4 wxHORIZONTAL none - + 5 - wxEXPAND - 1 - + wxALL|wxEXPAND + 0 + wxBOTH @@ -3179,7 +3093,7 @@ 0 0 wxID_ANY - x Centre: + Horizontal center: 0 @@ -3445,7 +3359,7 @@ 0 0 wxID_ANY - y Centre: + Vertical center: 0 @@ -3676,14 +3590,14 @@ - + 5 1 0 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 2 1 - + 1 1 1 @@ -3762,14 +3676,14 @@ - + 5 1 1 wxALL 2 1 - + 1 1 1 @@ -4475,18 +4389,18 @@ 5 - wxEXPAND + wxALL|wxEXPAND 1 bSizer6 wxVERTICAL none - + 5 wxALL 0 - + 1 1 1 @@ -4570,11 +4484,11 @@ - + 5 wxTOP|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -4653,11 +4567,11 @@ - + 5 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -4741,20 +4655,20 @@ - + 5 wxEXPAND 0 - + bSizer7 wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 1 1 @@ -4833,11 +4747,11 @@ - + 5 wxALL 0 - + 1 1 1 diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 1893afcaa3..bfedc2792e 100644 --- a/pcbnew/dialogs/dialog_create_array_base.h +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -67,7 +67,6 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxStaticText* m_labelStagger; wxTextCtrl* m_entryStagger; wxRadioBox* m_radioBoxGridStaggerType; - wxStaticText* m_labelGridStaggerType; wxRadioBox* m_radioBoxGridNumberingAxis; wxCheckBox* m_checkBoxGridReverseNumbering; wxCheckBox* m_checkBoxGridRestartNumbering; @@ -112,7 +111,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM public: - DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 576,428 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create Array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_CREATE_ARRAY_BASE(); }; diff --git a/pcbnew/dialogs/dialog_move_exact.cpp b/pcbnew/dialogs/dialog_move_exact.cpp index 8f124c4c00..b10bd9466e 100644 --- a/pcbnew/dialogs/dialog_move_exact.cpp +++ b/pcbnew/dialogs/dialog_move_exact.cpp @@ -57,7 +57,7 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, m_stdButtonsOK->SetDefault(); - GetSizer()->SetSizeHints(this); + GetSizer()->SetSizeHints( this ); } @@ -110,7 +110,7 @@ void DIALOG_MOVE_EXACT::OnPolarChanged( wxCommandEvent& event ) { // convert to polar coordinates double r, q; - ToPolarDeg( val.x, val.y, r, q); + ToPolarDeg( val.x, val.y, r, q ); PutValueInLocalUnits( *m_xEntry, round( r / 10.0) * 10 ); m_yEntry->SetValue( wxString::FromDouble( q ) ); @@ -121,8 +121,8 @@ void DIALOG_MOVE_EXACT::OnPolarChanged( wxCommandEvent& event ) // note - round off the last decimal place (10nm) to prevent // (some) rounding causing errors when round-tripping // you can never eliminate entirely, however - PutValueInLocalUnits( *m_xEntry, KiROUND( val.x / 10.0) * 10 ); - PutValueInLocalUnits( *m_yEntry, KiROUND( val.y / 10.0) * 10 ); + PutValueInLocalUnits( *m_xEntry, KiROUND( val.x / 10.0 ) * 10 ); + PutValueInLocalUnits( *m_yEntry, KiROUND( val.y / 10.0 ) * 10 ); } Layout(); } @@ -183,7 +183,7 @@ void DIALOG_MOVE_EXACT::OnOkClick( wxCommandEvent& event ) // for the output, we only deliver a Cartesian vector bool ok = GetTranslationInIU( m_translation, m_polarCoords->IsChecked() ); - if ( ok ) + if( ok ) { // save the settings m_options.polarCoords = m_polarCoords->GetValue(); @@ -191,7 +191,7 @@ void DIALOG_MOVE_EXACT::OnOkClick( wxCommandEvent& event ) m_yEntry->GetValue().ToDouble( &m_options.entry2 ); m_rotEntry->GetValue().ToDouble( &m_options.entryRotation ); - EndModal( wxID_OK); + EndModal( wxID_OK ); } } @@ -201,7 +201,7 @@ void DIALOG_MOVE_EXACT::OnTextFocusLost( wxFocusEvent& event ) wxTextCtrl* obj = static_cast( event.GetEventObject() ); if( obj->GetValue().IsEmpty() ) - obj->SetValue("0"); + obj->SetValue( "0" ); event.Skip(); } diff --git a/pcbnew/dialogs/dialog_move_exact.fbp b/pcbnew/dialogs/dialog_move_exact.fbp index 02dbd01434..6aa0c3ef4d 100644 --- a/pcbnew/dialogs/dialog_move_exact.fbp +++ b/pcbnew/dialogs/dialog_move_exact.fbp @@ -44,10 +44,10 @@ -1,-1 DIALOG_MOVE_EXACT_BASE - 331,200 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Move item + Move Item diff --git a/pcbnew/dialogs/dialog_move_exact_base.cpp b/pcbnew/dialogs/dialog_move_exact_base.cpp index bddfdfc8d8..64fe00c493 100644 --- a/pcbnew/dialogs/dialog_move_exact_base.cpp +++ b/pcbnew/dialogs/dialog_move_exact_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -85,6 +85,7 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id, this->SetSizer( bMainSizer ); this->Layout(); + bMainSizer->Fit( this ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_MOVE_EXACT_BASE::OnClose ) ); diff --git a/pcbnew/dialogs/dialog_move_exact_base.h b/pcbnew/dialogs/dialog_move_exact_base.h index 9040369239..d38a75ca71 100644 --- a/pcbnew/dialogs/dialog_move_exact_base.h +++ b/pcbnew/dialogs/dialog_move_exact_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -71,7 +71,7 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM public: - DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 331,200 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move Item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_MOVE_EXACT_BASE(); }; diff --git a/pcbnew/dialogs/dialog_select_pretty_lib.cpp b/pcbnew/dialogs/dialog_select_pretty_lib.cpp index 3250f9bc6f..0c330cd30c 100644 --- a/pcbnew/dialogs/dialog_select_pretty_lib.cpp +++ b/pcbnew/dialogs/dialog_select_pretty_lib.cpp @@ -40,10 +40,13 @@ DIALOG_SELECT_PRETTY_LIB::DIALOG_SELECT_PRETTY_LIB( wxWindow* parent, { if( !aDefaultPath.IsEmpty() ) m_dirCtrl->SetPath( aDefaultPath ); + + m_sdbSizerOK->SetDefault(); + GetSizer()->SetSizeHints( this ); } -void DIALOG_SELECT_PRETTY_LIB::OnSelectFolder( wxTreeEvent& event ) +void DIALOG_SELECT_PRETTY_LIB::OnSelectFolder( wxFileDirPickerEvent& event ) { m_libName->SetValue( m_dirCtrl->GetPath() ); diff --git a/pcbnew/dialogs/dialog_select_pretty_lib.h b/pcbnew/dialogs/dialog_select_pretty_lib.h index 1c201f081a..7beb20e39e 100644 --- a/pcbnew/dialogs/dialog_select_pretty_lib.h +++ b/pcbnew/dialogs/dialog_select_pretty_lib.h @@ -46,7 +46,7 @@ public: const wxString GetPath() { return m_libName->GetValue(); } private: - virtual void OnSelectFolder( wxTreeEvent& event ); + virtual void OnSelectFolder( wxFileDirPickerEvent& event ); }; diff --git a/pcbnew/dialogs/dialog_select_pretty_lib_base.cpp b/pcbnew/dialogs/dialog_select_pretty_lib_base.cpp index f6bdf008e8..78dcbd9137 100644 --- a/pcbnew/dialogs/dialog_select_pretty_lib_base.cpp +++ b/pcbnew/dialogs/dialog_select_pretty_lib_base.cpp @@ -11,25 +11,23 @@ DIALOG_SELECT_PRETTY_LIB_BASE::DIALOG_SELECT_PRETTY_LIB_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( wxSize( 400,300 ), wxDefaultSize ); + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - m_staticText = new wxStaticText( this, wxID_ANY, _("The footprint library is a folder with a name ending by .pretty\nFootprints are .kicad_mod files inside this folder."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText = new wxStaticText( this, wxID_ANY, _("The footprint library is a folder with a name ending with .pretty\nFootprints are .kicad_mod files inside this folder."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText->Wrap( -1 ); m_staticText->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); bSizerMain->Add( m_staticText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_dirCtrl = new wxGenericDirCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxDIRCTRL_DIR_ONLY|wxSUNKEN_BORDER, wxEmptyString, 0 ); - - m_dirCtrl->ShowHidden( false ); - bSizerMain->Add( m_dirCtrl, 1, wxEXPAND | wxALL, 5 ); + m_dirCtrl = new wxDirPickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE ); + bSizerMain->Add( m_dirCtrl, 0, wxALL|wxEXPAND, 5 ); m_SizerNewLibName = new wxBoxSizer( wxVERTICAL ); - m_staticTextDirname = new wxStaticText( this, wxID_ANY, _("Library (.pretty folder)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDirname = new wxStaticText( this, wxID_ANY, _("Library Path (.pretty will be appended to folder)"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDirname->Wrap( -1 ); m_SizerNewLibName->Add( m_staticTextDirname, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -49,23 +47,22 @@ DIALOG_SELECT_PRETTY_LIB_BASE::DIALOG_SELECT_PRETTY_LIB_BASE( wxWindow* parent, m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT, 5 ); + bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); this->Centre( wxBOTH ); // Connect Events - m_dirCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_SELECT_PRETTY_LIB_BASE::OnSelectFolder ), NULL, this ); - m_dirCtrl->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_SELECT_PRETTY_LIB_BASE::OnSelectFolder ), NULL, this ); + m_dirCtrl->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( DIALOG_SELECT_PRETTY_LIB_BASE::OnSelectFolder ), NULL, this ); } DIALOG_SELECT_PRETTY_LIB_BASE::~DIALOG_SELECT_PRETTY_LIB_BASE() { // Disconnect Events - m_dirCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_SELECT_PRETTY_LIB_BASE::OnSelectFolder ), NULL, this ); - m_dirCtrl->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_SELECT_PRETTY_LIB_BASE::OnSelectFolder ), NULL, this ); + m_dirCtrl->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( DIALOG_SELECT_PRETTY_LIB_BASE::OnSelectFolder ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_select_pretty_lib_base.fbp b/pcbnew/dialogs/dialog_select_pretty_lib_base.fbp index 0361b40fb4..eee16410c6 100644 --- a/pcbnew/dialogs/dialog_select_pretty_lib_base.fbp +++ b/pcbnew/dialogs/dialog_select_pretty_lib_base.fbp @@ -41,10 +41,10 @@ 0 wxID_ANY - 400,300 + -1,-1 DIALOG_SELECT_PRETTY_LIB_BASE - 400,300 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Select Footprint Library Folder @@ -125,7 +125,7 @@ 0 0 wxID_ANY - The footprint library is a folder with a name ending by .pretty Footprints are .kicad_mod files inside this folder. + The footprint library is a folder with a name ending with .pretty Footprints are .kicad_mod files inside this folder. 0 @@ -178,9 +178,9 @@ 5 - wxEXPAND | wxALL - 1 - + wxALL|wxEXPAND + 0 + 1 1 1 @@ -198,14 +198,11 @@ 1 0 - 0 - Dock 0 Left 1 - 1 0 @@ -214,6 +211,7 @@ 0 + Select a folder 0 @@ -227,16 +225,21 @@ Resizable 1 - 0 - wxDIRCTRL_3D_INTERNAL|wxDIRCTRL_DIR_ONLY + wxDIRP_DEFAULT_STYLE 0 + + wxFILTER_NONE + wxDefaultValidator + + - wxSUNKEN_BORDER + + OnSelectFolder @@ -258,23 +261,6 @@ - - - - - - - OnSelectFolder - - - - - - - - - OnSelectFolder - @@ -319,7 +305,7 @@ 0 0 wxID_ANY - Library (.pretty folder) + Library Path (.pretty will be appended to folder) 0 @@ -546,7 +532,7 @@ 5 - wxALIGN_RIGHT + wxALL|wxEXPAND 0 0 diff --git a/pcbnew/dialogs/dialog_select_pretty_lib_base.h b/pcbnew/dialogs/dialog_select_pretty_lib_base.h index 9d4b07bf92..972825d7c3 100644 --- a/pcbnew/dialogs/dialog_select_pretty_lib_base.h +++ b/pcbnew/dialogs/dialog_select_pretty_lib_base.h @@ -20,7 +20,7 @@ class DIALOG_SHIM; #include #include #include -#include +#include #include #include #include @@ -39,7 +39,7 @@ class DIALOG_SELECT_PRETTY_LIB_BASE : public DIALOG_SHIM protected: wxStaticText* m_staticText; - wxGenericDirCtrl* m_dirCtrl; + wxDirPickerCtrl* m_dirCtrl; wxBoxSizer* m_SizerNewLibName; wxStaticText* m_staticTextDirname; wxTextCtrl* m_libName; @@ -49,12 +49,12 @@ class DIALOG_SELECT_PRETTY_LIB_BASE : public DIALOG_SHIM wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class - virtual void OnSelectFolder( wxTreeEvent& event ) { event.Skip(); } + virtual void OnSelectFolder( wxFileDirPickerEvent& event ) { event.Skip(); } public: - DIALOG_SELECT_PRETTY_LIB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Footprint Library Folder"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_SELECT_PRETTY_LIB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Footprint Library Folder"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_SELECT_PRETTY_LIB_BASE(); }; From d7f4c766829bb6bd1f0c00193f5a0885b5a81e19 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 12 Jul 2015 11:01:40 +0200 Subject: [PATCH 2/2] build process on mingw/msys2: force usage of a response file at archive/link stage to avoid truncation of the command line when the list of modules to archive/link is very long (happens for eeschema and pcbnew). --- CMakeLists.txt | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f478bc271a..1c3d9f3a74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,16 +197,23 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) # Since version 2.8.5, Cmake uses a response file (.rsp) to # pass the list of include paths to gcc # unfortunately, under mingw32+msys, at least with gcc 4.8 and previous, - # this file is not expanded and include paths defined in this file are not taken in account - # this is the case of wxWidgets includes - # Disable this response file for includes ( See Windows-GNU.cmake module ) - if( WIN32 AND MSYS AND NOT CMAKE_CROSSCOMPILING ) - # fixme: it is needed only with MSYS+MINGW32? or always under MINGW - if( ${CMAKE_SIZEOF_VOID_P} MATCHES 4 ) - set( CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0 ) + # this file is not always expanded and in this case include paths defined in this file + # are not taken in account ( this is the case of wxWidgets includes ) + # If it is the case, disable this response file for includes ( See Windows-GNU.cmake module ) + if( false ) #set to true to disable the include response file + if( WIN32 AND MSYS AND NOT CMAKE_CROSSCOMPILING ) + # fixme: it is needed only with MSYS+MINGW32? or always under MINGW + if( ${CMAKE_SIZEOF_VOID_P} MATCHES 4 ) + set( CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0 ) + endif() endif() endif() + # for some reasons, cmake does do use always a response file to send the list of objects + # to the archiver, and because this list can be very long, and can create issue + # when it is used in a command line, force use of a response file to store it + SET( CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1 ) + # The MinGW compiler can use the microsoft system snprintf as standard and it has a broken # API with respect to the C99 standard, so make sure we force it to use its own compliant # snprintf