Irrlicht 3D Engine
IGUITabControl.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__
6 #define __I_GUI_TAB_CONTROL_H_INCLUDED__
7 
8 #include "IGUIElement.h"
9 #include "SColor.h"
10 #include "IGUISkin.h"
11 
12 namespace irr
13 {
14 namespace gui
15 {
17 
18  class IGUITab : public IGUIElement
19  {
20  public:
21 
23  IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
24  : IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
25 
27 
30  virtual s32 getNumber() const = 0;
31 
33  virtual void setDrawBackground(bool draw=true) = 0;
34 
36  virtual void setBackgroundColor(video::SColor c) = 0;
37 
39  virtual bool isDrawingBackground() const = 0;
40 
42  virtual video::SColor getBackgroundColor() const = 0;
43 
45  virtual void setTextColor(video::SColor c) = 0;
46 
48  virtual video::SColor getTextColor() const = 0;
49  };
50 
52 
55  class IGUITabControl : public IGUIElement
56  {
57  public:
58 
60  IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
61  : IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
62 
64  virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
65 
67 
68  virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) = 0;
69 
71  virtual void removeTab(s32 idx) = 0;
72 
74  virtual void clear() = 0;
75 
77  virtual s32 getTabCount() const = 0;
78 
80 
83  virtual IGUITab* getTab(s32 idx) const = 0;
84 
86 
88  virtual bool setActiveTab(s32 idx) = 0;
89 
91 
93  virtual bool setActiveTab(IGUITab *tab) = 0;
94 
96  virtual s32 getActiveTab() const = 0;
97 
99 
100  virtual s32 getTabAt(s32 xpos, s32 ypos) const = 0;
101 
103  virtual void setTabHeight( s32 height ) = 0;
104 
106 
107  virtual s32 getTabHeight() const = 0;
108 
110  virtual void setTabMaxWidth(s32 width ) = 0;
111 
113  virtual s32 getTabMaxWidth() const = 0;
114 
116 
117  virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
118 
120 
121  virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const = 0;
122 
124  virtual void setTabExtraWidth( s32 extraWidth ) = 0;
125 
127 
128  virtual s32 getTabExtraWidth() const = 0;
129  };
130 
131 
132 } // end namespace gui
133 } // end namespace irr
134 
135 #endif
136 
irr::gui::IGUITabControl::setTabHeight
virtual void setTabHeight(s32 height)=0
Set the height of the tabs.
irr::gui::IGUITab::getTextColor
virtual video::SColor getTextColor() const =0
gets the color of the text
irr::gui::IGUITabControl::clear
virtual void clear()=0
Clears the tabcontrol removing all tabs.
IGUISkin.h
irr::gui::IGUITabControl
A standard tab control.
Definition: IGUITabControl.h:55
irr::gui::IGUITabControl::setTabVerticalAlignment
virtual void setTabVerticalAlignment(gui::EGUI_ALIGNMENT alignment)=0
Set the alignment of the tabs.
irr::gui::IGUITab::isDrawingBackground
virtual bool isDrawingBackground() const =0
returns true if the tab is drawing its background, false if not
irr::gui::IGUITabControl::setActiveTab
virtual bool setActiveTab(s32 idx)=0
Brings a tab to front.
irr::gui::IGUITab::setTextColor
virtual void setTextColor(video::SColor c)=0
sets the color of the text
irr::gui::IGUITabControl::IGUITabControl
IGUITabControl(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition: IGUITabControl.h:60
irr::gui::IGUITab::setDrawBackground
virtual void setDrawBackground(bool draw=true)=0
sets if the tab should draw its background
irr::s32
signed int s32
32 bit signed variable.
Definition: irrTypes.h:66
irr::gui::IGUITabControl::getTabMaxWidth
virtual s32 getTabMaxWidth() const =0
get the maximal width of a tab
irr::gui::IGUITabControl::addTab
virtual IGUITab * addTab(const wchar_t *caption, s32 id=-1)=0
Adds a tab.
irr::gui::IGUITab::getNumber
virtual s32 getNumber() const =0
Returns zero based index of tab if in tabcontrol.
irr::gui::EGUI_ALIGNMENT
EGUI_ALIGNMENT
Definition: EGUIAlignment.h:12
irr::gui::IGUITabControl::getTab
virtual IGUITab * getTab(s32 idx) const =0
Returns a tab based on zero based index.
irr::gui::IGUITab::getBackgroundColor
virtual video::SColor getBackgroundColor() const =0
returns the color of the background
irr::gui::IGUITabControl::getTabCount
virtual s32 getTabCount() const =0
Returns amount of tabs in the tabcontrol.
irr::gui::IGUITabControl::getTabExtraWidth
virtual s32 getTabExtraWidth() const =0
Get the extra width added to tabs on each side of the text.
irr::gui::IGUITabControl::getTabVerticalAlignment
virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const =0
Get the alignment of the tabs.
irr::gui::IGUITabControl::insertTab
virtual IGUITab * insertTab(s32 idx, const wchar_t *caption, s32 id=-1)=0
Insert the tab at the given index.
irr::gui::IGUITab::setBackgroundColor
virtual void setBackgroundColor(video::SColor c)=0
sets the color of the background, if it should be drawn.
irr::gui::EGUIET_TAB_CONTROL
@ EGUIET_TAB_CONTROL
A tab control.
Definition: EGUIElementTypes.h:74
IGUIElement.h
irr::gui::EGUIET_TAB
@ EGUIET_TAB
A tab (IGUITab)
Definition: EGUIElementTypes.h:71
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
irr::core::rect< s32 >
irr::gui::IGUITabControl::removeTab
virtual void removeTab(s32 idx)=0
Removes a tab from the tabcontrol.
irr::gui::IGUIElement::draw
virtual void draw()
Draws the element and its children.
Definition: IGUIElement.h:312
irr::gui::IGUITabControl::setTabExtraWidth
virtual void setTabExtraWidth(s32 extraWidth)=0
Set the extra width added to tabs on each side of the text.
irr::gui::IGUITabControl::getTabHeight
virtual s32 getTabHeight() const =0
Get the height of the tabs.
irr::gui::IGUITabControl::getTabAt
virtual s32 getTabAt(s32 xpos, s32 ypos) const =0
get the the id of the tab at the given absolute coordinates
irr::gui::IGUIEnvironment
GUI Environment. Used as factory and manager of all other GUI elements.
Definition: IGUIEnvironment.h:70
irr::gui::IGUITab::IGUITab
IGUITab(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition: IGUITabControl.h:23
irr::gui::IGUITabControl::getActiveTab
virtual s32 getActiveTab() const =0
Returns which tab is currently active.
irr::gui::IGUITab
A tab-page, onto which other gui elements could be added.
Definition: IGUITabControl.h:18
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition: SColor.h:201
irr::gui::IGUITabControl::setTabMaxWidth
virtual void setTabMaxWidth(s32 width)=0
set the maximal width of a tab. Per default width is 0 which means "no width restriction".
irr::gui::IGUIElement
Base class of all GUI elements.
Definition: IGUIElement.h:25
SColor.h