]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CGUITabControl.h
Reduce IrrCompileConfig usage to files that actually need it
[irrlicht.git] / source / Irrlicht / CGUITabControl.h
index 3752a10f223deb9e006b40f8f72c39fd11e1ad7b..4c2a0549712ae9da9d0aa1151f6038fb9c4bece2 100644 (file)
@@ -5,9 +5,6 @@
 #ifndef __C_GUI_TAB_CONTROL_H_INCLUDED__\r
 #define __C_GUI_TAB_CONTROL_H_INCLUDED__\r
 \r
-#include "IrrCompileConfig.h"\r
-#ifdef _IRR_COMPILE_WITH_GUI_\r
-\r
 #include "IGUITabControl.h"\r
 #include "irrArray.h"\r
 #include "IGUISkin.h"\r
@@ -30,30 +27,24 @@ namespace gui
                        s32 id);\r
 \r
                //! draws the element and its children\r
-               virtual void draw() _IRR_OVERRIDE_;\r
+               void draw() override;\r
 \r
                //! sets if the tab should draw its background\r
-               virtual void setDrawBackground(bool draw=true) _IRR_OVERRIDE_;\r
+               void setDrawBackground(bool draw=true) override;\r
 \r
                //! sets the color of the background, if it should be drawn.\r
-               virtual void setBackgroundColor(video::SColor c) _IRR_OVERRIDE_;\r
+               void setBackgroundColor(video::SColor c) override;\r
 \r
                //! sets the color of the text\r
-               virtual void setTextColor(video::SColor c) _IRR_OVERRIDE_;\r
+               void setTextColor(video::SColor c) override;\r
 \r
                //! returns true if the tab is drawing its background, false if not\r
-               virtual bool isDrawingBackground() const _IRR_OVERRIDE_;\r
+               bool isDrawingBackground() const override;\r
 \r
                //! returns the color of the background\r
-               virtual video::SColor getBackgroundColor() const _IRR_OVERRIDE_;\r
-\r
-               virtual video::SColor getTextColor() const _IRR_OVERRIDE_;\r
-\r
-               //! Writes attributes of the element.\r
-               virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_;\r
+               video::SColor getBackgroundColor() const override;\r
 \r
-               //! Reads attributes of the element\r
-               virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_;\r
+               video::SColor getTextColor() const override;\r
 \r
        private:\r
 \r
@@ -78,94 +69,92 @@ namespace gui
                virtual ~CGUITabControl();\r
 \r
                //! Adds a tab\r
-               virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) _IRR_OVERRIDE_;\r
+               IGUITab* addTab(const wchar_t* caption, s32 id=-1) override;\r
 \r
                //! Adds an existing tab\r
-               virtual s32 addTab(IGUITab* tab) _IRR_OVERRIDE_;\r
+               s32 addTab(IGUITab* tab) override;\r
 \r
                //! Insert the tab at the given index\r
-               virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) _IRR_OVERRIDE_;\r
+               IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) override;\r
 \r
                //! Insert an existing tab\r
                /** Note that it will also add the tab as a child of this TabControl.\r
                \return Index of added tab (should be same as the one passed) or -1 for failure*/\r
-               virtual s32 insertTab(s32 idx, IGUITab* tab, bool serializationMode) _IRR_OVERRIDE_;\r
+               s32 insertTab(s32 idx, IGUITab* tab, bool serializationMode) override;\r
 \r
                //! Removes a tab from the tabcontrol\r
-               virtual void removeTab(s32 idx) _IRR_OVERRIDE_;\r
+               void removeTab(s32 idx) override;\r
 \r
                //! Clears the tabcontrol removing all tabs\r
-               virtual void clear() _IRR_OVERRIDE_;\r
+               void clear() override;\r
 \r
                //! Returns amount of tabs in the tabcontrol\r
-               virtual s32 getTabCount() const _IRR_OVERRIDE_;\r
+               s32 getTabCount() const override;\r
 \r
                //! Returns a tab based on zero based index\r
-               virtual IGUITab* getTab(s32 idx) const _IRR_OVERRIDE_;\r
+               IGUITab* getTab(s32 idx) const override;\r
 \r
                //! Brings a tab to front.\r
