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

Overlay panel for routing width constraints showing min/preferred/max width fields positioned over a diagram. More...

#include <drc_re_routing_width_overlay_panel.h>

Inheritance diagram for DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL:
DRC_RE_BITMAP_OVERLAY_PANEL DRC_RULE_EDITOR_CONTENT_PANEL_BASE

Public Member Functions

 DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL (wxWindow *aParent, DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA *aData, EDA_UNITS aUnits)
 
 ~DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL () override=default
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
bool ValidateInputs (int *aErrorCount, wxString *aValidationMessage) override
 
wxString GenerateRule (const RULE_GENERATION_CONTEXT &aContext) override
 
void SetBackgroundBitmap (BITMAPS aBitmap)
 Set the background bitmap for this panel.
 
void ClearFieldErrors ()
 Clear error indicators from all fields.
 
void ShowFieldError (const wxString &aFieldId)
 Show an error indicator on the specified field.
 

Protected Member Functions

template<typename T>
DRC_RE_OVERLAY_FIELDAddField (const wxString &aId, const DRC_RE_FIELD_POSITION &aPosition, long aStyle=0)
 Create and position a field control on the bitmap overlay.
 
template<typename T>
DRC_RE_OVERLAY_FIELDAddFieldWithUnits (const wxString &aId, const DRC_RE_FIELD_POSITION &aPosition, UNIT_BINDER *aUnitBinder, long aStyle=0)
 Create and position a field control with unit binding.
 
DRC_RE_OVERLAY_FIELDAddCheckbox (const wxString &aId, const DRC_RE_FIELD_POSITION &aPosition)
 Create and position a checkbox control on the bitmap overlay.
 
void LoadBitmap ()
 Load the appropriate bitmap variant for the current theme and DPI.
 
void PositionFields ()
 Position all fields based on the current scale factor.
 
void SetupFieldStyling (wxControl *aControl)
 Apply transparent styling to a field control.
 
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 Member Functions

void OnPaint (wxPaintEvent &aEvent)
 
void OnDPIChanged (wxDPIChangedEvent &aEvent)
 
void OnThemeChange (wxSysColourChangedEvent &aEvent)
 
void OnFieldFocus (wxFocusEvent &aEvent)
 
void OnFieldBlur (wxFocusEvent &aEvent)
 
void PositionLabel (DRC_RE_OVERLAY_FIELD *aField)
 Position a label relative to its field control based on the label position setting.
 

Private Attributes

DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATAm_data
 
UNITS_PROVIDER m_unitsProvider
 
std::unique_ptr< UNIT_BINDERm_minRoutingWidthBinder
 
std::unique_ptr< UNIT_BINDERm_preferredRoutingWidthBinder
 
std::unique_ptr< UNIT_BINDERm_maxRoutingWidthBinder
 
wxBitmap m_bitmap
 Current background bitmap.
 
BITMAPS m_bitmapId
 BITMAPS enum value.
 
wxSize m_baseBitmapSize
 Bitmap size at 1x scale.
 
std::vector< std::unique_ptr< DRC_RE_OVERLAY_FIELD > > m_fields
 All overlay fields.
 
std::map< wxString, DRC_RE_OVERLAY_FIELD * > m_fieldIdMap
 Field ID to field lookup.
 

Detailed Description

Overlay panel for routing width constraints showing min/preferred/max width fields positioned over a diagram.

Definition at line 43 of file drc_re_routing_width_overlay_panel.h.

Constructor & Destructor Documentation

◆ DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL()

◆ ~DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL()

DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::~DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL ( )
overridedefault

Member Function Documentation

◆ AddCheckbox()

DRC_RE_OVERLAY_FIELD * DRC_RE_BITMAP_OVERLAY_PANEL::AddCheckbox ( const wxString & aId,
const DRC_RE_FIELD_POSITION & aPosition )
protectedinherited

Create and position a checkbox control on the bitmap overlay.

