42 std::vector<DRC_RE_FIELD_POSITION> positions =
m_data->GetFieldPositions();
44 wxWindow* eventSource =
nullptr;
46 for( wxWindow* win = aParent; win; win = win->GetParent() )
56 auto* optLengthField =
AddField<wxTextCtrl>( wxS(
"opt_length" ), positions[0], wxTE_CENTRE | wxTE_PROCESS_ENTER );
58 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, optLengthField->GetControl(),
59 optLengthField->GetLabel(),
false,
false );
64 auto* toleranceField =
AddField<wxTextCtrl>( wxS(
"tolerance" ), positions[1], wxTE_CENTRE | wxTE_PROCESS_ENTER );
66 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, toleranceField->GetControl(),
67 toleranceField->GetLabel(),
false,
false );
72 auto* maxSkewField =
AddField<wxTextCtrl>( wxS(
"max_skew" ), positions[2], wxTE_CENTRE | wxTE_PROCESS_ENTER );
74 maxSkewField->GetLabel(),
false,
false );
78 auto* withinDiffPairs =
AddCheckbox( wxS(
"within_diff_pairs" ), positions[3] );
81 auto notifyModified = [
this]( wxCommandEvent& )
88 optLengthField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
89 toleranceField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
90 maxSkewField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
93 auto notifySave = [
this]( wxCommandEvent& aEvent )
100 optLengthField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
101 toleranceField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
102 maxSkewField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
wxString result
Test unit parsing edge cases and error handling.