From fb1570d290fe0d02604a9ddb61f2316266d90b91 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 23 Oct 2019 20:14:41 +0200 Subject: [PATCH] DIALOG_POSITION_RELATIVE_BASE: fix wxWidget alerts --- .../dialogs/dialog_position_relative_base.cpp | 115 +++-- .../dialogs/dialog_position_relative_base.fbp | 457 +++--------------- .../dialogs/dialog_position_relative_base.h | 23 +- 3 files changed, 125 insertions(+), 470 deletions(-) diff --git a/pcbnew/dialogs/dialog_position_relative_base.cpp b/pcbnew/dialogs/dialog_position_relative_base.cpp index 132beaa765..ed74f444b2 100644 --- a/pcbnew/dialogs/dialog_position_relative_base.cpp +++ b/pcbnew/dialogs/dialog_position_relative_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,131 +12,130 @@ DIALOG_POSITION_RELATIVE_BASE::DIALOG_POSITION_RELATIVE_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 ); - + wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bUpperSizer; bUpperSizer = new wxBoxSizer( wxVERTICAL ); - + m_referenceInfo = new wxStaticText( this, wxID_ANY, _("Reference item: "), wxDefaultPosition, wxDefaultSize, 0 ); m_referenceInfo->Wrap( -1 ); m_referenceInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); m_referenceInfo->SetMinSize( wxSize( 340,-1 ) ); - - bUpperSizer->Add( m_referenceInfo, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - + + bUpperSizer->Add( m_referenceInfo, 0, wxALL, 5 ); + + bUpperSizer->Add( 0, 0, 0, wxEXPAND, 5 ); - + wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxHORIZONTAL ); - + m_user_origin_button = new wxButton( this, wxID_ANY, _("Use Local Origin"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_user_origin_button, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + bSizer4->Add( m_user_origin_button, 1, wxALL|wxEXPAND, 5 ); + m_grid_origin_button = new wxButton( this, wxID_ANY, _("Use Grid Origin"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_grid_origin_button, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + bSizer4->Add( m_grid_origin_button, 1, wxALL|wxEXPAND, 5 ); + m_select_anchor_button = new wxButton( this, wxID_ANY, _("Select Item..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); m_select_anchor_button->SetToolTip( _("Click and select a board item.\nThe anchor position will be the position of the selected item.") ); - - bSizer4->Add( m_select_anchor_button, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + bSizer4->Add( m_select_anchor_button, 1, wxALL|wxEXPAND, 5 ); + + bUpperSizer->Add( bSizer4, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + wxBoxSizer* bSizer6; bSizer6 = new wxBoxSizer( wxVERTICAL ); - + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer6->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - + + bUpperSizer->Add( bSizer6, 0, wxEXPAND|wxTOP, 3 ); - - + + bMainSizer->Add( bUpperSizer, 0, wxEXPAND|wxALL, 5 ); - + wxFlexGridSizer* fgSizer2; fgSizer2 = new wxFlexGridSizer( 0, 5, 5, 0 ); fgSizer2->AddGrowableCol( 1 ); fgSizer2->SetFlexibleDirection( wxBOTH ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + m_xLabel = new wxStaticText( this, wxID_ANY, _("Offset X:"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_xLabel->Wrap( -1 ); fgSizer2->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); - + m_xEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer2->Add( m_xEntry, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_xUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_xUnit->Wrap( -1 ); fgSizer2->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxTOP|wxRIGHT, 5 ); - - + + fgSizer2->Add( 10, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - + m_clearX = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); fgSizer2->Add( m_clearX, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_yLabel = new wxStaticText( this, wxID_ANY, _("Offset Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_yLabel->Wrap( -1 ); fgSizer2->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - + m_yEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer2->Add( m_yEntry, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - + m_yUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_yUnit->Wrap( -1 ); fgSizer2->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - + + fgSizer2->Add( 10, 0, 1, wxEXPAND, 5 ); - + m_clearY = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); fgSizer2->Add( m_clearY, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - + + bMainSizer->Add( fgSizer2, 1, wxEXPAND|wxALL, 10 ); - + wxBoxSizer* bSizer5; bSizer5 = new wxBoxSizer( wxVERTICAL ); - + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer5->Add( m_staticline1, 0, wxEXPAND|wxALL, 5 ); - - + + bMainSizer->Add( bSizer5, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - + wxBoxSizer* bSizerBottom; bSizerBottom = new wxBoxSizer( wxHORIZONTAL ); - + m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Use polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 ); - m_polarCoords->SetValue(true); - bSizerBottom->Add( m_polarCoords, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); - - + bSizerBottom->Add( m_polarCoords, 0, wxEXPAND|wxALL, 5 ); + + bSizerBottom->Add( 40, 0, 1, wxEXPAND, 5 ); - + 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(); - - bSizerBottom->Add( m_stdButtons, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - + + bSizerBottom->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( bSizerBottom, 0, wxEXPAND|wxLEFT, 5 ); - - + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); - + // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClose ) ); m_user_origin_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnUseUserOriginClick ), NULL, this ); @@ -163,5 +162,5 @@ DIALOG_POSITION_RELATIVE_BASE::~DIALOG_POSITION_RELATIVE_BASE() m_clearY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClear ), NULL, this ); m_polarCoords->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnPolarChanged ), NULL, this ); m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnOkClick ), NULL, this ); - + } diff --git a/pcbnew/dialogs/dialog_position_relative_base.fbp b/pcbnew/dialogs/dialog_position_relative_base.fbp index 75ba3e2ec9..cf3b0c9ce2 100644 --- a/pcbnew/dialogs/dialog_position_relative_base.fbp +++ b/pcbnew/dialogs/dialog_position_relative_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,8 @@ dialog_position_relative_base 1000 none + + 1 DIALOG_POSITION_RELATIVE_BASE @@ -24,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -52,42 +55,7 @@ - - - - - - - - - OnClose - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer @@ -104,7 +72,7 @@ none 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALL 0 1 @@ -135,6 +103,7 @@ 0 wxID_ANY Reference item: <none selected> + 0 0 @@ -160,29 +129,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -206,7 +152,7 @@ none 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + wxALL|wxEXPAND 1 1 @@ -219,25 +165,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Use Local Origin + + 0 0 @@ -252,6 +204,8 @@ protected 1 + + Resizable 1 @@ -267,34 +221,11 @@ OnUseUserOriginClick - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + wxALL|wxEXPAND 1 1 @@ -307,25 +238,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Use Grid Origin + + 0 0 @@ -340,6 +277,8 @@ protected 1 + + Resizable 1 @@ -355,34 +294,11 @@ OnUseGridOriginClick - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + wxALL|wxEXPAND 1 1 @@ -395,25 +311,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Select Item... + + 0 0 @@ -428,6 +350,8 @@ protected 1 + + Resizable 1 @@ -443,29 +367,6 @@ OnSelectItemClick - - - - - - - - - - - - - - - - - - - - - - - @@ -535,29 +436,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -613,6 +491,7 @@ 0 wxID_ANY Offset X: + 0 0 @@ -638,29 +517,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -725,33 +581,7 @@ - - - - - OnTextFocusLost - - - - - - - - - - - - - - - - - - - - - @@ -787,6 +617,7 @@ 0 wxID_ANY mm + 0 0 @@ -812,29 +643,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -862,25 +670,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Reset + + 0 0 @@ -895,6 +709,8 @@ protected 1 + + Resizable 1 @@ -910,29 +726,6 @@ OnClear - - - - - - - - - - - - - - - - - - - - - - - @@ -968,6 +761,7 @@ 0 wxID_ANY Offset Y: + 0 0 @@ -993,29 +787,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1080,33 +851,7 @@ - - - - - OnTextFocusLost - - - - - - - - - - - - - - - - - - - - - @@ -1142,6 +887,7 @@ 0 wxID_ANY mm + 0 0 @@ -1167,29 +913,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1217,25 +940,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Reset + + 0 0 @@ -1250,6 +979,8 @@ protected 1 + + Resizable 1 @@ -1265,29 +996,6 @@ OnClear - - - - - - - - - - - - - - - - - - - - - - - @@ -1357,29 +1065,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1395,7 +1080,7 @@ none 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL + wxEXPAND|wxALL 0 1 @@ -1411,7 +1096,7 @@ 1 0 - 1 + 0 1 1 @@ -1455,30 +1140,7 @@ - OnPolarChanged - - - - - - - - - - - - - - - - - - - - - - @@ -1493,7 +1155,7 @@ 5 - wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL + wxALL|wxEXPAND 0 0 @@ -1507,14 +1169,7 @@ m_stdButtons protected - - - - - OnOkClick - - diff --git a/pcbnew/dialogs/dialog_position_relative_base.h b/pcbnew/dialogs/dialog_position_relative_base.h index 7966d767e5..876e360704 100644 --- a/pcbnew/dialogs/dialog_position_relative_base.h +++ b/pcbnew/dialogs/dialog_position_relative_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_POSITION_RELATIVE_BASE_H__ -#define __DIALOG_POSITION_RELATIVE_BASE_H__ +#pragma once #include #include @@ -18,6 +17,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -34,7 +36,7 @@ class DIALOG_POSITION_RELATIVE_BASE : public DIALOG_SHIM { private: - + protected: wxStaticText* m_referenceInfo; wxButton* m_user_origin_button; @@ -54,7 +56,7 @@ class DIALOG_POSITION_RELATIVE_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; - + // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnUseUserOriginClick( wxCommandEvent& event ) { event.Skip(); } @@ -64,13 +66,12 @@ class DIALOG_POSITION_RELATIVE_BASE : public DIALOG_SHIM virtual void OnClear( wxCommandEvent& event ) { event.Skip(); } virtual void OnPolarChanged( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_POSITION_RELATIVE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Position Relative To Reference Item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_POSITION_RELATIVE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Position Relative To Reference Item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_POSITION_RELATIVE_BASE(); - + }; -#endif //__DIALOG_POSITION_RELATIVE_BASE_H__