]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CGUIListBox.h
Revert "Fix: Listbox was sometimes sending EGET_LISTBOX_SELECTED_AGAIN instead of...
[irrlicht.git] / source / Irrlicht / CGUIListBox.h
index 0742c0dbcc6c4580056280da11e8b675240526d6..a3e7255a6975d241af0d4c15d18745d5cf94af81 100644 (file)
@@ -5,9 +5,6 @@
 #ifndef __C_GUI_LIST_BOX_H_INCLUDED__\r
 #define __C_GUI_LIST_BOX_H_INCLUDED__\r
 \r
-#include "IrrCompileConfig.h"\r
-#ifdef _IRR_COMPILE_WITH_GUI_\r
-\r
 #include "IGUIListBox.h"\r
 #include "irrArray.h"\r
 \r
@@ -31,121 +28,117 @@ namespace gui
                virtual ~CGUIListBox();\r
 \r
                //! returns amount of list items\r
-               virtual u32 getItemCount() const _IRR_OVERRIDE_;\r
+               u32 getItemCount() const override;\r
 \r
                //! returns string of a list item. the id may be a value from 0 to itemCount-1\r
-               virtual const wchar_t* getListItem(u32 id) const _IRR_OVERRIDE_;\r
+               const wchar_t* getListItem(u32 id) const override;\r
 \r
                //! adds an list item, returns id of item\r
-               virtual u32 addItem(const wchar_t* text) _IRR_OVERRIDE_;\r
+               u32 addItem(const wchar_t* text) override;\r
 \r
                //! clears the list\r
-               virtual void clear() _IRR_OVERRIDE_;\r
+               void clear() override;\r
 \r
                //! returns id of selected item. returns -1 if no item is selected.\r
-               virtual s32 getSelected() const _IRR_OVERRIDE_;\r
+               s32 getSelected() const override;\r
 \r
                //! sets the selected item. Set this to -1 if no item should be selected\r
-               virtual void setSelected(s32 id) _IRR_OVERRIDE_;\r
+               void setSelected(s32 id) override;\r
 \r
                //! sets the selected item. Set this to -1 if no item should be selected\r
-               virtual void setSelected(const wchar_t *item) _IRR_OVERRIDE_;\r
+               void setSelected(const wchar_t *item) override;\r
 \r
                //! called if an event happened.\r
-               virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_;\r
+               bool OnEvent(const SEvent& event) override;\r
 \r
                //! draws the element and its children\r
-               virtual void draw() _IRR_OVERRIDE_;\r
+               void draw() override;\r
 \r
                //! adds an list item with an icon\r
                //! \param text Text of list entry\r
                //! \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon\r
                //! \return\r
                //! returns the id of the new created item\r
-               virtual u32 addItem(const wchar_t* text, s32 icon) _IRR_OVERRIDE_;\r
+               u32 addItem(const wchar_t* text, s32 icon) override;\r
 \r
                //! Returns the icon of an item\r
-               virtual s32 getIcon(u32 id) const _IRR_OVERRIDE_;\r
+               s32 getIcon(u32 id) const override;\r
 \r
                //! removes an item from the list\r
-               virtual void removeItem(u32 id) _IRR_OVERRIDE_;\r
+               void removeItem(u32 id) override;\r
 \r
                //! get the the id of the item at the given absolute coordinates\r
-               virtual s32 getItemAt(s32 xpos, s32 ypos) const _IRR_OVERRIDE_;\r
+               s32 getItemAt(s32 xpos, s32 ypos) const override;\r
 \r
                //! Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of\r
                //! the built-in-font by default. A sprite can be displayed in front of every list item.\r
                //! An icon is an index within the icon sprite bank. Several default icons are available in the\r
                //! skin through getIcon\r
-               virtual void setSpriteBank(IGUISpriteBank* bank) _IRR_OVERRIDE_;\r
+               void setSpriteBank(IGUISpriteBank* bank) override;\r
 \r
                //! set whether the listbox should scroll to newly selected items\r
-               virtual void setAutoScrollEnabled(bool scroll) _IRR_OVERRIDE_;\r
+               void setAutoScrollEnabled(bool scroll) override;\r
 \r
                //! returns true if automatic scrolling is enabled, false if not.\r
-               virtual bool isAutoScrollEnabled() const _IRR_OVERRIDE_;\r
+               bool isAutoScrollEnabled() const override;\r
 \r
                //! Update the position and size of the listbox, and update the scrollbar\r
-               virtual void updateAbsolutePosition() _IRR_OVERRIDE_;\r
+               void updateAbsolutePosition() override;\r
 \r
                //! set all item colors at given index to color\r
-               virtual void setItemOverrideColor(u32 index, video::SColor color) _IRR_OVERRIDE_;\r
+               void setItemOverrideColor(u32 index, video::SColor color) override;\r
 \r
                //! set all item colors of specified type at given index to color\r
-               virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) _IRR_OVERRIDE_;\r
+               void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) override;\r
 \r
                //! clear all item colors at index\r
-               virtual void clearItemOverrideColor(u32 index) _IRR_OVERRIDE_;\r
+               void clearItemOverrideColor(u32 index) override;\r
 \r
                //! clear item color at index for given colortype\r
-               virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) _IRR_OVERRIDE_;\r
+               void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) override;\r
 \r
                //! has the item at index its color overwritten?\r
-               virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const _IRR_OVERRIDE_;\r
+               bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const override;\r
 \r
                //! return the overwrite color at given item index.\r
-               virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const _IRR_OVERRIDE_;\r
+               video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const override;\r
 \r
                //! return the default color which is used for the given colorType\r
-               virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const _IRR_OVERRIDE_;\r
+               video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const override;\r
 \r
                //! set the item at the given index\r
-               virtual void setItem(u32 index, const wchar_t* text, s32 icon) _IRR_OVERRIDE_;\r
+               void setItem(u32 index, const wchar_t* text, s32 icon) override;\r
 \r
                //! Insert the item at the given index\r
                //! Return the index on success or -1 on failure.\r
-               virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) _IRR_OVERRIDE_;\r
+               s32 insertItem(u32 index, const wchar_t* text, s32 icon) override;\r
 \r
                //! Swap the items at the given indices\r
-               virtual void swapItems(u32 index1, u32 index2) _IRR_OVERRIDE_;\r
+               void swapItems(u32 index1, u32 index2) override;\r
 \r
                //! set global itemHeight\r
-               virtual void setItemHeight( s32 height ) _IRR_OVERRIDE_;\r
+               void setItemHeight( s32 height ) override;\r
 \r
                //! Sets whether to draw the background\r
-               virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;\r
+               void setDrawBackground(bool draw) override;\r
 \r
                //! Access the vertical scrollbar\r
-               virtual IGUIScrollBar* getVerticalScrollBar() const _IRR_OVERRIDE_;\r
+               IGUIScrollBar* getVerticalScrollBar() const override;\r
 \r
        private:\r
 \r
                struct ListItem\r
                {\r
-                       ListItem() : Icon(-1)\r
-                       {}\r
-\r
                        core::stringw Text;\r
-                       s32 Icon;\r
+                       s32 Icon = -1;\r
 \r
                        // A multicolor extension\r
                        struct ListItemOverrideColor\r
                        {\r
-                               ListItemOverrideColor() : Use(false) {}\r
-                               bool Use;\r
+                               bool Use = false;\r
                                video::SColor Color;\r
                        };\r
-                       ListItemOverrideColor OverrideColors[EGUI_LBC_COUNT];\r
+                       ListItemOverrideColor OverrideColors[EGUI_LBC_COUNT]{};\r
                };\r
 \r
                void recalculateItemHeight();\r
@@ -182,6 +175,4 @@ namespace gui
 } // end namespace gui\r
 } // end namespace irr\r
 \r
-#endif // _IRR_COMPILE_WITH_GUI_\r
-\r
 #endif\r