KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_constraints.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
21#ifndef PANEL_SETUP_CONSTRAINTS_H
22#define PANEL_SETUP_CONSTRAINTS_H
23
24#include <vector>
25
26#include <wx/timer.h>
27
29#include <widgets/unit_binder.h>
31
34class PAGED_DIALOG;
35class PCB_EDIT_FRAME;
36class wxCommandEvent;
37class wxPopupTransientWindow;
38
39
41{
42public:
47 PANEL_SETUP_CONSTRAINTS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame, DRC_RULE_DOCUMENT* aDocument,
48 BOARD_DESIGN_SETTINGS& aSettings );
49 ~PANEL_SETUP_CONSTRAINTS( ) override { };
50
52 static void CopySettings( const BOARD_DESIGN_SETTINGS& aFrom, BOARD_DESIGN_SETTINGS& aTo );
53
58 void RefreshDefaults();
59
60private:
61 bool TransferDataToWindow() override;
62 bool TransferDataFromWindow() override;
63
64 void applyValues( BOARD_DESIGN_SETTINGS& aSettings ) const;
65
67 void updateWarnings();
68
70 void showOverridingRules( const wxString& aSetting, wxWindow* aAnchor, bool aFromHover );
71
73 void closeHoveredPopup();
74
76 {
77 wxString m_Setting;
78 wxWindow* m_Ctrl;
82
85
88 int m_Loaded = 0;
89 };
90
91public:
108
109private:
113
116
119 std::vector<CONSTRAINT_FIELD> m_fields;
121
123 wxPopupTransientWindow* m_popup = nullptr;
124
126 wxWindow* m_popupAnchor = nullptr;
127
129 bool m_popupFromHover = false;
130
133 wxWindow* m_hoverAnchor = nullptr;
134
137
139 wxWindow* m_mutedField = nullptr;
140 wxString m_mutedTip;
141};
142
143#endif //PANEL_SETUP_CONSTRAINTS_H
Container for design settings for a BOARD object.
The custom rules of one board, held in memory while Board Setup is open.
A warning icon drawn inside the right edge of a field, left of its dropdown button when it has one,...
PANEL_SETUP_CONSTRAINTS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
PANEL_SETUP_CONSTRAINTS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame, DRC_RULE_DOCUMENT *aDocument, BOARD_DESIGN_SETTINGS &aSettings)
wxPopupTransientWindow * m_popup
The popup a hover or a click opened, while it is up.
void RefreshDefaults()
Reads the values a rule page edits back into their fields.
wxString m_hoverSetting
The field a hover is waiting to open, and the icon it would hang under.
static void CopySettings(const BOARD_DESIGN_SETTINGS &aFrom, BOARD_DESIGN_SETTINGS &aTo)
Copies every value this page edits, which is what the Constraints import group carries.
void closeHoveredPopup()
Close a popup opened by hovering once the pointer has left both it and its icon.
std::vector< CONSTRAINT_FIELD > m_fields
int m_spokeCountLoaded
The spoke count as this page last read it.
BOARD_DESIGN_SETTINGS * m_BrdSettings
wxString m_spokeCountPage
The rule page that also holds the spoke count, a spin control rather than a bound field.
void showOverridingRules(const wxString &aSetting, wxWindow *aAnchor, bool aFromHover)
Pop up what a board constraint is read with, each entry a link to where it is set.
wxWindow * m_popupAnchor
The icon that popup belongs to, which the pointer may return to without closing it.
bool m_popupFromHover
A popup a click opened stays until it is dismissed; one a hover opened follows the pointer.
void applyValues(BOARD_DESIGN_SETTINGS &aSettings) const
wxWindow * m_mutedField
The field whose own help is held back while a popup covers it, and the text to give back.
void updateWarnings()
Show a warning icon, with the reason as its tooltip, over each field whose value has an issue.
The main frame for Pcbnew.
int m_Loaded
The value as this page last read it, so an untouched field does not write back over an edit made to t...
FIELD_WARNING_ICON * m_Override
Opens the list of what this value is read with, where anything else can set it.