MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnEditboxChanged

Method OnEditboxChanged

src/picker_gui.cpp:546–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546void PickerWindow::OnEditboxChanged(WidgetID wid)
547{
548 switch (wid) {
549 case WID_PW_CLASS_FILTER:
550 this->class_string_filter.SetFilterTerm(this->class_editbox.text.GetText());
551 this->classes.SetFilterState(!class_string_filter.IsEmpty());
552 this->InvalidateData(PickerInvalidation::Class);
553 break;
554
555 case WID_PW_TYPE_FILTER:
556 this->type_string_filter.SetFilterTerm(this->type_editbox.text.GetText());
557 if (!type_string_filter.IsEmpty()) {
558 this->type_string_filter.btf.emplace(this->type_string_filter, this->callbacks.GetFeature());
559 } else {
560 this->type_string_filter.btf.reset();
561 }
562 this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter, PickerInvalidation::Position});
563 break;
564
565 default:
566 break;
567 }
568}
569
570/** Builds the filter list of classes. */
571void PickerWindow::BuildPickerClassList()

Callers 1

ClickEditBoxMethod · 0.45

Calls 7

InvalidateDataMethod · 0.95
SetFilterTermMethod · 0.80
SetFilterStateMethod · 0.80
GetTextMethod · 0.45
IsEmptyMethod · 0.45
GetFeatureMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected