KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_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#ifndef PANEL_CONSTRAINTS_H_
21#define PANEL_CONSTRAINTS_H_
22
23#include <vector>
24
25#include <kiid.h>
27
31class wxMouseEvent;
32
33
44{
45public:
47
49 void RefreshList();
50
53 void RefreshList( const BOARD_CONSTRAINT_DIAGNOSTICS& aDiag );
54
56 void SelectConstraint( const KIID& aConstraint );
57
58private:
62
64 const KIID& rowConstraint( long aRow ) const;
65
68 long columnAt( long aRow, const wxPoint& aPos ) const;
69
70 void onLeftDown( wxMouseEvent& aEvent );
71 void onRowActivated( wxListEvent& aEvent ) override;
72 void onDelete( wxCommandEvent& aEvent ) override;
73 void onRefresh( wxCommandEvent& aEvent ) override;
74
76 std::vector<KIID> m_rows;
77};
78
79#endif // PANEL_CONSTRAINTS_H_
Interactive authoring of geometric constraints (issue #2329).
Definition kiid.h:44
PANEL_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)
PCB_BASE_EDIT_FRAME * m_frame
void RefreshList()
Rebuild the rows from the board's current constraints (solving the board diagnosis here).
long columnAt(long aRow, const wxPoint &aPos) const
The list column under aPos within row aRow, or -1.
std::vector< KIID > m_rows
void onRefresh(wxCommandEvent &aEvent) override
void onDelete(wxCommandEvent &aEvent) override
void onLeftDown(wxMouseEvent &aEvent)
const KIID & rowConstraint(long aRow) const
The KIID for a row, or niluuid if out of range.
void onRowActivated(wxListEvent &aEvent) override
void SelectConstraint(const KIID &aConstraint)
Select and reveal the row for aConstraint (e.g. when its badge is clicked on canvas).
PANEL_CONSTRAINTS(PCB_BASE_EDIT_FRAME *aFrame)
CONSTRAINT_EDIT_TOOL * constraintTool() const
The owning constraint tool, which performs all board mutation and selection; the panel only displays ...
Common, abstract interface for edit frames.
Board-wide diagnostics for the constraint overlay and info bar.