KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_position_relative.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#pragma once
25
26// Include the wxFormBuider header base:
27#include <vector>
29
30#include <tool/tool_manager.h>
31#include <widgets/unit_binder.h>
33
36{
37public:
38 // Constructor and destructor
41
42 // Implement the RECEIVER interface for the callback from the TOOL
43 void UpdatePickedItem( const EDA_ITEM* aItem ) override;
44 void UpdatePickedPoint( const std::optional<VECTOR2I>& aPoint ) override;
45
46private:
50 void OnTextFocusLost( wxFocusEvent& event ) override;
51
52 void OnPolarChanged( wxCommandEvent& event ) override;
53 void OnClear( wxCommandEvent& event ) override;
54
55 void OnSelectItemClick( wxCommandEvent& event ) override;
56 void OnSelectPointClick( wxCommandEvent& event ) override;
57 void OnUseGridOriginClick( wxCommandEvent& event ) override;
58 void OnUseUserOriginClick( wxCommandEvent& event ) override;
59 void OnOkClick( wxCommandEvent& event ) override;
60
66 void ToPolarDeg( double x, double y, double& r, EDA_ANGLE& q );
67
75 bool getTranslationInIU( VECTOR2I& val, bool polar );
76
77 // Update controls and their labels after changing the coordinates type (polar/cartesian)
78 void updateDialogControls( bool aPolar );
79
80 // Update controls and labels after changing anchor type
81 void updateAnchorInfo( const BOARD_ITEM* aItem );
82
83 // Get the current anchor position.
85
86private:
91 {
96 };
97
99
100private:
103
106
107 double m_stateX;
108 double m_stateY;
111};
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Class DIALOG_POSITION_RELATIVE_BASE.
bool getTranslationInIU(VECTOR2I &val, bool polar)
Get the (Cartesian) translation described by the text entries.
void OnUseGridOriginClick(wxCommandEvent &event) override
void OnPolarChanged(wxCommandEvent &event) override
void OnOkClick(wxCommandEvent &event) override
void OnClear(wxCommandEvent &event) override
~DIALOG_POSITION_RELATIVE()=default
void OnSelectItemClick(wxCommandEvent &event) override
void UpdatePickedPoint(const std::optional< VECTOR2I > &aPoint) override
void OnSelectPointClick(wxCommandEvent &event) override
void UpdatePickedItem(const EDA_ITEM *aItem) override
void OnTextFocusLost(wxFocusEvent &event) override
Reset a text field to be 0 if it was exited while blank.
void OnUseUserOriginClick(wxCommandEvent &event) override
ANCHOR_TYPE
Persistent dialog options.
void ToPolarDeg(double x, double y, double &r, EDA_ANGLE &q)
Convert a given Cartesian point into a polar representation.
void updateAnchorInfo(const BOARD_ITEM *aItem)
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:98
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
Interface class for something that receives picked points or items from this tool.
Master controller class:
Definition: tool_manager.h:62