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 wxArrayString choices;
56 choices.Add(
_(
"Any" ) );
57 choices.Add(
_(
"Through" ) );
58 choices.Add(
_(
"Micro" ) );
59 choices.Add(
_(
"Blind" ) );
60 choices.Add(
_(
"Buried" ) );
62 m_viaTypeChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices );
68 auto* minViaDiameterField =
69 AddField<wxTextCtrl>( wxS(
"min_via_diameter" ), positions[0], wxTE_PROCESS_ENTER | wxTE_CENTRE );
71 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, minViaDiameterField->GetControl(),
72 minViaDiameterField->GetLabel(),
false,
false );
75 auto* maxViaDiameterField =
76 AddField<wxTextCtrl>( wxS(
"max_via_diameter" ), positions[1], wxTE_PROCESS_ENTER | wxTE_CENTRE );
78 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, maxViaDiameterField->GetControl(),
79 maxViaDiameterField->GetLabel(),
false,
false );
83 auto* minViaHoleField =
86 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, minViaHoleField->GetControl(),
87 minViaHoleField->GetLabel(),
false,
false );
90 auto* maxViaHoleField =
93 std::make_unique<UNIT_BINDER>( &
m_unitsProvider, eventSource,
nullptr, maxViaHoleField->GetControl(),
94 maxViaHoleField->GetLabel(),
false,
false );
97 auto notifyModified = [
this]( wxCommandEvent& )
104 auto notifySave = [
this]( wxCommandEvent& aEvent )
111 minViaDiameterField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
112 maxViaDiameterField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
113 minViaHoleField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
114 maxViaHoleField->GetControl()->Bind( wxEVT_TEXT, notifyModified );
116 minViaDiameterField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
117 maxViaDiameterField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
118 minViaHoleField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
119 maxViaHoleField->GetControl()->Bind( wxEVT_TEXT_ENTER, notifySave );
wxString result
Test unit parsing edge cases and error handling.