|
KiCad PCB EDA Suite
|
Wraps a wxControl positioned over a bitmap overlay panel. More...
#include <drc_re_overlay_field.h>
Public Types | |
| using | Getter = std::function<double()> |
| using | Setter = std::function<void( double )> |
Public Member Functions | |
| DRC_RE_OVERLAY_FIELD (wxWindow *aParent, const wxString &aFieldId, wxControl *aControl, const DRC_RE_FIELD_POSITION &aPosition) | |
| Construct an overlay field wrapping an existing control. | |
| ~DRC_RE_OVERLAY_FIELD () | |
| wxControl * | GetControl () const |
| const wxString & | GetFieldId () const |
| const DRC_RE_FIELD_POSITION & | GetPosition () const |
| bool | TransferToWindow () |
| Transfer data from the model to the control. | |
| bool | TransferFromWindow () |
| Transfer data from the control to the model. | |
| void | SetGetter (Getter aGetter) |
| Set the getter lambda for reading model data. | |
| void | SetSetter (Setter aSetter) |
| Set the setter lambda for writing model data. | |
| void | SetUnitBinder (UNIT_BINDER *aBinder) |
| Associate a UNIT_BINDER for unit conversion. | |
| UNIT_BINDER * | GetUnitBinder () const |
| void | ShowError (bool aShow) |
| Show or hide the error indicator icon adjacent to this field. | |
| bool | IsShowingError () const |
| wxStaticText * | GetLabel () const |
| bool | HasLabel () const |
| void | CreateLabel () |
| Create and associate a label with this field. | |
Private Member Functions | |
| void | createErrorIcon () |
Private Attributes | |
| wxWindow * | m_parent |
| wxString | m_fieldId |
| wxControl * | m_control |
| DRC_RE_FIELD_POSITION | m_position |
| Getter | m_getter |
| Setter | m_setter |
| UNIT_BINDER * | m_unitBinder |
| wxStaticBitmap * | m_errorIcon |
| bool | m_showingError |
| wxStaticText * | m_label |
Wraps a wxControl positioned over a bitmap overlay panel.
Manages the control's position within the overlay, data binding via lambda functions, optional UNIT_BINDER integration for unit conversion, and error icon display for validation feedback.
Definition at line 46 of file drc_re_overlay_field.h.
| using DRC_RE_OVERLAY_FIELD::Getter = std::function<double()> |
Definition at line 49 of file drc_re_overlay_field.h.
| using DRC_RE_OVERLAY_FIELD::Setter = std::function<void( double )> |
Definition at line 50 of file drc_re_overlay_field.h.
| DRC_RE_OVERLAY_FIELD::DRC_RE_OVERLAY_FIELD | ( | wxWindow * | aParent, |
| const wxString & | aFieldId, | ||
| wxControl * | aControl, | ||
| const DRC_RE_FIELD_POSITION & | aPosition ) |
Construct an overlay field wrapping an existing control.
| aParent | Parent window (typically the overlay panel) |
| aFieldId | Unique identifier for this field, used for error mapping |
| aControl | The wxControl to wrap and position |
| aPosition | Position specification in 1x bitmap coordinates |
Definition at line 35 of file drc_re_overlay_field.cpp.
References m_control, m_errorIcon, m_fieldId, m_getter, m_label, m_parent, m_position, m_setter, m_showingError, and m_unitBinder.
| DRC_RE_OVERLAY_FIELD::~DRC_RE_OVERLAY_FIELD | ( | ) |
Definition at line 52 of file drc_re_overlay_field.cpp.
References m_errorIcon, and m_label.
|
private |
Definition at line 68 of file drc_re_overlay_field.cpp.
References KiBitmapBundle(), m_control, m_errorIcon, m_parent, and small_warning.
Referenced by ShowError().
| void DRC_RE_OVERLAY_FIELD::CreateLabel | ( | ) |
Create and associate a label with this field.
The label is positioned according to the LABEL_POSITION in the field position struct.
Definition at line 145 of file drc_re_overlay_field.cpp.
References m_label, m_parent, m_position, and NONE.
Referenced by DRC_RE_BITMAP_OVERLAY_PANEL::AddCheckbox(), and DRC_RE_BITMAP_OVERLAY_PANEL::AddField().
|
inline |
Definition at line 68 of file drc_re_overlay_field.h.
References m_control.
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(), DRC_RE_PERMITTED_LAYERS_OVERLAY_PANEL::DRC_RE_PERMITTED_LAYERS_OVERLAY_PANEL(), and DRC_RE_BITMAP_OVERLAY_PANEL::PositionLabel().
|
inline |
Definition at line 73 of file drc_re_overlay_field.h.
References m_fieldId.
|
inline |
Definition at line 143 of file drc_re_overlay_field.h.
References m_label.
Referenced by DRC_RE_BITMAP_OVERLAY_PANEL::PositionLabel().
|
inline |
Definition at line 78 of file drc_re_overlay_field.h.
References m_position.
Referenced by DRC_RE_BITMAP_OVERLAY_PANEL::PositionLabel().
|
inline |
Definition at line 126 of file drc_re_overlay_field.h.
References m_unitBinder.
|
inline |
Definition at line 148 of file drc_re_overlay_field.h.
References m_label.
Referenced by DRC_RE_BITMAP_OVERLAY_PANEL::AddCheckbox(), and DRC_RE_BITMAP_OVERLAY_PANEL::AddField().
|
inline |
Definition at line 138 of file drc_re_overlay_field.h.
References m_showingError.
|
inline |
Set the getter lambda for reading model data.
| aGetter | Function returning the current model value |
Definition at line 104 of file drc_re_overlay_field.h.
References m_getter.
|
inline |
Set the setter lambda for writing model data.
| aSetter | Function accepting the new value from the control |
Definition at line 111 of file drc_re_overlay_field.h.
References m_setter.
|
inline |
Associate a UNIT_BINDER for unit conversion.
When set, TransferToWindow and TransferFromWindow use the UNIT_BINDER's SetDoubleValue and GetDoubleValue methods for proper unit handling.
| aBinder | The UNIT_BINDER to associate (ownership remains with caller) |
Definition at line 121 of file drc_re_overlay_field.h.
References m_unitBinder.
Referenced by DRC_RE_BITMAP_OVERLAY_PANEL::AddFieldWithUnits().
| void DRC_RE_OVERLAY_FIELD::ShowError | ( | bool | aShow | ) |
Show or hide the error indicator icon adjacent to this field.
| aShow | true to display the error icon, false to hide it |
Definition at line 88 of file drc_re_overlay_field.cpp.
References createErrorIcon(), m_errorIcon, and m_showingError.
| bool DRC_RE_OVERLAY_FIELD::TransferFromWindow | ( | ) |
Transfer data from the control to the model.
Reads the control value (via UNIT_BINDER if associated) and calls the setter lambda.
Definition at line 123 of file drc_re_overlay_field.cpp.
References m_setter, and m_unitBinder.
| bool DRC_RE_OVERLAY_FIELD::TransferToWindow | ( | ) |
Transfer data from the model to the control.
Uses the getter lambda if set. If a UNIT_BINDER is associated, the value is passed through SetDoubleValue for unit conversion.
Definition at line 100 of file drc_re_overlay_field.cpp.
References m_getter, and m_unitBinder.
|
private |
Definition at line 161 of file drc_re_overlay_field.h.
Referenced by createErrorIcon(), DRC_RE_OVERLAY_FIELD(), and GetControl().
|
private |
Definition at line 168 of file drc_re_overlay_field.h.
Referenced by createErrorIcon(), DRC_RE_OVERLAY_FIELD(), ShowError(), and ~DRC_RE_OVERLAY_FIELD().
|
private |
Definition at line 160 of file drc_re_overlay_field.h.
Referenced by DRC_RE_OVERLAY_FIELD(), and GetFieldId().
|
private |
Definition at line 164 of file drc_re_overlay_field.h.
Referenced by DRC_RE_OVERLAY_FIELD(), SetGetter(), and TransferToWindow().
|
private |
Definition at line 171 of file drc_re_overlay_field.h.
Referenced by CreateLabel(), DRC_RE_OVERLAY_FIELD(), GetLabel(), HasLabel(), and ~DRC_RE_OVERLAY_FIELD().
|
private |
Definition at line 159 of file drc_re_overlay_field.h.
Referenced by createErrorIcon(), CreateLabel(), and DRC_RE_OVERLAY_FIELD().
|
private |
Definition at line 162 of file drc_re_overlay_field.h.
Referenced by CreateLabel(), DRC_RE_OVERLAY_FIELD(), and GetPosition().
|
private |
Definition at line 165 of file drc_re_overlay_field.h.
Referenced by DRC_RE_OVERLAY_FIELD(), SetSetter(), and TransferFromWindow().
|
private |
Definition at line 169 of file drc_re_overlay_field.h.
Referenced by DRC_RE_OVERLAY_FIELD(), IsShowingError(), and ShowError().
|
private |
Definition at line 166 of file drc_re_overlay_field.h.
Referenced by DRC_RE_OVERLAY_FIELD(), GetUnitBinder(), SetUnitBinder(), TransferFromWindow(), and TransferToWindow().