diff options
Diffstat (limited to 'src/guiFormSpecMenu.h')
-rw-r--r-- | src/guiFormSpecMenu.h | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h index 8b0e50379..1946f88eb 100644 --- a/src/guiFormSpecMenu.h +++ b/src/guiFormSpecMenu.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "inventory.h" #include "inventorymanager.h" #include "modalMenu.h" +#include "guiTable.h" class IGameDef; class InventoryManager; @@ -34,7 +35,7 @@ class ISimpleTextureSource; typedef enum { f_Button, - f_ListBox, + f_Table, f_TabHeader, f_CheckBox, f_DropDown, @@ -231,7 +232,10 @@ public: bool preprocessEvent(const SEvent& event); bool OnEvent(const SEvent& event); - int getListboxIndex(std::string listboxname); + GUITable* getTable(std::wstring tablename); + + static bool parseColor(const std::string &value, + video::SColor &color, bool quiet); protected: v2s32 getBasePos() const @@ -260,7 +264,7 @@ protected: std::vector<ImageDrawSpec> m_itemimages; std::vector<BoxDrawSpec> m_boxes; std::vector<FieldSpec> m_fields; - std::vector<std::pair<FieldSpec,gui::IGUIListBox*> > m_listboxes; + std::vector<std::pair<FieldSpec,GUITable*> > m_tables; std::vector<std::pair<FieldSpec,gui::IGUICheckBox*> > m_checkboxes; ItemSpec *m_selected_item; @@ -273,12 +277,6 @@ protected: ItemStack m_selected_content_guess; InventoryLocation m_selected_content_guess_inventory; - // WARNING: BLACK IRRLICHT MAGIC, see checkListboxClick() - std::wstring m_listbox_click_fname; - int m_listbox_click_index; - u32 m_listbox_click_time; - bool m_listbox_doubleclick; - v2s32 m_pointer; gui::IGUIStaticText *m_tooltip_element; @@ -302,8 +300,10 @@ private: int bp_set; v2u32 screensize; std::wstring focused_fieldname; - std::map<std::wstring,int> listbox_selections; - std::map<std::wstring,int> listbox_scroll; + GUITable::TableOptions table_options; + GUITable::TableColumns table_columns; + // used to restore table selection/scroll/treeview state + std::map<std::wstring,GUITable::DynamicData> table_dyndata; } parserData; typedef struct { @@ -315,12 +315,6 @@ private: fs_key_pendig current_keys_pending; - // Determine whether listbox click was double click - // (Using some black Irrlicht magic) - bool checkListboxClick(std::wstring wlistboxname, int eventtype); - - gui::IGUIScrollBar* getListboxScrollbar(gui::IGUIListBox *listbox); - void parseElement(parserData* data,std::string element); void parseSize(parserData* data,std::string element); @@ -330,6 +324,9 @@ private: void parseItemImage(parserData* data,std::string element); void parseButton(parserData* data,std::string element,std::string typ); void parseBackground(parserData* data,std::string element); + void parseTableOptions(parserData* data,std::string element); + void parseTableColumns(parserData* data,std::string element); + void parseTable(parserData* data,std::string element); void parseTextList(parserData* data,std::string element); void parseDropDown(parserData* data,std::string element); void parsePwdField(parserData* data,std::string element); @@ -344,8 +341,6 @@ private: void parseBox(parserData* data,std::string element); void parseBackgroundColor(parserData* data,std::string element); void parseListColors(parserData* data,std::string element); - - bool parseColor(std::string &value, video::SColor &color, bool quiet); }; class FormspecFormSource: public IFormSource |