Parameters
aIdString identifier for this checkbox.
aPositionPosition specification in 1x bitmap coordinates.
Returns
Pointer to the created field wrapper.

Definition at line 248 of file drc_re_bitmap_overlay_panel.cpp.

References DRC_RE_OVERLAY_FIELD::CreateLabel(), DRC_RE_OVERLAY_FIELD::HasLabel(), m_fieldIdMap, m_fields, PositionLabel(), SetupFieldStyling(), DRC_RE_FIELD_POSITION::xStart, and DRC_RE_FIELD_POSITION::yTop.

Referenced by DRC_RE_ALLOWED_ORIENTATION_OVERLAY_PANEL::DRC_RE_ALLOWED_ORIENTATION_OVERLAY_PANEL(), DRC_RE_BOOL_INPUT_OVERLAY_PANEL::DRC_RE_BOOL_INPUT_OVERLAY_PANEL(), and DRC_RE_PERMITTED_LAYERS_OVERLAY_PANEL::DRC_RE_PERMITTED_LAYERS_OVERLAY_PANEL().

◆ AddField()

template<typename T>
DRC_RE_OVERLAY_FIELD * DRC_RE_BITMAP_OVERLAY_PANEL::AddField ( const wxString & aId,
const DRC_RE_FIELD_POSITION & aPosition,
long aStyle = 0 )
protectedinherited

Create and position a field control on the bitmap overlay.

Template Parameters
TThe wxWindow-derived control type to create.
Parameters
aIdString identifier for this field (used for error display and lookup).
aPositionPosition specification in 1x bitmap coordinates.
aStyleWindow style flags passed to the control constructor
Returns
Pointer to the created field wrapper.

Definition at line 169 of file drc_re_bitmap_overlay_panel.h.

References DRC_RE_OVERLAY_FIELD::CreateLabel(), DRC_RE_OVERLAY_FIELD::HasLabel(), m_fieldIdMap, m_fields, PositionLabel(), SetupFieldStyling(), T, DRC_RE_FIELD_POSITION::xEnd, DRC_RE_FIELD_POSITION::xStart, and DRC_RE_FIELD_POSITION::yTop.

Referenced by AddFieldWithUnits(), DRC_RE_ABS_LENGTH_TWO_OVERLAY_PANEL::DRC_RE_ABS_LENGTH_TWO_OVERLAY_PANEL(), DRC_RE_MIN_TXT_HT_TH_OVERLAY_PANEL::DRC_RE_MIN_TXT_HT_TH_OVERLAY_PANEL(), DRC_RE_NUMERIC_INPUT_OVERLAY_PANEL::DRC_RE_NUMERIC_INPUT_OVERLAY_PANEL(), DRC_RE_ROUTING_DIFF_PAIR_OVERLAY_PANEL::DRC_RE_ROUTING_DIFF_PAIR_OVERLAY_PANEL(), DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL(), and DRC_RE_VIA_STYLE_OVERLAY_PANEL::DRC_RE_VIA_STYLE_OVERLAY_PANEL().

◆ AddFieldWithUnits()

template<typename T>
DRC_RE_OVERLAY_FIELD * DRC_RE_BITMAP_OVERLAY_PANEL::AddFieldWithUnits ( const wxString & aId,
const DRC_RE_FIELD_POSITION & aPosition,
UNIT_BINDER * aUnitBinder,
long aStyle = 0 )
protectedinherited

Create and position a field control with unit binding.

Template Parameters
TThe wxWindow-derived control type to create.
Parameters
aIdString identifier for this field.
aPositionPosition specification in 1x bitmap coordinates.
aUnitBinderUNIT_BINDER to associate with this field for unit conversion.
aStyleWindow style flags passed to the control constructor
Returns
Pointer to the created field wrapper.

Definition at line 205 of file drc_re_bitmap_overlay_panel.h.

References AddField(), and DRC_RE_OVERLAY_FIELD::SetUnitBinder().

◆ buildRule()

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

◆ ClearFieldErrors()

void DRC_RE_BITMAP_OVERLAY_PANEL::ClearFieldErrors ( )
inherited

Clear error indicators from all fields.

Definition at line 232 of file drc_re_bitmap_overlay_panel.cpp.

References m_fields.

◆ escapeCondition()

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

Definition at line 94 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

Definition at line 115 of file drc_re_content_panel_base.h.

References trimTrailingZeros().

◆ GenerateRule()

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

Implements DRC_RULE_EDITOR_CONTENT_PANEL_BASE.

Definition at line 161 of file drc_re_routing_width_overlay_panel.cpp.

References m_data.

◆ LoadBitmap()

void DRC_RE_BITMAP_OVERLAY_PANEL::LoadBitmap ( )
protectedinherited

Load the appropriate bitmap variant for the current theme and DPI.

Definition at line 110 of file drc_re_bitmap_overlay_panel.cpp.

References INVALID_BITMAP, KiBitmapBundle(), m_baseBitmapSize, m_bitmap, m_bitmapId, and Refresh().

Referenced by OnDPIChanged(), OnThemeChange(), and SetBackgroundBitmap().

◆ OnDPIChanged()

void DRC_RE_BITMAP_OVERLAY_PANEL::OnDPIChanged ( wxDPIChangedEvent & aEvent)
privateinherited

Definition at line 67 of file drc_re_bitmap_overlay_panel.cpp.

References LoadBitmap(), PositionFields(), and Refresh().

Referenced by DRC_RE_BITMAP_OVERLAY_PANEL().

◆ OnFieldBlur()

void DRC_RE_BITMAP_OVERLAY_PANEL::OnFieldBlur ( wxFocusEvent & aEvent)
privateinherited

Definition at line 92 of file drc_re_bitmap_overlay_panel.cpp.

Referenced by SetupFieldStyling().

◆ OnFieldFocus()

void DRC_RE_BITMAP_OVERLAY_PANEL::OnFieldFocus ( wxFocusEvent & aEvent)
privateinherited

Definition at line 84 of file drc_re_bitmap_overlay_panel.cpp.

Referenced by SetupFieldStyling().

◆ OnPaint()

void DRC_RE_BITMAP_OVERLAY_PANEL::OnPaint ( wxPaintEvent & aEvent)
privateinherited

Definition at line 56 of file drc_re_bitmap_overlay_panel.cpp.

References m_bitmap.

Referenced by DRC_RE_BITMAP_OVERLAY_PANEL().

◆ OnThemeChange()

void DRC_RE_BITMAP_OVERLAY_PANEL::OnThemeChange ( wxSysColourChangedEvent & aEvent)
privateinherited

Definition at line 76 of file drc_re_bitmap_overlay_panel.cpp.

References LoadBitmap(), and Refresh().

Referenced by DRC_RE_BITMAP_OVERLAY_PANEL().

◆ PositionFields()

◆ PositionLabel()

void DRC_RE_BITMAP_OVERLAY_PANEL::PositionLabel ( DRC_RE_OVERLAY_FIELD * aField)
privateinherited

Position a label relative to its field control based on the label position setting.

Parameters
aFieldThe overlay field containing the label to position.

Definition at line 171 of file drc_re_bitmap_overlay_panel.cpp.

References BOTTOM, GAP, DRC_RE_OVERLAY_FIELD::GetControl(), DRC_RE_OVERLAY_FIELD::GetLabel(), DRC_RE_OVERLAY_FIELD::GetPosition(), DRC_RE_FIELD_POSITION::labelPosition, LEFT, NONE, RIGHT, and TOP.

Referenced by AddCheckbox(), AddField(), and PositionFields().

◆ sanitizeRuleName()

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

Definition at line 63 of file drc_re_content_panel_base.h.

References result.

