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

Simple panel used for editing custom rule text. More...

#include <drc_re_custom_rule_panel.h>

Inheritance diagram for DRC_RE_CUSTOM_RULE_PANEL:
DRC_RULE_EDITOR_CONTENT_PANEL_BASE

Public Member Functions

 DRC_RE_CUSTOM_RULE_PANEL (wxWindow *aParent, std::shared_ptr< DRC_RE_CUSTOM_RULE_CONSTRAINT_DATA > aConstraintData)
 
 ~DRC_RE_CUSTOM_RULE_PANEL () override=default
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
bool ValidateInputs (int *aErrorCount, std::string *aValidationMessage) override
 
wxString GenerateRule (const RULE_GENERATION_CONTEXT &aContext) override
 
wxStaticBitmap * GetConstraintImage (wxPanel *aParent, BITMAPS aBitMap)
 

Protected Member Functions

wxString buildRule (const RULE_GENERATION_CONTEXT &aContext, const std::vector< wxString > &aConstraintClauses) const
 

Static Protected Member Functions

static wxString sanitizeRuleName (const wxString &aRuleName)
 
static wxString escapeCondition (const wxString &aCondition)
 
static wxString trimTrailingZeros (const wxString &aValue)
 
static wxString formatDouble (double aValue, int aPrecision=6)
 

Private Attributes

std::shared_ptr< DRC_RE_CUSTOM_RULE_CONSTRAINT_DATAm_constraintData
 
wxStyledTextCtrl * m_textCtrl
 

Detailed Description

Simple panel used for editing custom rule text.

The panel consists of a single wxStyledTextCtrl allowing free-form rule entry.

Definition at line 37 of file drc_re_custom_rule_panel.h.

Constructor & Destructor Documentation

◆ DRC_RE_CUSTOM_RULE_PANEL()

DRC_RE_CUSTOM_RULE_PANEL::DRC_RE_CUSTOM_RULE_PANEL ( wxWindow * aParent,
std::shared_ptr< DRC_RE_CUSTOM_RULE_CONSTRAINT_DATA > aConstraintData )

Definition at line 28 of file drc_re_custom_rule_panel.cpp.

References m_constraintData, and m_textCtrl.

◆ ~DRC_RE_CUSTOM_RULE_PANEL()

DRC_RE_CUSTOM_RULE_PANEL::~DRC_RE_CUSTOM_RULE_PANEL ( )
overridedefault

Member Function Documentation

◆ buildRule()

◆ escapeCondition()

static wxString DRC_RULE_EDITOR_CONTENT_PANEL_BASE::escapeCondition ( const wxString & aCondition)
inlinestaticprotectedinherited

Definition at line 99 of file drc_re_content_panel_base.h.

References CTX_QUOTED_STR, and EscapeString().

Referenced by buildRule().

◆ formatDouble()

static wxString DRC_RULE_EDITOR_CONTENT_PANEL_BASE::formatDouble ( double aValue,
int aPrecision = 6 )
inlinestaticprotectedinherited

◆ GenerateRule()

wxString DRC_RE_CUSTOM_RULE_PANEL::GenerateRule ( const RULE_GENERATION_CONTEXT & aContext)
overridevirtual

Implements DRC_RULE_EDITOR_CONTENT_PANEL_BASE.

Definition at line 61 of file drc_re_custom_rule_panel.cpp.

References m_constraintData, and m_textCtrl.

◆ GetConstraintImage()

◆ sanitizeRuleName()

static wxString DRC_RULE_EDITOR_CONTENT_PANEL_BASE::sanitizeRuleName ( const wxString & aRuleName)
inlinestaticprotectedinherited

Definition at line 68 of file drc_re_content_panel_base.h.

References result.

Referenced by buildRule().

◆ TransferDataFromWindow()

bool DRC_RE_CUSTOM_RULE_PANEL::TransferDataFromWindow ( )
override

Definition at line 46 of file drc_re_custom_rule_panel.cpp.

References m_constraintData, and m_textCtrl.

◆ TransferDataToWindow()

bool DRC_RE_CUSTOM_RULE_PANEL::TransferDataToWindow ( )
override

Definition at line 39 of file drc_re_custom_rule_panel.cpp.

References m_constraintData, and m_textCtrl.

◆ trimTrailingZeros()

static wxString DRC_RULE_EDITOR_CONTENT_PANEL_BASE::trimTrailingZeros ( const wxString & aValue)
inlinestaticprotectedinherited

Definition at line 104 of file drc_re_content_panel_base.h.

References result.

Referenced by formatDouble().

◆ ValidateInputs()

bool DRC_RE_CUSTOM_RULE_PANEL::ValidateInputs ( int * aErrorCount,
std::string * aValidationMessage )
overridevirtual

Implements DRC_RULE_EDITOR_CONTENT_PANEL_BASE.

Definition at line 53 of file drc_re_custom_rule_panel.cpp.

Member Data Documentation

◆ m_constraintData

std::shared_ptr<DRC_RE_CUSTOM_RULE_CONSTRAINT_DATA> DRC_RE_CUSTOM_RULE_PANEL::m_constraintData
private

◆ m_textCtrl

wxStyledTextCtrl* DRC_RE_CUSTOM_RULE_PANEL::m_textCtrl
private

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