33#include <wx/textctrl.h>
45 std::vector<DRC_RE_FIELD_POSITION> positions =
m_data->GetFieldPositions();
47 wxWindow* eventSource =
nullptr;
49 for( wxWindow* win = aParent; win; win = win->GetParent() )
58 auto* minTextHeightField =
AddField<wxTextCtrl>( wxS(
"min_text_height" ), positions[0], wxTE_PROCESS_ENTER );
60 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, minTextHeightField->GetControl(),
61 minTextHeightField->GetLabel(),
false,
false );
64 auto* minTextThicknessField =
AddField<wxTextCtrl>( wxS(
"min_text_thickness" ), positions[1], wxTE_PROCESS_ENTER );
66 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, minTextThicknessField->GetControl(),
67 minTextThicknessField->GetLabel(),
false,
false );
70 auto notifyModified = [
this]( wxCommandEvent& )
77 auto notifySave = [
this]( wxCommandEvent& aEvent )
84 minTextHeightField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
85 minTextThicknessField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
87 minTextHeightField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
88 minTextThicknessField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
120 wxString* aValidationMessage )
128 *aErrorCount =
result.errors.size();
130 for(
size_t i = 0; i <
result.errors.size(); i++ )
143 return wxEmptyString;
145 return m_data->GenerateRule( aContext );
constexpr EDA_IU_SCALE pcbIUScale
@ constraint_minimum_text_height_and_thickness
DRC_RE_OVERLAY_FIELD * AddField(const wxString &aId, const DRC_RE_FIELD_POSITION &aPosition, long aStyle=0)
Create and position a field control on the bitmap overlay.
void SetBackgroundBitmap(BITMAPS aBitmap)
Set the background bitmap for this panel.
DRC_RE_BITMAP_OVERLAY_PANEL(wxWindow *aParent, wxWindowID aId=wxID_ANY)
void PositionFields()
Position all fields based on the current scale factor.
bool TransferDataFromWindow() override
bool ValidateInputs(int *aErrorCount, wxString *aValidationMessage) override
DRC_RE_MIN_TXT_HT_TH_OVERLAY_PANEL(wxWindow *aParent, DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA *aData, EDA_UNITS aUnits)
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA * m_data
std::unique_ptr< UNIT_BINDER > m_minTextHeightBinder
std::unique_ptr< UNIT_BINDER > m_minTextThicknessBinder
bool TransferDataToWindow() override
UNITS_PROVIDER m_unitsProvider
static wxString FormatErrorMessage(int aErrorCount, const wxString &aErrorMessage)
The base frame for deriving all KiCad main window classes.
void SetModified()
Marks the dialog as modified, indicating unsaved changes.
static RULE_EDITOR_DIALOG_BASE * GetDialog(wxWindow *aWindow)
Static method to retrieve the rule editor dialog instance associated with a given window.
virtual void OnSave(wxCommandEvent &aEvent)=0
Base window classes and related definitions.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.