KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DRC_RE_OBJECT_SELECTOR_PANEL Class Reference

Panel used in the rule editor conditions to select object filters. More...

#include <drc_re_object_selector_panel.h>

Inheritance diagram for DRC_RE_OBJECT_SELECTOR_PANEL:

Public Member Functions

 DRC_RE_OBJECT_SELECTOR_PANEL (wxWindow *parent, BOARD *board, const wxString &label)
 
void SetLabelText (const wxString &text)
 
void SetCustomQueryCtrl (wxStyledTextCtrl *ctrl)
 
void ParseCondition (const wxString &aExpr, const wxString &aPrefix=wxEmptyString)
 Populate the panel controls from a rule condition expression.
 
wxString BuildCondition (const wxString &aPrefix) const
 Build a rule condition expression based on the panel state.
 
bool HasCustomQuerySelected () const
 
void SetChoiceChangeCallback (std::function< void()> aCallback)
 Set a callback to be invoked when the choice selection changes.
 

Private Member Functions

void onChoice (const wxCommandEvent &aEvent)
 

Private Attributes

wxStaticText * m_label
 
wxChoice * m_choice
 
NET_SELECTORm_netSelector
 
NETCLASS_SELECTORm_netclassSelector
 
AREA_SELECTORm_areaSelector
 
wxStyledTextCtrl * m_customQueryCtrl
 
wxBoxSizer * m_rowSizer
 
std::function< void()> m_choiceChangeCallback
 

Detailed Description

Panel used in the rule editor conditions to select object filters.

Definition at line 19 of file drc_re_object_selector_panel.h.

Constructor & Destructor Documentation

◆ DRC_RE_OBJECT_SELECTOR_PANEL()

DRC_RE_OBJECT_SELECTOR_PANEL::DRC_RE_OBJECT_SELECTOR_PANEL ( wxWindow * parent,
BOARD * board,
const wxString & label )

Member Function Documentation

◆ BuildCondition()

wxString DRC_RE_OBJECT_SELECTOR_PANEL::BuildCondition ( const wxString & aPrefix) const

Build a rule condition expression based on the panel state.

Parameters
aPrefixobject designator ("A" or "B") used when the expression refers to a single object. Custom queries are returned verbatim without the prefix.

Definition at line 170 of file drc_re_object_selector_panel.cpp.

References m_areaSelector, m_choice, m_customQueryCtrl, m_netclassSelector, and m_netSelector.

◆ HasCustomQuerySelected()

bool DRC_RE_OBJECT_SELECTOR_PANEL::HasCustomQuerySelected ( ) const
Returns
true if the "Custom Query" option is selected.

Definition at line 104 of file drc_re_object_selector_panel.cpp.

References m_choice.

◆ onChoice()

void DRC_RE_OBJECT_SELECTOR_PANEL::onChoice ( const wxCommandEvent & aEvent)
private

◆ ParseCondition()

void DRC_RE_OBJECT_SELECTOR_PANEL::ParseCondition ( const wxString & aExpr,
const wxString & aPrefix = wxEmptyString )

Populate the panel controls from a rule condition expression.

Parameters
aExprthe rule expression without the surrounding (condition "...") wrapper
aPrefixoptional object designator ("A" or "B") that will be stripped if present

Definition at line 110 of file drc_re_object_selector_panel.cpp.

References m_areaSelector, m_choice, m_customQueryCtrl, m_netclassSelector, m_netSelector, and onChoice().

◆ SetChoiceChangeCallback()

void DRC_RE_OBJECT_SELECTOR_PANEL::SetChoiceChangeCallback ( std::function< void()> aCallback)
inline

Set a callback to be invoked when the choice selection changes.

Definition at line 51 of file drc_re_object_selector_panel.h.

References m_choiceChangeCallback.

◆ SetCustomQueryCtrl()

void DRC_RE_OBJECT_SELECTOR_PANEL::SetCustomQueryCtrl ( wxStyledTextCtrl * ctrl)

Definition at line 63 of file drc_re_object_selector_panel.cpp.

References m_customQueryCtrl.

◆ SetLabelText()

void DRC_RE_OBJECT_SELECTOR_PANEL::SetLabelText ( const wxString & text)

Definition at line 58 of file drc_re_object_selector_panel.cpp.

References m_label, and text.

Member Data Documentation

◆ m_areaSelector

AREA_SELECTOR* DRC_RE_OBJECT_SELECTOR_PANEL::m_areaSelector
private

◆ m_choice

wxChoice* DRC_RE_OBJECT_SELECTOR_PANEL::m_choice
private

◆ m_choiceChangeCallback

std::function<void()> DRC_RE_OBJECT_SELECTOR_PANEL::m_choiceChangeCallback
private

Definition at line 67 of file drc_re_object_selector_panel.h.

Referenced by onChoice(), and SetChoiceChangeCallback().

◆ m_customQueryCtrl

wxStyledTextCtrl* DRC_RE_OBJECT_SELECTOR_PANEL::m_customQueryCtrl
private

◆ m_label

wxStaticText* DRC_RE_OBJECT_SELECTOR_PANEL::m_label
private

Definition at line 59 of file drc_re_object_selector_panel.h.

Referenced by DRC_RE_OBJECT_SELECTOR_PANEL(), and SetLabelText().

◆ m_netclassSelector

NETCLASS_SELECTOR* DRC_RE_OBJECT_SELECTOR_PANEL::m_netclassSelector
private

◆ m_netSelector

NET_SELECTOR* DRC_RE_OBJECT_SELECTOR_PANEL::m_netSelector
private

◆ m_rowSizer

wxBoxSizer* DRC_RE_OBJECT_SELECTOR_PANEL::m_rowSizer
private

Definition at line 65 of file drc_re_object_selector_panel.h.

Referenced by DRC_RE_OBJECT_SELECTOR_PANEL().


The documentation for this class was generated from the following files: