~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to include/IGUITabControl.h

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 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
{
 
16
        //! A tab-page, onto which other gui elements could be added.
 
17
        /** IGUITab refers to the page itself, not to the tab in the tabbar of an IGUITabControl. */
 
18
        class IGUITab : public IGUIElement
 
19
        {
 
20
        public:
 
21
 
 
22
                //! constructor
 
23
                IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
 
24
                        : IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
 
25
 
 
26
                //! Returns zero based index of tab if in tabcontrol.
 
27
                /** Can be accessed later IGUITabControl::getTab() by this number.
 
28
                        Note that this number can change when other tabs are inserted or removed .
 
29
                */
 
30
                virtual s32 getNumber() const = 0;
 
31
 
 
32
                //! sets if the tab should draw its background
 
33
                virtual void setDrawBackground(bool draw=true) = 0;
 
34
 
 
35
                //! sets the color of the background, if it should be drawn.
 
36
                virtual void setBackgroundColor(video::SColor c) = 0;
 
37
 
 
38
                //! returns true if the tab is drawing its background, false if not
 
39
                virtual bool isDrawingBackground() const = 0;
 
40
 
 
41
                //! returns the color of the background
 
42
                virtual video::SColor getBackgroundColor() const = 0;
 
43
 
 
44
                //! sets the color of the text
 
45
                virtual void setTextColor(video::SColor c) = 0;
 
46
 
 
47
                //! gets the color of the text
 
48
                virtual video::SColor getTextColor() const = 0;
 
49
        };
 
50
 
 
51
        //! A standard tab control
 
52
        class IGUITabControl : public IGUIElement
 
53
        {
 
54
        public:
 
55
 
 
56
                //! constructor
 
57
                IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
 
58
                        : IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
 
59
 
 
60
                //! Adds a tab
 
61
                virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
 
62
 
 
63
                //! Insert the tab at the given index
 
64
                /** \return The tab on success or NULL on failure. */
 
65
                virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) = 0;
 
66
 
 
67
                //! Removes a tab from the tabcontrol
 
68
                virtual void removeTab(s32 idx) = 0;
 
69
 
 
70
                //! Clears the tabcontrol removing all tabs
 
71
                virtual void clear() = 0;
 
72
 
 
73
                //! Returns amount of tabs in the tabcontrol
 
74
                virtual s32 getTabCount() const = 0;
 
75
 
 
76
                //! Returns a tab based on zero based index
 
77
                /** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1;
 
78
                \return Returns pointer to the Tab. Returns 0 if no tab
 
79
                is corresponding to this tab. */
 
80
                virtual IGUITab* getTab(s32 idx) const = 0;
 
81
 
 
82
                //! Brings a tab to front.
 
83
                /** \param idx: number of the tab.
 
84
                \return Returns true if successful. */
 
85
                virtual bool setActiveTab(s32 idx) = 0;
 
86
 
 
87
                //! Brings a tab to front.
 
88
                /** \param tab: pointer to the tab.
 
89
                \return Returns true if successful. */
 
90
                virtual bool setActiveTab(IGUITab *tab) = 0;
 
91
 
 
92
                //! Returns which tab is currently active
 
93
                virtual s32 getActiveTab() const = 0;
 
94
 
 
95
                //! get the the id of the tab at the given absolute coordinates
 
96
                /** \return The id of the tab or -1 when no tab is at those coordinates*/
 
97
                virtual s32 getTabAt(s32 xpos, s32 ypos) const = 0;
 
98
 
 
99
                //! Set the height of the tabs
 
100
                virtual void setTabHeight( s32 height ) = 0;
 
101
 
 
102
                //! Get the height of the tabs
 
103
                /** return Returns the height of the tabs */
 
104
                virtual s32 getTabHeight() const = 0;
 
105
 
 
106
                //! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
 
107
                virtual void setTabMaxWidth(s32 width ) = 0;
 
108
 
 
109
                //! get the maximal width of a tab
 
110
                virtual s32 getTabMaxWidth() const = 0;
 
111
 
 
112
                //! Set the alignment of the tabs
 
113
                /** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */
 
114
                virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
 
115
 
 
116
                //! Get the alignment of the tabs
 
117
                /** return Returns the alignment of the tabs */
 
118
                virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const = 0;
 
119
 
 
120
                //! Set the extra width added to tabs on each side of the text
 
121
                virtual void setTabExtraWidth( s32 extraWidth ) = 0;
 
122
 
 
123
                //! Get the extra width added to tabs on each side of the text
 
124
                /** return Returns the extra width of the tabs */
 
125
                virtual s32 getTabExtraWidth() const = 0;
 
126
        };
 
127
 
 
128
 
 
129
} // end namespace gui
 
130
} // end namespace irr
 
131
 
 
132
#endif
 
133