33#include <wx/textctrl.h>
44 std::vector<DRC_RE_FIELD_POSITION> positions =
m_data->GetFieldPositions();
46 wxWindow* eventSource =
nullptr;
48 for( wxWindow* win = aParent; win; win = win->GetParent() )
57 auto* valueField =
AddField<wxTextCtrl>( wxS(
"value" ), positions[0], wxTE_PROCESS_ENTER | wxTE_CENTRE );
59 valueField->GetLabel(),
false,
false );
62 auto notifyModified = [
this]( wxCommandEvent& )
69 auto notifySave = [
this]( wxCommandEvent& aEvent )
76 valueField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
77 valueField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
107 wxString* aValidationMessage )
115 *aErrorCount =
result.errors.size();
117 for(
size_t i = 0; i <
result.errors.size(); i++ )
130 return wxEmptyString;
132 return m_data->GenerateRule( aContext );
constexpr EDA_IU_SCALE pcbIUScale
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.
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.