KiCad PCB EDA Suite
dialog_position_relative_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 30 2017)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
11 
12 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 )
13 {
14  this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
15 
16  wxBoxSizer* bMainSizer;
17  bMainSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bUpperSizer;
20  bUpperSizer = new wxBoxSizer( wxVERTICAL );
21 
22  m_referenceInfo = new wxStaticText( this, wxID_ANY, _("Reference item: <none selected>"), wxDefaultPosition, wxDefaultSize, 0 );
23  m_referenceInfo->Wrap( -1 );
24  m_referenceInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
25  m_referenceInfo->SetMinSize( wxSize( 340,-1 ) );
26 
27  bUpperSizer->Add( m_referenceInfo, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
28 
29 
30  bUpperSizer->Add( 0, 0, 0, wxEXPAND, 5 );
31 
32  wxBoxSizer* bSizer4;
33  bSizer4 = new wxBoxSizer( wxHORIZONTAL );
34 
35  m_user_origin_button = new wxButton( this, wxID_ANY, _("Use Local Origin"), wxDefaultPosition, wxDefaultSize, 0 );
36  bSizer4->Add( m_user_origin_button, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
37 
38  m_grid_origin_button = new wxButton( this, wxID_ANY, _("Use Grid Origin"), wxDefaultPosition, wxDefaultSize, 0 );
39  bSizer4->Add( m_grid_origin_button, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
40 
41  m_select_anchor_button = new wxButton( this, wxID_ANY, _("Select Item..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
42  m_select_anchor_button->SetToolTip( _("Click and select a board item.\nThe anchor position will be the position of the selected item.") );
43 
44  bSizer4->Add( m_select_anchor_button, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
45 
46 
47  bUpperSizer->Add( bSizer4, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
48 
49  wxBoxSizer* bSizer6;
50  bSizer6 = new wxBoxSizer( wxVERTICAL );
51 
52  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
53  bSizer6->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
54 
55 
56  bUpperSizer->Add( bSizer6, 0, wxEXPAND|wxTOP, 3 );
57 
58 
59  bMainSizer->Add( bUpperSizer, 0, wxEXPAND|wxALL, 5 );
60 
61  wxFlexGridSizer* fgSizer2;
62  fgSizer2 = new wxFlexGridSizer( 0, 5, 5, 0 );
63  fgSizer2->AddGrowableCol( 1 );
64  fgSizer2->SetFlexibleDirection( wxBOTH );
65  fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
66 
67  m_xLabel = new wxStaticText( this, wxID_ANY, _("Offset X:"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
68  m_xLabel->Wrap( -1 );
69  fgSizer2->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
70 
71  m_xEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
72  fgSizer2->Add( m_xEntry, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
73 
74  m_xUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
75  m_xUnit->Wrap( -1 );
76  fgSizer2->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxTOP|wxRIGHT, 5 );
77 
78 
79  fgSizer2->Add( 10, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
80 
81  m_clearX = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
82  fgSizer2->Add( m_clearX, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
83 
84  m_yLabel = new wxStaticText( this, wxID_ANY, _("Offset Y:"), wxDefaultPosition, wxDefaultSize, 0 );
85  m_yLabel->Wrap( -1 );
86  fgSizer2->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
87 
88  m_yEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
89  fgSizer2->Add( m_yEntry, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
90 
91  m_yUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
92  m_yUnit->Wrap( -1 );
93  fgSizer2->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
94 
95 
96  fgSizer2->Add( 10, 0, 1, wxEXPAND, 5 );
97 
98  m_clearY = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
99  fgSizer2->Add( m_clearY, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
100 
101 
102  bMainSizer->Add( fgSizer2, 1, wxEXPAND|wxALL, 10 );
103 
104  wxBoxSizer* bSizer5;
105  bSizer5 = new wxBoxSizer( wxVERTICAL );
106 
107  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
108  bSizer5->Add( m_staticline1, 0, wxEXPAND|wxALL, 5 );
109 
110 
111  bMainSizer->Add( bSizer5, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
112 
113  wxBoxSizer* bSizerBottom;
114  bSizerBottom = new wxBoxSizer( wxHORIZONTAL );
115 
116  m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Use polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 );
117  m_polarCoords->SetValue(true);
118  bSizerBottom->Add( m_polarCoords, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 );
119 
120 
121  bSizerBottom->Add( 40, 0, 1, wxEXPAND, 5 );
122 
123  m_stdButtons = new wxStdDialogButtonSizer();
124  m_stdButtonsOK = new wxButton( this, wxID_OK );
125  m_stdButtons->AddButton( m_stdButtonsOK );
126  m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
127  m_stdButtons->AddButton( m_stdButtonsCancel );
128  m_stdButtons->Realize();
129 
130  bSizerBottom->Add( m_stdButtons, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
131 
132 
133  bMainSizer->Add( bSizerBottom, 0, wxEXPAND|wxLEFT, 5 );
134 
135 
136  this->SetSizer( bMainSizer );
137  this->Layout();
138  bMainSizer->Fit( this );
139 
140  // Connect Events
141  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClose ) );
142  m_user_origin_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnUseUserOriginClick ), NULL, this );
143  m_grid_origin_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnUseGridOriginClick ), NULL, this );
144  m_select_anchor_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnSelectItemClick ), NULL, this );
145  m_xEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnTextFocusLost ), NULL, this );
146  m_clearX->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClear ), NULL, this );
147  m_yEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnTextFocusLost ), NULL, this );
148  m_clearY->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClear ), NULL, this );
149  m_polarCoords->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnPolarChanged ), NULL, this );
150  m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnOkClick ), NULL, this );
151 }
152 
154 {
155  // Disconnect Events
156  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClose ) );
157  m_user_origin_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnUseUserOriginClick ), NULL, this );
158  m_grid_origin_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnUseGridOriginClick ), NULL, this );
159  m_select_anchor_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnSelectItemClick ), NULL, this );
160  m_xEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnTextFocusLost ), NULL, this );
161  m_clearX->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClear ), NULL, this );
162  m_yEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnTextFocusLost ), NULL, this );
163  m_clearY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnClear ), NULL, this );
164  m_polarCoords->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnPolarChanged ), NULL, this );
165  m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_POSITION_RELATIVE_BASE::OnOkClick ), NULL, this );
166 
167 }
virtual void OnPolarChanged(wxCommandEvent &event)
virtual void OnOkClick(wxCommandEvent &event)
virtual void OnSelectItemClick(wxCommandEvent &event)
virtual void OnClose(wxCloseEvent &event)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:82
virtual void OnUseUserOriginClick(wxCommandEvent &event)
virtual void OnClear(wxCommandEvent &event)
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)
virtual void OnTextFocusLost(wxFocusEvent &event)
virtual void OnUseGridOriginClick(wxCommandEvent &event)