KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_re_object_selector_panel.h
Go to the documentation of this file.
1#pragma once
2
3#include <wx/panel.h>
4#include <functional>
5
6class BOARD;
7class NET_SELECTOR;
9class AREA_SELECTOR;
10
11class wxStaticText;
12class wxChoice;
13class wxBoxSizer;
14class wxStyledTextCtrl;
15
19class DRC_RE_OBJECT_SELECTOR_PANEL : public wxPanel
20{
21public:
22 DRC_RE_OBJECT_SELECTOR_PANEL( wxWindow* parent, BOARD* board, const wxString& label );
23
24 void SetLabelText( const wxString& text );
25 void SetCustomQueryCtrl( wxStyledTextCtrl* ctrl );
26
33 void ParseCondition( const wxString& aExpr, const wxString& aPrefix = wxEmptyString );
34
41 wxString BuildCondition( const wxString& aPrefix ) const;
42
46 bool HasCustomQuerySelected() const;
47
51 void SetChoiceChangeCallback( std::function<void()> aCallback )
52 {
53 m_choiceChangeCallback = aCallback;
54 }
55
56private:
57 void onChoice( const wxCommandEvent& aEvent );
58
59 wxStaticText* m_label;
60 wxChoice* m_choice;
64 wxStyledTextCtrl* m_customQueryCtrl;
65 wxBoxSizer* m_rowSizer;
66
67 std::function<void()> m_choiceChangeCallback;
68};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
void SetChoiceChangeCallback(std::function< void()> aCallback)
Set a callback to be invoked when the choice selection changes.
void ParseCondition(const wxString &aExpr, const wxString &aPrefix=wxEmptyString)
Populate the panel controls from a rule condition expression.
void SetCustomQueryCtrl(wxStyledTextCtrl *ctrl)
void onChoice(const wxCommandEvent &aEvent)
DRC_RE_OBJECT_SELECTOR_PANEL(wxWindow *parent, BOARD *board, const wxString &label)
wxString BuildCondition(const wxString &aPrefix) const
Build a rule condition expression based on the panel state.