KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_constraint_value.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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef DIALOG_CONSTRAINT_VALUE_H_
21#define DIALOG_CONSTRAINT_VALUE_H_
22
24
26
27class BOARD_COMMIT;
28class PCB_BASE_FRAME;
29class PCB_CONSTRAINT;
30class UNIT_BINDER;
31
32
38bool EditConstraintValue( PCB_BASE_FRAME* aFrame, PCB_CONSTRAINT* aConstraint,
39 BOARD_COMMIT& aCommit );
40
41
47{
48public:
49 DIALOG_CONSTRAINT_VALUE( PCB_BASE_FRAME* aParent, PCB_CONSTRAINT_TYPE aType, double aValue,
50 bool aDriving );
51 ~DIALOG_CONSTRAINT_VALUE() override;
52
54 double GetConstraintValue();
55
57 bool GetDriving() const;
58
60 bool TransferDataFromWindow() override;
61
62private:
64 void updateValueEnabled();
65
69};
70
71#endif // DIALOG_CONSTRAINT_VALUE_H_
DIALOG_CONSTRAINT_VALUE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Constraint Value"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE)
bool GetDriving() const
True if the constraint should drive (lock) the geometry; false for a reference dimension.
DIALOG_CONSTRAINT_VALUE(PCB_BASE_FRAME *aParent, PCB_CONSTRAINT_TYPE aType, double aValue, bool aDriving)
double GetConstraintValue()
The entered value, in IU for a length/radius or in degrees for an angle.
bool TransferDataFromWindow() override
Veto an angle outside the closed [0, 180] degree corner-angle range.
void updateValueEnabled()
A reference (non-driving) constraint only measures, so its value is read-only.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
A geometric constraint between board items (issue #2329).
bool EditConstraintValue(PCB_BASE_FRAME *aFrame, PCB_CONSTRAINT *aConstraint, BOARD_COMMIT &aCommit)
Show the value dialog for a valued constraint and stage the change in aCommit (the caller pushes).
PCB_CONSTRAINT_TYPE
The geometric relationship a PCB_CONSTRAINT enforces between its members.