-               virtual bool setActiveTab(s32 idx) _IRR_OVERRIDE_;\r
+               bool setActiveTab(s32 idx) override;\r
 \r
                //! Brings a tab to front.\r
-               virtual bool setActiveTab(IGUITab *tab) _IRR_OVERRIDE_;\r
+               bool setActiveTab(IGUITab *tab) override;\r
 \r
                //! For given given tab find it's zero-based index (or -1 for not found)\r
-               virtual s32 getTabIndex(const IGUIElement *tab) const _IRR_OVERRIDE_;\r
+               s32 getTabIndex(const IGUIElement *tab) const override;\r
 \r
                //! Returns which tab is currently active\r
-               virtual s32 getActiveTab() const _IRR_OVERRIDE_;\r
+               s32 getActiveTab() const override;\r
 \r
                //! get the the id of the tab at the given absolute coordinates\r
-               virtual s32 getTabAt(s32 xpos, s32 ypos) const _IRR_OVERRIDE_;\r
+               s32 getTabAt(s32 xpos, s32 ypos) const 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
                //! Removes a child.\r
-               virtual void removeChild(IGUIElement* child) _IRR_OVERRIDE_;\r
+               void removeChild(IGUIElement* child) override;\r
 \r
-               //! Writes attributes of the element.\r
-               virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_;\r
                //! Set the height of the tabs\r
-               virtual void setTabHeight( s32 height ) _IRR_OVERRIDE_;\r
-\r
-               //! Reads attributes of the element\r
-               virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_;\r
+               void setTabHeight( s32 height ) override;\r
 \r
                //! Get the height of the tabs\r
-               virtual s32 getTabHeight() const _IRR_OVERRIDE_;\r
+               s32 getTabHeight() const override;\r
 \r
                //! set the maximal width of a tab. Per default width is 0 which means "no width restriction".\r
-               virtual void setTabMaxWidth(s32 width ) _IRR_OVERRIDE_;\r
+               void setTabMaxWidth(s32 width ) override;\r
 \r
                //! get the maximal width of a tab\r
-               virtual s32 getTabMaxWidth() const _IRR_OVERRIDE_;\r
+               s32 getTabMaxWidth() const override;\r
 \r
                //! Set the alignment of the tabs\r
                //! note: EGUIA_CENTER is not an option\r
-               virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) _IRR_OVERRIDE_;\r
+               void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) override;\r
 \r
                //! Get the alignment of the tabs\r
-               virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const _IRR_OVERRIDE_;\r
+               gui::EGUI_ALIGNMENT getTabVerticalAlignment() const override;\r
 \r
                //! Set the extra width added to tabs on each side of the text\r
-               virtual void setTabExtraWidth( s32 extraWidth ) _IRR_OVERRIDE_;\r
+               void setTabExtraWidth( s32 extraWidth ) override;\r
 \r
                //! Get the extra width added to tabs on each side of the text\r
-               virtual s32 getTabExtraWidth() const _IRR_OVERRIDE_;\r
+               s32 getTabExtraWidth() const override;\r
 \r
                //! Update the position of the element, decides scroll button status\r
-               virtual void updateAbsolutePosition() _IRR_OVERRIDE_;\r
+               void updateAbsolutePosition() override;\r
 \r
        private:\r
 \r
                void scrollLeft();\r
                void scrollRight();\r
-               bool needScrollControl( s32 startIndex=0, bool withScrollControl=false );\r
-               s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl ) const;\r
+               //! Indicates whether the tabs overflow in X direction\r
+               bool needScrollControl( s32 startIndex=0, bool withScrollControl=false, s32 *pos_rightmost=nullptr );\r
+               //! Left index calculation based on the selected tab\r
+               s32 calculateScrollIndexFromActive();\r
+               s32 calcTabWidth(IGUIFont* font, const wchar_t* text) const;\r
                core::rect<s32> calcTabPos();\r
                void setVisibleTab(s32 idx);\r
                void removeTabButNotChild(s32 idx);\r
@@ -192,7 +181,4 @@ namespace gui
 } // end namespace gui\r
 } // end namespace irr\r
 \r
-#endif // _IRR_COMPILE_WITH_GUI_\r
-\r
 #endif\r
-\r