Jimcpp 2.1.0
Jimcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUITabControl.hpp
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 jimcpp/jimcpp.hpp
4
5#ifndef JPP_I_GUI_TAB_CONTROL_HPP_INCLUDED
6#define JPP_I_GUI_TAB_CONTROL_HPP_INCLUDED
7
8#include <jimcpp/core/engine/IGUIElement.hpp>
9#include <jimcpp/core/engine/SColor.hpp>
10#include <jimcpp/core/engine/IGUISkin.hpp>
11
12namespace jpp
13{
14namespace gui
15{
16 class IGUITab;
17
19
23 {
24 public:
25
27 IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
28 : IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
29
31 virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
32
34
36 virtual s32 addTab(IGUITab* tab) = 0;
37
39
40 virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) = 0;
41
43
52 virtual s32 insertTab(s32 idx, IGUITab* tab, bool serializationMode=false) = 0;
53
55 virtual void removeTab(s32 idx) = 0;
56
58 virtual void clear() = 0;
59
61 virtual s32 getTabCount() const = 0;
62
64
67 virtual IGUITab* getTab(s32 idx) const = 0;
68
70
74 virtual s32 getTabIndex(const IGUIElement *tab) const = 0;
75
77
79 virtual bool setActiveTab(s32 idx) = 0;
80
82
84 virtual bool setActiveTab(IGUITab *tab) = 0;
85
87 virtual s32 getActiveTab() const = 0;
88
90
91 virtual s32 getTabAt(s32 xpos, s32 ypos) const = 0;
92
94 virtual void setTabHeight( s32 height ) = 0;
95
97
98 virtual s32 getTabHeight() const = 0;
99
101 virtual void setTabMaxWidth(s32 width ) = 0;
102
104 virtual s32 getTabMaxWidth() const = 0;
105
107
108 virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
109
111
113
115 virtual void setTabExtraWidth( s32 extraWidth ) = 0;
116
118
119 virtual s32 getTabExtraWidth() const = 0;
120 };
121
123
124 class IGUITab : public IGUIElement
125 {
126 public:
127
129 IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
130 : IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
131
133
134 JPP_DEPRECATED virtual s32 getNumber() const
135 {
137 return static_cast<IGUITabControl*>(Parent)->getTabIndex(this);
138 return -1;
139 }
140
142 virtual void setDrawBackground(bool draw=true) = 0;
143
146
148 virtual bool isDrawingBackground() const = 0;
149
152
154 virtual void setTextColor(video::SColor c) = 0;
155
157 virtual video::SColor getTextColor() const = 0;
158 };
159
160} // end namespace gui
161} // end namespace jpp
162
163#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Base class of all GUI elements.
Definition IGUIElement.hpp:24
IGUIElement * Parent
Pointer to the parent.
Definition IGUIElement.hpp:996
EGUI_ELEMENT_TYPE getType() const
Returns the type of the gui element.
Definition IGUIElement.hpp:739
virtual void draw()
Draws the element and its children.
Definition IGUIElement.hpp:331
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.hpp:73
A standard tab control.
Definition IGUITabControl.hpp:23
virtual void setTabHeight(s32 height)=0
Set the height of the tabs.
virtual IGUITab * addTab(const wchar_t *caption, s32 id=-1)=0
Adds a tab.
virtual bool setActiveTab(IGUITab *tab)=0
Brings a tab to front.
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 s32 getTabExtraWidth() const =0
Get the extra width added to tabs on each side of the text.
virtual s32 getTabCount() const =0
Returns amount of tabs in the tabcontrol.
virtual s32 getTabHeight() const =0
Get the height of the tabs.
virtual void clear()=0
Clears the tabcontrol removing all tabs.
virtual void removeTab(s32 idx)=0
Removes a tab from the tabcontrol.
virtual s32 getTabMaxWidth() const =0
get the maximal width of a tab
virtual IGUITab * getTab(s32 idx) const =0
Returns a tab based on zero based index.
virtual s32 getActiveTab() const =0
Returns which tab is currently active.
virtual void setTabVerticalAlignment(gui::EGUI_ALIGNMENT alignment)=0
Set the alignment of the tabs.
virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const =0
Get the alignment of the tabs.
virtual s32 addTab(IGUITab *tab)=0
Adds an existing tab.
virtual bool setActiveTab(s32 idx)=0
Brings a tab to front.
virtual s32 insertTab(s32 idx, IGUITab *tab, bool serializationMode=false)=0
Insert an existing tab.
virtual IGUITab * insertTab(s32 idx, const wchar_t *caption, s32 id=-1)=0
Insert the tab at the given index.
IGUITabControl(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUITabControl.hpp:27
virtual s32 getTabIndex(const IGUIElement *tab) const =0
For given element find if it's a tab and return it's zero-based index (or -1 for not found)
virtual void setTabExtraWidth(s32 extraWidth)=0
Set the extra width added to tabs on each side of the text.
A tab-page, onto which other gui elements could be added.
Definition IGUITabControl.hpp:125
virtual video::SColor getBackgroundColor() const =0
returns the color of the background
virtual void setTextColor(video::SColor c)=0
sets the color of it's text in the tab-bar
IGUITab(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUITabControl.hpp:129
virtual void setDrawBackground(bool draw=true)=0
sets if the tab should draw its background
virtual video::SColor getTextColor() const =0
gets the color of the text
virtual JPP_DEPRECATED s32 getNumber() const
Returns zero based index of tab if in tabcontrol.
Definition IGUITabControl.hpp:134
virtual bool isDrawingBackground() const =0
returns true if the tab is drawing its background, false if not
virtual void setBackgroundColor(video::SColor c)=0
sets the color of the background, if it should be drawn.
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
@ EGUIET_TAB_CONTROL
A tab control.
Definition EGUIElementTypes.hpp:74
@ EGUIET_TAB
A tab (IGUITab)
Definition EGUIElementTypes.hpp:71
EGUI_ALIGNMENT
Definition EGUIAlignment.hpp:15
As of Jimcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72

Jimcpp    @cppfx.xyz

K