KiCad PCB EDA Suite
dialog_move_exact_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Oct 17 2016)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
9 
10 #include "dialog_move_exact_base.h"
11 
13 
14 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 )
15 {
16  this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
17 
18  bMainSizer = new wxBoxSizer( wxVERTICAL );
19 
20  m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Use polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 );
21  bMainSizer->Add( m_polarCoords, 0, wxALL|wxEXPAND, 5 );
22 
23  wxBoxSizer* bMiddleSizer;
24  bMiddleSizer = new wxBoxSizer( wxHORIZONTAL );
25 
26  wxFlexGridSizer* fgInputSizer;
27  fgInputSizer = new wxFlexGridSizer( 0, 4, 0, 0 );
28  fgInputSizer->AddGrowableCol( 1 );
29  fgInputSizer->SetFlexibleDirection( wxBOTH );
30  fgInputSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
31 
32  m_xLabel = new wxStaticText( this, wxID_ANY, _("x:"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
33  m_xLabel->Wrap( -1 );
34  fgInputSizer->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
35 
36  m_xEntry = new TEXT_CTRL_EVAL( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
37  fgInputSizer->Add( m_xEntry, 0, wxALL|wxEXPAND, 5 );
38 
39  m_xUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
40  m_xUnit->Wrap( -1 );
41  fgInputSizer->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
42 
43  m_clearX = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
44  fgInputSizer->Add( m_clearX, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
45 
46  m_yLabel = new wxStaticText( this, wxID_ANY, _("y:"), wxDefaultPosition, wxDefaultSize, 0 );
47  m_yLabel->Wrap( -1 );
48  fgInputSizer->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
49 
50  m_yEntry = new TEXT_CTRL_EVAL( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
51  fgInputSizer->Add( m_yEntry, 0, wxALL|wxEXPAND, 5 );
52 
53  m_yUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
54  m_yUnit->Wrap( -1 );
55  fgInputSizer->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
56 
57  m_clearY = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
58  fgInputSizer->Add( m_clearY, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
59 
60  m_rotLabel = new wxStaticText( this, wxID_ANY, _("Item rotation:"), wxDefaultPosition, wxDefaultSize, 0 );
61  m_rotLabel->Wrap( -1 );
62  fgInputSizer->Add( m_rotLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
63 
64  m_rotEntry = new TEXT_CTRL_EVAL( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
65  fgInputSizer->Add( m_rotEntry, 0, wxALL|wxEXPAND, 5 );
66 
67  m_rotUnit = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
68  m_rotUnit->Wrap( -1 );
69  fgInputSizer->Add( m_rotUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
70 
71  m_clearRot = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
72  fgInputSizer->Add( m_clearRot, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
73 
74 
75  bMiddleSizer->Add( fgInputSizer, 1, wxALL|wxBOTTOM|wxEXPAND|wxTOP, 5 );
76 
77  wxString m_originChooserChoices[] = { _("Current Position"), _("User Origin"), _("Grid Origin"), _("Drill/Place Origin"), _("Sheet Origin") };
78  int m_originChooserNChoices = sizeof( m_originChooserChoices ) / sizeof( wxString );
79  m_originChooser = new wxRadioBox( this, wxID_ANY, _("Move relative to:"), wxDefaultPosition, wxDefaultSize, m_originChooserNChoices, m_originChooserChoices, 1, wxRA_SPECIFY_COLS );
80  m_originChooser->SetSelection( 0 );
81  bMiddleSizer->Add( m_originChooser, 0, wxALL, 5 );
82 
83 
84  bMainSizer->Add( bMiddleSizer, 1, wxEXPAND, 5 );
85 
86  bAnchorSizer = new wxBoxSizer( wxHORIZONTAL );
87 
88  m_cbOverride = new wxCheckBox( this, wxID_ANY, _("Override default component anchor with:"), wxDefaultPosition, wxDefaultSize, 0 );
89  bAnchorSizer->Add( m_cbOverride, 1, wxALL, 5 );
90 
91  wxString m_anchorChoiceChoices[] = { _("Top left pad"), _("Footprint center") };
92  int m_anchorChoiceNChoices = sizeof( m_anchorChoiceChoices ) / sizeof( wxString );
93  m_anchorChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_anchorChoiceNChoices, m_anchorChoiceChoices, 0 );
94  m_anchorChoice->SetSelection( 0 );
95  bAnchorSizer->Add( m_anchorChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
96 
97 
98  bMainSizer->Add( bAnchorSizer, 0, wxEXPAND, 5 );
99 
100  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
101  bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
102 
103  m_stdButtons = new wxStdDialogButtonSizer();
104  m_stdButtonsOK = new wxButton( this, wxID_OK );
105  m_stdButtons->AddButton( m_stdButtonsOK );
106  m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
107  m_stdButtons->AddButton( m_stdButtonsCancel );
108  m_stdButtons->Realize();
109 
110  bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 );
111 
112 
113  this->SetSizer( bMainSizer );
114  this->Layout();
115 
116  // Connect Events
117  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_MOVE_EXACT_BASE::OnClose ) );
118  m_polarCoords->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnPolarChanged ), NULL, this );
119  m_xEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
120  m_clearX->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
121  m_yEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
122  m_clearY->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
123  m_rotEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
124  m_clearRot->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
125  m_originChooser->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOriginChanged ), NULL, this );
126  m_cbOverride->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOverrideChanged ), NULL, this );
127  m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOkClick ), NULL, this );
128 }
129 
131 {
132  // Disconnect Events
133  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_MOVE_EXACT_BASE::OnClose ) );
134  m_polarCoords->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnPolarChanged ), NULL, this );
135  m_xEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
136  m_clearX->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
137  m_yEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
138  m_clearY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
139  m_rotEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
140  m_clearRot->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
141  m_originChooser->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOriginChanged ), NULL, this );
142  m_cbOverride->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOverrideChanged ), NULL, this );
143  m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOkClick ), NULL, this );
144 
145 }
virtual void OnOkClick(wxCommandEvent &event)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:60
virtual void OnOriginChanged(wxCommandEvent &event)
virtual void OnClear(wxCommandEvent &event)
virtual void OnTextFocusLost(wxFocusEvent &event)
virtual void OnPolarChanged(wxCommandEvent &event)
wxTextCtrl wrapper to handle math expression evaluation.
virtual void OnOverrideChanged(wxCommandEvent &event)
DIALOG_MOVE_EXACT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Move Item"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(509, 277), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnClose(wxCloseEvent &event)
wxStdDialogButtonSizer * m_stdButtons