From 498a566ca32595209d0ef08d2e364615461e9e27 Mon Sep 17 00:00:00 2001 From: John Beard Date: Sat, 23 Feb 2019 14:46:43 +0000 Subject: [PATCH] Pcbnew: fix spacing in move exact dialog The middle text ctrl has borders on both top and bottom, should be just one for even spacing. --- pcbnew/dialogs/dialog_move_exact_base.cpp | 66 ++-- pcbnew/dialogs/dialog_move_exact_base.fbp | 436 ++-------------------- pcbnew/dialogs/dialog_move_exact_base.h | 23 +- 3 files changed, 79 insertions(+), 446 deletions(-) diff --git a/pcbnew/dialogs/dialog_move_exact_base.cpp b/pcbnew/dialogs/dialog_move_exact_base.cpp index 9b0fe3cbe3..af342df12c 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 Dec 30 2017) +// C++ code generated with wxFormBuilder (version Nov 10 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,95 +12,95 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_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( -1,-1 ), wxDefaultSize ); - + bMainSizer = new wxBoxSizer( wxVERTICAL ); - + wxFlexGridSizer* fgInputSizer; fgInputSizer = new wxFlexGridSizer( 0, 4, 0, 5 ); fgInputSizer->AddGrowableCol( 1 ); fgInputSizer->SetFlexibleDirection( wxBOTH ); fgInputSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + m_xLabel = new wxStaticText( this, wxID_ANY, _("Move X:"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_xLabel->Wrap( -1 ); fgInputSizer->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); - + m_xEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); fgInputSizer->Add( m_xEntry, 0, wxEXPAND|wxTOP, 5 ); - + m_xUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_xUnit->Wrap( -1 ); fgInputSizer->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxTOP|wxRIGHT, 5 ); - + m_clearX = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); fgInputSizer->Add( m_clearX, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_yLabel = new wxStaticText( this, wxID_ANY, _("Move Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_yLabel->Wrap( -1 ); fgInputSizer->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - + m_yEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - fgInputSizer->Add( m_yEntry, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - + fgInputSizer->Add( m_yEntry, 0, wxEXPAND|wxTOP, 5 ); + m_yUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_yUnit->Wrap( -1 ); fgInputSizer->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_clearY = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); fgInputSizer->Add( m_clearY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - + m_rotLabel = new wxStaticText( this, wxID_ANY, _("Rotate:"), wxDefaultPosition, wxDefaultSize, 0 ); m_rotLabel->Wrap( -1 ); fgInputSizer->Add( m_rotLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - + m_rotEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - fgInputSizer->Add( m_rotEntry, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - + fgInputSizer->Add( m_rotEntry, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + m_rotUnit = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_rotUnit->Wrap( -1 ); fgInputSizer->Add( m_rotUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_clearRot = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); fgInputSizer->Add( m_clearRot, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - + + fgInputSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - + wxString m_anchorOptionsChoices[] = { _("Rotate around center of selection"), _("Rotate around local coordinates origin"), _("Rotate around drill/place origin") }; int m_anchorOptionsNChoices = sizeof( m_anchorOptionsChoices ) / sizeof( wxString ); m_anchorOptions = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_anchorOptionsNChoices, m_anchorOptionsChoices, 0 ); m_anchorOptions->SetSelection( 0 ); fgInputSizer->Add( m_anchorOptions, 0, wxEXPAND|wxBOTTOM, 5 ); - - + + bMainSizer->Add( fgInputSizer, 0, wxEXPAND|wxALL, 10 ); - + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); - + wxBoxSizer* bBottomSizer; bBottomSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Use polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 ); bBottomSizer->Add( m_polarCoords, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 ); - + m_stdButtons = new wxStdDialogButtonSizer(); m_stdButtonsOK = new wxButton( this, wxID_OK ); m_stdButtons->AddButton( m_stdButtonsOK ); m_stdButtonsCancel = new wxButton( this, wxID_CANCEL ); m_stdButtons->AddButton( m_stdButtonsCancel ); m_stdButtons->Realize(); - + bBottomSizer->Add( m_stdButtons, 1, wxALL|wxEXPAND, 5 ); - - + + bMainSizer->Add( bBottomSizer, 0, wxEXPAND, 5 ); - - + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); - + // Connect Events m_xEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); m_clearX->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); @@ -121,5 +121,5 @@ DIALOG_MOVE_EXACT_BASE::~DIALOG_MOVE_EXACT_BASE() m_rotEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); m_clearRot->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); m_polarCoords->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnPolarChanged ), NULL, this ); - + } diff --git a/pcbnew/dialogs/dialog_move_exact_base.fbp b/pcbnew/dialogs/dialog_move_exact_base.fbp index 398b4e6c72..350ef94751 100644 --- a/pcbnew/dialogs/dialog_move_exact_base.fbp +++ b/pcbnew/dialogs/dialog_move_exact_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_move_exact_base 1000 none + 1 DIALOG_MOVE_EXACT_BASE @@ -52,42 +53,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer @@ -142,6 +107,7 @@ 0 wxID_ANY Move X: + 0 0 @@ -167,29 +133,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -254,33 +197,7 @@ - - - - - OnTextFocusLost - - - - - - - - - - - - - - - - - - - - - @@ -316,6 +233,7 @@ 0 wxID_ANY mm + 0 0 @@ -341,29 +259,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -381,25 +276,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Reset + + 0 0 @@ -414,6 +315,8 @@ protected 1 + + Resizable 1 @@ -429,29 +332,6 @@ OnClear - - - - - - - - - - - - - - - - - - - - - - - @@ -487,6 +367,7 @@ 0 wxID_ANY Move Y: + 0 0 @@ -512,34 +393,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM + wxEXPAND|wxTOP 0 1 @@ -599,33 +457,7 @@ - - - - - OnTextFocusLost - - - - - - - - - - - - - - - - - - - - - @@ -661,6 +493,7 @@ 0 wxID_ANY mm + 0 0 @@ -686,29 +519,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -726,25 +536,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Reset + + 0 0 @@ -759,6 +575,8 @@ protected 1 + + Resizable 1 @@ -774,29 +592,6 @@ OnClear - - - - - - - - - - - - - - - - - - - - - - - @@ -832,6 +627,7 @@ 0 wxID_ANY Rotate: + 0 0 @@ -857,34 +653,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM + wxBOTTOM|wxEXPAND|wxTOP 0 1 @@ -944,33 +717,7 @@ - - - - - OnTextFocusLost - - - - - - - - - - - - - - - - - - - - - @@ -1006,6 +753,7 @@ 0 wxID_ANY deg + 0 0 @@ -1031,29 +779,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1071,25 +796,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Reset + + 0 0 @@ -1104,6 +835,8 @@ protected 1 + + Resizable 1 @@ -1119,29 +852,6 @@ OnClear - - - - - - - - - - - - - - - - - - - - - - - @@ -1216,30 +926,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1300,29 +986,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1396,30 +1059,7 @@ - OnPolarChanged - - - - - - - - - - - - - - - - - - - - - - @@ -1438,14 +1078,6 @@ m_stdButtons protected - - - - - - - - diff --git a/pcbnew/dialogs/dialog_move_exact_base.h b/pcbnew/dialogs/dialog_move_exact_base.h index 17ff1e4c22..ce6677b66b 100644 --- a/pcbnew/dialogs/dialog_move_exact_base.h +++ b/pcbnew/dialogs/dialog_move_exact_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Nov 10 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_MOVE_EXACT_BASE_H__ -#define __DIALOG_MOVE_EXACT_BASE_H__ +#pragma once #include #include @@ -19,6 +18,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -35,7 +37,7 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM { private: - + protected: wxBoxSizer* bMainSizer; wxStaticText* m_xLabel; @@ -56,18 +58,17 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; - + // Virtual event handlers, overide them in your derived class virtual void OnTextFocusLost( wxFocusEvent& event ) { event.Skip(); } virtual void OnClear( wxCommandEvent& event ) { event.Skip(); } virtual void OnPolarChanged( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - 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( 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(); - + }; -#endif //__DIALOG_MOVE_EXACT_BASE_H__