diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-07-04 18:38:56 +0700 |
---|---|---|
committer | Poommetee Ketson <poommetee@protonmail.com> | 2017-07-04 20:12:33 +0700 |
commit | 3aff102fc3a9db4bcebdee844c8f6c02147bf371 (patch) | |
tree | 65ace4fcea8282b30bf222c268033d13c1078c0e /editor/plugins/item_list_editor_plugin.h | |
parent | a2586a21196aaf6327a312915b777dec4d3859cc (diff) | |
download | redot-engine-3aff102fc3a9db4bcebdee844c8f6c02147bf371.tar.gz |
ItemList: expose methods, in-editor items editing support
Diffstat (limited to 'editor/plugins/item_list_editor_plugin.h')
-rw-r--r-- | editor/plugins/item_list_editor_plugin.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/editor/plugins/item_list_editor_plugin.h b/editor/plugins/item_list_editor_plugin.h index 042e88839f..4fed8e49f5 100644 --- a/editor/plugins/item_list_editor_plugin.h +++ b/editor/plugins/item_list_editor_plugin.h @@ -167,6 +167,35 @@ public: /////////////////////////////////////////////////////////////// +class ItemListItemListPlugin : public ItemListPlugin { + + GDCLASS(ItemListItemListPlugin, ItemListPlugin); + + ItemList *pp; + +public: + virtual void set_object(Object *p_object); + virtual bool handles(Object *p_object) const; + virtual int get_flags() const; + + virtual void set_item_text(int p_idx, const String &p_text) { pp->set_item_text(p_idx, p_text); } + virtual String get_item_text(int p_idx) const { return pp->get_item_text(p_idx); } + + virtual void set_item_icon(int p_idx, const Ref<Texture> &p_tex) { pp->set_item_icon(p_idx, p_tex); } + virtual Ref<Texture> get_item_icon(int p_idx) const { return pp->get_item_icon(p_idx); } + + virtual void set_item_enabled(int p_idx, int p_enabled) { pp->set_item_disabled(p_idx, !p_enabled); } + virtual bool is_item_enabled(int p_idx) const { return !pp->is_item_disabled(p_idx); } + + virtual void add_item(); + virtual int get_item_count() const; + virtual void erase(int p_idx); + + ItemListItemListPlugin(); +}; + +/////////////////////////////////////////////////////////////// + class ItemListEditor : public HBoxContainer { GDCLASS(ItemListEditor, HBoxContainer); |