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 );
70 auto notifyModified = [
this]( wxCommandEvent& )
77 optLengthField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
78 toleranceField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
80 auto notifySave = [
this]( wxCommandEvent& aEvent )
87 optLengthField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
88 toleranceField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
wxString result
Test unit parsing edge cases and error handling.