KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_dimension_properties.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) 2020 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef KICAD_DIALOG_DIMENSION_PROPERTIES_H
22#define KICAD_DIALOG_DIMENSION_PROPERTIES_H
23
24#include <widgets/unit_binder.h>
25#include <wx/valnum.h>
26
28
29
30class BOARD_ITEM;
31class BOARD_COMMIT;
32class PCB_CONSTRAINT;
35
36enum class DIM_VALUE_MODE : int;
37
38
40{
41public:
43
45
46protected:
47 bool TransferDataToWindow() override;
48
49 bool TransferDataFromWindow() override;
50
51private:
52 void onFontSelected( wxCommandEvent &aEvent ) override;
53 void onBoldToggle( wxCommandEvent &aEvent ) override;
54 void onAlignButton( wxCommandEvent &aEvent ) override;
55 void onThickness( wxCommandEvent &aEvent ) override;
56
58
59 void updatePreviewText();
60
62 bool hasValueModeChoice() const;
63
66
69
72
74 bool valueFieldTracksMeasurement() const;
75
79
82 bool parseDrivingLength( int& aLengthIU ) const;
83
85 void resolveDrivingConstraint( PCB_CONSTRAINT* aConstraint );
86
87private:
89
92
93 PCB_LAYER_BOX_SELECTOR* m_cbLayerActual; // The active layer box control
94 wxTextCtrl* m_txtValueActual; // The active value control
95
96 // Units the value field is shown in captured on open not reformatted when units dropdown changes
98
99 // True when choice includes Driving entry with both endpoints bound indices shift when absent
101
107 UNIT_BINDER m_orientation; // rotation in degrees
112};
113
114
115#endif // KICAD_DIALOG_DIMENSION_PROPERTIES_H
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
DIALOG_DIMENSION_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Dimension Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU)
void onFontSelected(wxCommandEvent &aEvent) override
PCB_LAYER_BOX_SELECTOR * m_cbLayerActual
void buildValueModeChoice()
Populate the value-mode choice, offering the Driving entry only when DimensionCanDrive.
void onBoldToggle(wxCommandEvent &aEvent) override
PCB_CONSTRAINT * stageValueModeConstraint(BOARD_COMMIT &aCommit)
Stages FIXED_LENGTH constraint for the mode on aCommit Returns live driving constraint to re solve or...
DIM_VALUE_MODE selectedValueMode() const
The value mode the current choice selection represents.
bool parseDrivingLength(int &aLengthIU) const
Parses value field as Driving length into aLengthIU in internal units Returns false for non positive ...
void updateDimensionFromDialog(PCB_DIMENSION_BASE *aTarget)
DIALOG_DIMENSION_PROPERTIES(PCB_BASE_EDIT_FRAME *aParent, BOARD_ITEM *aItem)
void setValueModeSelection(DIM_VALUE_MODE aMode)
Select the choice entry for aMode, falling back to Driven when Driving is not offered.
bool valueFieldTracksMeasurement() const
True when field mirrors geometry in Driven mode refreshable by other edits.
void onAlignButton(wxCommandEvent &aEvent) override
void resolveDrivingConstraint(PCB_CONSTRAINT *aConstraint)
Re-solve so the geometry bound to a now-driving dimension follows its entered length.
bool hasValueModeChoice() const
True for value bearing dims aligned orthogonal or radial centre and leader have no value.
void onThickness(wxCommandEvent &aEvent) override
Common, abstract interface for edit frames.
A geometric constraint between board items (issue #2329).
Abstract dimension API.
Class to display a pcb layer list in a wxBitmapComboBox.
DIM_VALUE_MODE
Mode a value bearing dimension value is in Driven mirrors measured geometry Driving forces geometry t...
EDA_UNITS
Definition eda_units.h:44