KiCad PCB EDA Suite
dialog_move_exact.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014 John Beard, john.j.beard@gmail.com
5  * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef __DIALOG_MOVE_EXACT__
26 #define __DIALOG_MOVE_EXACT__
27 
28 #include <vector>
29 // Include the wxFormBuider header base:
30 #include <dialog_move_exact_base.h>
31 
33 {
39 };
40 
41 
43 {
47 };
48 
49 
51 {
53  double rotation = 0;
56  bool allowOverride = true;
57  bool editingFootprint = false;
58 };
59 
60 
62 {
63 private:
64 
67  double& m_rotation;
72 
73 public:
74  // Constructor and destructor
77 
78 private:
79 
83  void OnTextFocusLost( wxFocusEvent& event ) override;
84 
85  void OnPolarChanged( wxCommandEvent& event ) override;
86  void OnClear( wxCommandEvent& event ) override;
87 
88  void OnOriginChanged( wxCommandEvent& event ) override;
89  void OnOverrideChanged( wxCommandEvent& event ) override;
90 
91  // Automatically called when clicking on the OK button
92  bool TransferDataFromWindow() override;
93 
100  void ToPolarDeg( double x, double y, double& r, double& q );
101 
108  bool GetTranslationInIU ( wxPoint& val, bool polar );
109 
110  // Update texts (comments) after changing the coordinates type (polar/cartesian)
111  void updateDlgTexts( bool aPolar );
112 
117  {
119  double entry1;
120  double entry2;
125 
127  polarCoords( false ),
128  entry1( 0 ),
129  entry2( 0 ),
130  entryRotation( 0 ),
132  anchor( ANCHOR_FROM_LIBRARY ),
133  overrideAnchor( false )
134  {
135  }
136  };
137 
138  // persistent settings
140 };
141 
142 #endif // __DIALOG_MOVE_EXACT__
143 
MOVE_EXACT_ORIGIN
Class DIALOG_MOVE_EXACT_BASE.
MOVE_EXACT_ORIGIN origin
MOVE_EXACT_ORIGIN & m_origin
MOVE_EXACT_ANCHOR
MOVE_EXACT_ANCHOR & m_anchor
static MOVE_EXACT_OPTIONS m_options
PCB_BASE_FRAME * m_parent
MOVE_EXACT_ANCHOR anchor
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...