#ifndef slic3r_SearchComboBox_hpp_ #define slic3r_SearchComboBox_hpp_ #include #include #include #include #include #include #include #include #include "GUI_Utils.hpp" #include "wxExtensions.hpp" #include "libslic3r/Preset.hpp" namespace Slic3r { namespace Search{ class SearchDialog; struct InputInfo { DynamicPrintConfig* config {nullptr}; Preset::Type type {Preset::TYPE_INVALID}; ConfigOptionMode mode {comSimple}; }; struct GroupAndCategory { wxString group; wxString category; }; struct Option { // bool operator<(const Option& other) const { return other.label > this->label; } bool operator<(const Option& other) const { return other.opt_key > this->opt_key; } // Fuzzy matching works at a character level. Thus matching with wide characters is a safer bet than with short characters, // though for some languages (Chinese?) it may not work correctly. std::wstring opt_key; Preset::Type type {Preset::TYPE_INVALID}; std::wstring label; std::wstring label_local; std::wstring group; std::wstring group_local; std::wstring category; std::wstring category_local; }; struct FoundOption { // UTF8 encoding, to be consumed by ImGUI by reference. std::string label; std::string marked_label; std::string tooltip; size_t option_idx {0}; int outScore {0}; // Returning pointers to contents of std::string members, to be used by ImGUI for rendering. void get_marked_label_and_tooltip(const char** label, const char** tooltip) const; }; struct OptionViewParameters { bool category {false}; bool english {false}; int hovered_id {0}; }; class OptionsSearcher { std::string search_line; std::map groups_and_categories; PrinterTechnology printer_technology; std::vector