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 );
71 auto notifyModified = [
this]( wxCommandEvent& )
78 optLengthField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
79 toleranceField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
81 auto notifySave = [
this]( wxCommandEvent& aEvent )
88 optLengthField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
89 toleranceField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
92 _(
"The values are picoseconds instead of a length" ) );
98 [
this, notifyModified]( wxCommandEvent& aEvent )
104 notifyModified( aEvent );
107 SetMinSize( wxSize( GetMinSize().x, FromDIP( 190 ) ) );
wxString result
Test unit parsing edge cases and error handling.