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 
virtual IGUITab * getTab(s32 idx) const =0
Returns a tab based on zero based index.
virtual void setTabVerticalAlignment(gui::EGUI_ALIGNMENT alignment)=0
Set the alignment of the tabs.
virtual video::SColor getTextColor() const =0
gets the color of the text
virtual s32 getTabMaxWidth() const =0
get the maximal width of a tab
virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const =0
Get the alignment of the tabs.
virtual s32 getTabCount() const =0
Returns amount of tabs in the tabcontrol.
IGUITab(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
A standard tab control.
virtual s32 getTabExtraWidth() const =0
Get the extra width added to tabs on each side of the text.
GUI Environment. Used as factory and manager of all other GUI elements.
virtual s32 getActiveTab() const =0
Returns which tab is currently active.
virtual bool setActiveTab(s32 idx)=0
Brings a tab to front.
A tab-page, onto which other gui elements could be added.
virtual video::SColor getBackgroundColor() const =0
returns the color of the background
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
virtual void setTabExtraWidth(s32 extraWidth)=0
Set the extra width added to tabs on each side of the text.
virtual void clear()=0
Clears the tabcontrol removing all tabs.
virtual void draw()
Draws the element and its children.
Definition: IGUIElement.h:309
IGUITabControl(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
virtual void setTabMaxWidth(s32 width)=0
set the maximal width of a tab. Per default width is 0 which means "no width restriction".
virtual s32 getTabAt(s32 xpos, s32 ypos) const =0
get the the id of the tab at the given absolute coordinates
virtual void setTabHeight(s32 height)=0
Set the height of the tabs.
virtual void setTextColor(video::SColor c)=0
sets the color of it's text in the tab-bar
virtual s32 getTabHeight() const =0
Get the height of the tabs.
Class representing a 32 bit ARGB color.
Definition: SColor.h:314
Base class of all GUI elements.
Definition: IGUIElement.h:23
virtual s32 getNumber() const =0
Returns zero based index of tab if in tabcontrol.
virtual bool isDrawingBackground() const =0
returns true if the tab is drawing its background, false if not
virtual IGUITab * addTab(const wchar_t *caption, s32 id=-1)=0
Adds a tab.
virtual IGUITab * insertTab(s32 idx, const wchar_t *caption, s32 id=-1)=0
Insert the tab at the given index.
virtual void setBackgroundColor(video::SColor c)=0
sets the color of the background, if it should be drawn.
virtual void removeTab(s32 idx)=0
Removes a tab from the tabcontrol.
virtual void setDrawBackground(bool draw=true)=0
sets if the tab should draw its background