29#include <wx/checkbox.h>
30#include <wx/textctrl.h>
31#include <wx/stattext.h>
41 std::vector<DRC_RE_FIELD_POSITION> positions =
m_data->GetFieldPositions();
43 wxWindow* eventSource =
nullptr;
45 for( wxWindow* win = aParent; win; win = win->GetParent() )
55 auto* optLengthField =
AddField<wxTextCtrl>( wxS(
"opt_length" ), positions[0], wxTE_CENTRE | wxTE_PROCESS_ENTER );
57 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, optLengthField->GetControl(),
58 optLengthField->GetLabel(),
false,
false );
63 auto* toleranceField =
AddField<wxTextCtrl>( wxS(
"tolerance" ), positions[1], wxTE_CENTRE | wxTE_PROCESS_ENTER );
65 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, toleranceField->GetControl(),
66 toleranceField->GetLabel(),
false,
false );
72 _(
"The values are picoseconds instead of a length" ) );
78 [
this]( wxCommandEvent& aEvent )
98 bool timeDomain =
m_data->IsTimeDomain();
145 wxString* aValidationMessage )
153 *aErrorCount =
result.errors.size();
155 for(
size_t i = 0; i <
result.errors.size(); i++ )
168 return wxEmptyString;
170 return m_data->GenerateRule( aContext );
constexpr EDA_IU_SCALE pcbIUScale
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
DRC_RE_ABS_LENGTH_TWO_OVERLAY_PANEL(wxWindow *aParent, DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA *aData, EDA_UNITS aUnits)
bool TransferDataFromWindow() override
double iuToDisplay(double aValue) const
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
std::unique_ptr< UNIT_BINDER > m_optLengthBinder
double displayToIU(double aValue) const
bool ValidateInputs(int *aErrorCount, wxString *aValidationMessage) override
std::unique_ptr< UNIT_BINDER > m_toleranceBinder
DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA * m_data
bool TransferDataToWindow() override
UNITS_PROVIDER m_unitsProvider
wxCheckBox * m_timeDomainCheckbox
DRC_RE_OVERLAY_FIELD * AddCheckbox(const wxString &aId, const DRC_RE_FIELD_POSITION &aPosition)
Create and position a checkbox control on the bitmap overlay.
void SetMinimumHeightDIP(int aHeight)
Asks for a panel taller than its illustration.
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.
wxControl * GetControl() const
static wxString FormatErrorMessage(int aErrorCount, const wxString &aErrorMessage)
The base frame for deriving all KiCad main window classes.
Base window classes and related definitions.
Specifies the position and size of a field overlaid on a constraint bitmap.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.