Referenced by buildRule().

◆ SetBackgroundBitmap()

◆ SetupFieldStyling()

void DRC_RE_BITMAP_OVERLAY_PANEL::SetupFieldStyling ( wxControl * aControl)
protectedinherited

Apply transparent styling to a field control.

Parameters
aControlThe control to style.

Definition at line 99 of file drc_re_bitmap_overlay_panel.cpp.

References OnFieldBlur(), and OnFieldFocus().

Referenced by AddCheckbox(), and AddField().

◆ ShowFieldError()

void DRC_RE_BITMAP_OVERLAY_PANEL::ShowFieldError ( const wxString & aFieldId)
inherited

Show an error indicator on the specified field.

Parameters
aFieldIdThe string identifier of the field to highlight.

Definition at line 239 of file drc_re_bitmap_overlay_panel.cpp.

References m_fieldIdMap.

◆ TransferDataFromWindow()

bool DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::TransferDataFromWindow ( )
overridevirtual

◆ TransferDataToWindow()

bool DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::TransferDataToWindow ( )
overridevirtual

◆ trimTrailingZeros()

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

Definition at line 99 of file drc_re_content_panel_base.h.

References result.

Referenced by formatDouble().

◆ ValidateInputs()

bool DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::ValidateInputs ( int * aErrorCount,
wxString * aValidationMessage )
overridevirtual

Member Data Documentation

◆ m_baseBitmapSize

wxSize DRC_RE_BITMAP_OVERLAY_PANEL::m_baseBitmapSize
privateinherited

Bitmap size at 1x scale.

Definition at line 162 of file drc_re_bitmap_overlay_panel.h.

Referenced by DRC_RE_BITMAP_OVERLAY_PANEL(), LoadBitmap(), and SetBackgroundBitmap().

◆ m_bitmap

wxBitmap DRC_RE_BITMAP_OVERLAY_PANEL::m_bitmap
privateinherited

Current background bitmap.

Definition at line 160 of file drc_re_bitmap_overlay_panel.h.

Referenced by LoadBitmap(), OnPaint(), PositionFields(), and SetBackgroundBitmap().

◆ m_bitmapId

BITMAPS DRC_RE_BITMAP_OVERLAY_PANEL::m_bitmapId
privateinherited

BITMAPS enum value.

Definition at line 161 of file drc_re_bitmap_overlay_panel.h.

Referenced by DRC_RE_BITMAP_OVERLAY_PANEL(), LoadBitmap(), and SetBackgroundBitmap().

◆ m_data

◆ m_fieldIdMap

std::map<wxString, DRC_RE_OVERLAY_FIELD*> DRC_RE_BITMAP_OVERLAY_PANEL::m_fieldIdMap
privateinherited

Field ID to field lookup.

Definition at line 164 of file drc_re_bitmap_overlay_panel.h.

Referenced by AddCheckbox(), AddField(), and ShowFieldError().

◆ m_fields

std::vector<std::unique_ptr<DRC_RE_OVERLAY_FIELD> > DRC_RE_BITMAP_OVERLAY_PANEL::m_fields
privateinherited

All overlay fields.

Definition at line 163 of file drc_re_bitmap_overlay_panel.h.

Referenced by AddCheckbox(), AddField(), ClearFieldErrors(), and PositionFields().

◆ m_maxRoutingWidthBinder

std::unique_ptr<UNIT_BINDER> DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::m_maxRoutingWidthBinder
private

◆ m_minRoutingWidthBinder

std::unique_ptr<UNIT_BINDER> DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::m_minRoutingWidthBinder
private

◆ m_preferredRoutingWidthBinder

std::unique_ptr<UNIT_BINDER> DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::m_preferredRoutingWidthBinder
private

◆ m_unitsProvider

UNITS_PROVIDER DRC_RE_ROUTING_WIDTH_OVERLAY_PANEL::m_unitsProvider
private

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