ENH: [STUDIO-1608] select support filament by combobox

Change-Id: I26543530202a53ef5753c38404617458a6d4a1ef
This commit is contained in:
chunmao.guo 2022-12-06 18:53:26 +08:00 committed by Lane.Wei
parent 278eab5ae2
commit 41b1ad6f2f
5 changed files with 132 additions and 14 deletions

View file

@ -335,13 +335,36 @@ public:
wxWindow* getWindow() override { return window; }
};
class Choice;
class DynamicList
{
public:
virtual ~DynamicList() {}
virtual void apply_on(Choice * choice) = 0;
virtual wxString get_value(int index) = 0;
virtual int index_of(wxString value) = 0;
protected:
void update();
std::vector<Choice*> m_choices;
private:
friend class Choice;
void add_choice(Choice *choice);
void remove_choice(Choice *choice);
};
class Choice : public Field {
using Field::Field;
DynamicList * m_list = nullptr;
public:
Choice(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
Choice(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {}
~Choice() {}
~Choice();
static void register_dynamic_list(std::string const &optname, DynamicList *list);
wxWindow* window{ nullptr };
void BUILD() override;