aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 18:54:10 +1000
committerDavid Walter Seikel2013-01-13 18:54:10 +1000
commit959831f4ef5a3e797f576c3de08cd65032c997ad (patch)
treee7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h
parentAdd info about changes to Irrlicht. (diff)
downloadSledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h404
1 files changed, 202 insertions, 202 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h b/libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h
index dd6c5ae..5fb6dd3 100644
--- a/libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h
+++ b/libraries/irrlicht-1.8/source/Irrlicht/CGUITabControl.h
@@ -1,202 +1,202 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine". 2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h
4 4
5#ifndef __C_GUI_TAB_CONTROL_H_INCLUDED__ 5#ifndef __C_GUI_TAB_CONTROL_H_INCLUDED__
6#define __C_GUI_TAB_CONTROL_H_INCLUDED__ 6#define __C_GUI_TAB_CONTROL_H_INCLUDED__
7 7
8#include "IrrCompileConfig.h" 8#include "IrrCompileConfig.h"
9#ifdef _IRR_COMPILE_WITH_GUI_ 9#ifdef _IRR_COMPILE_WITH_GUI_
10 10
11#include "IGUITabControl.h" 11#include "IGUITabControl.h"
12#include "irrArray.h" 12#include "irrArray.h"
13#include "IGUISkin.h" 13#include "IGUISkin.h"
14 14
15namespace irr 15namespace irr
16{ 16{
17namespace gui 17namespace gui
18{ 18{
19 class CGUITabControl; 19 class CGUITabControl;
20 class IGUIButton; 20 class IGUIButton;
21 21
22 // A tab, onto which other gui elements could be added. 22 // A tab, onto which other gui elements could be added.
23 class CGUITab : public IGUITab 23 class CGUITab : public IGUITab
24 { 24 {
25 public: 25 public:
26 26
27 //! constructor 27 //! constructor
28 CGUITab(s32 number, IGUIEnvironment* environment, 28 CGUITab(s32 number, IGUIEnvironment* environment,
29 IGUIElement* parent, const core::rect<s32>& rectangle, 29 IGUIElement* parent, const core::rect<s32>& rectangle,
30 s32 id); 30 s32 id);
31 31
32 //! destructor 32 //! destructor
33 //virtual ~CGUITab(); 33 //virtual ~CGUITab();
34 34
35 //! Returns number of this tab in tabcontrol. Can be accessed 35 //! Returns number of this tab in tabcontrol. Can be accessed
36 //! later IGUITabControl::getTab() by this number. 36 //! later IGUITabControl::getTab() by this number.
37 virtual s32 getNumber() const; 37 virtual s32 getNumber() const;
38 38
39 //! Sets the number 39 //! Sets the number
40 virtual void setNumber(s32 n); 40 virtual void setNumber(s32 n);
41 41
42 //! draws the element and its children 42 //! draws the element and its children
43 virtual void draw(); 43 virtual void draw();
44 44
45 //! sets if the tab should draw its background 45 //! sets if the tab should draw its background
46 virtual void setDrawBackground(bool draw=true); 46 virtual void setDrawBackground(bool draw=true);
47 47
48 //! sets the color of the background, if it should be drawn. 48 //! sets the color of the background, if it should be drawn.
49 virtual void setBackgroundColor(video::SColor c); 49 virtual void setBackgroundColor(video::SColor c);
50 50
51 //! sets the color of the text 51 //! sets the color of the text
52 virtual void setTextColor(video::SColor c); 52 virtual void setTextColor(video::SColor c);
53 53
54 //! returns true if the tab is drawing its background, false if not 54 //! returns true if the tab is drawing its background, false if not
55 virtual bool isDrawingBackground() const; 55 virtual bool isDrawingBackground() const;
56 56
57 //! returns the color of the background 57 //! returns the color of the background
58 virtual video::SColor getBackgroundColor() const; 58 virtual video::SColor getBackgroundColor() const;
59 59
60 virtual video::SColor getTextColor() const; 60 virtual video::SColor getTextColor() const;
61 61
62 //! Writes attributes of the element. 62 //! Writes attributes of the element.
63 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; 63 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
64 64
65 //! Reads attributes of the element 65 //! Reads attributes of the element
66 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); 66 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
67 67
68 //! only for internal use by CGUITabControl 68 //! only for internal use by CGUITabControl
69 void refreshSkinColors(); 69 void refreshSkinColors();
70 70
71 private: 71 private:
72 72
73 s32 Number; 73 s32 Number;
74 video::SColor BackColor; 74 video::SColor BackColor;
75 bool OverrideTextColorEnabled; 75 bool OverrideTextColorEnabled;
76 video::SColor TextColor; 76 video::SColor TextColor;
77 bool DrawBackground; 77 bool DrawBackground;
78 }; 78 };
79 79
80 80
81 //! A standard tab control 81 //! A standard tab control
82 class CGUITabControl : public IGUITabControl 82 class CGUITabControl : public IGUITabControl
83 { 83 {
84 public: 84 public:
85 85
86 //! destructor 86 //! destructor
87 CGUITabControl(IGUIEnvironment* environment, 87 CGUITabControl(IGUIEnvironment* environment,
88 IGUIElement* parent, const core::rect<s32>& rectangle, 88 IGUIElement* parent, const core::rect<s32>& rectangle,
89 bool fillbackground=true, bool border=true, s32 id=-1); 89 bool fillbackground=true, bool border=true, s32 id=-1);
90 90
91 //! destructor 91 //! destructor
92 virtual ~CGUITabControl(); 92 virtual ~CGUITabControl();
93 93
94 //! Adds a tab 94 //! Adds a tab
95 virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1); 95 virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1);
96 96
97 //! Adds a tab that has already been created 97 //! Adds a tab that has already been created
98 virtual void addTab(CGUITab* tab); 98 virtual void addTab(CGUITab* tab);
99 99
100 //! Insert the tab at the given index 100 //! Insert the tab at the given index
101 virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1); 101 virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1);
102 102
103 //! Removes a tab from the tabcontrol 103 //! Removes a tab from the tabcontrol
104 virtual void removeTab(s32 idx); 104 virtual void removeTab(s32 idx);
105 105
106 //! Clears the tabcontrol removing all tabs 106 //! Clears the tabcontrol removing all tabs
107 virtual void clear(); 107 virtual void clear();
108 108
109 //! Returns amount of tabs in the tabcontrol 109 //! Returns amount of tabs in the tabcontrol
110 virtual s32 getTabCount() const; 110 virtual s32 getTabCount() const;
111 111
112 //! Returns a tab based on zero based index 112 //! Returns a tab based on zero based index
113 virtual IGUITab* getTab(s32 idx) const; 113 virtual IGUITab* getTab(s32 idx) const;
114 114
115 //! Brings a tab to front. 115 //! Brings a tab to front.
116 virtual bool setActiveTab(s32 idx); 116 virtual bool setActiveTab(s32 idx);
117 117
118 //! Brings a tab to front. 118 //! Brings a tab to front.
119 virtual bool setActiveTab(IGUITab *tab); 119 virtual bool setActiveTab(IGUITab *tab);
120 120
121 //! Returns which tab is currently active 121 //! Returns which tab is currently active
122 virtual s32 getActiveTab() const; 122 virtual s32 getActiveTab() const;
123 123
124 //! get the the id of the tab at the given absolute coordinates 124 //! get the the id of the tab at the given absolute coordinates
125 virtual s32 getTabAt(s32 xpos, s32 ypos) const; 125 virtual s32 getTabAt(s32 xpos, s32 ypos) const;
126 126
127 //! called if an event happened. 127 //! called if an event happened.
128 virtual bool OnEvent(const SEvent& event); 128 virtual bool OnEvent(const SEvent& event);
129 129
130 //! draws the element and its children 130 //! draws the element and its children
131 virtual void draw(); 131 virtual void draw();
132 132
133 //! Removes a child. 133 //! Removes a child.
134 virtual void removeChild(IGUIElement* child); 134 virtual void removeChild(IGUIElement* child);
135 135
136 //! Writes attributes of the element. 136 //! Writes attributes of the element.
137 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; 137 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
138 //! Set the height of the tabs 138 //! Set the height of the tabs
139 virtual void setTabHeight( s32 height ); 139 virtual void setTabHeight( s32 height );
140 140
141 //! Reads attributes of the element 141 //! Reads attributes of the element
142 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); 142 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
143 143
144 //! Get the height of the tabs 144 //! Get the height of the tabs
145 virtual s32 getTabHeight() const; 145 virtual s32 getTabHeight() const;
146 146
147 //! set the maximal width of a tab. Per default width is 0 which means "no width restriction". 147 //! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
148 virtual void setTabMaxWidth(s32 width ); 148 virtual void setTabMaxWidth(s32 width );
149 149
150 //! get the maximal width of a tab 150 //! get the maximal width of a tab
151 virtual s32 getTabMaxWidth() const; 151 virtual s32 getTabMaxWidth() const;
152 152
153 //! Set the alignment of the tabs 153 //! Set the alignment of the tabs
154 //! note: EGUIA_CENTER is not an option 154 //! note: EGUIA_CENTER is not an option
155 virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ); 155 virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment );
156 156
157 //! Get the alignment of the tabs 157 //! Get the alignment of the tabs
158 virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const; 158 virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const;
159 159
160 //! Set the extra width added to tabs on each side of the text 160 //! Set the extra width added to tabs on each side of the text
161 virtual void setTabExtraWidth( s32 extraWidth ); 161 virtual void setTabExtraWidth( s32 extraWidth );
162 162
163 //! Get the extra width added to tabs on each side of the text 163 //! Get the extra width added to tabs on each side of the text
164 virtual s32 getTabExtraWidth() const; 164 virtual s32 getTabExtraWidth() const;
165 165
166 //! Update the position of the element, decides scroll button status 166 //! Update the position of the element, decides scroll button status
167 virtual void updateAbsolutePosition(); 167 virtual void updateAbsolutePosition();
168 168
169 private: 169 private:
170 170
171 void scrollLeft(); 171 void scrollLeft();
172 void scrollRight(); 172 void scrollRight();
173 bool needScrollControl( s32 startIndex=0, bool withScrollControl=false ); 173 bool needScrollControl( s32 startIndex=0, bool withScrollControl=false );
174 s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl ) const; 174 s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl ) const;
175 core::rect<s32> calcTabPos(); 175 core::rect<s32> calcTabPos();
176 176
177 void recalculateScrollButtonPlacement(); 177 void recalculateScrollButtonPlacement();
178 void recalculateScrollBar(); 178 void recalculateScrollBar();
179 void refreshSprites(); 179 void refreshSprites();
180 180
181 core::array<CGUITab*> Tabs; // CGUITab* because we need setNumber (which is certainly not nice) 181 core::array<CGUITab*> Tabs; // CGUITab* because we need setNumber (which is certainly not nice)
182 s32 ActiveTab; 182 s32 ActiveTab;
183 bool Border; 183 bool Border;
184 bool FillBackground; 184 bool FillBackground;
185 bool ScrollControl; 185 bool ScrollControl;
186 s32 TabHeight; 186 s32 TabHeight;
187 gui::EGUI_ALIGNMENT VerticalAlignment; 187 gui::EGUI_ALIGNMENT VerticalAlignment;
188 IGUIButton* UpButton; 188 IGUIButton* UpButton;
189 IGUIButton* DownButton; 189 IGUIButton* DownButton;
190 s32 TabMaxWidth; 190 s32 TabMaxWidth;
191 s32 CurrentScrollTabIndex; 191 s32 CurrentScrollTabIndex;
192 s32 TabExtraWidth; 192 s32 TabExtraWidth;
193 }; 193 };
194 194
195 195
196} // end namespace gui 196} // end namespace gui
197} // end namespace irr 197} // end namespace irr
198 198
199#endif // _IRR_COMPILE_WITH_GUI_ 199#endif // _IRR_COMPILE_WITH_GUI_
200 200
201#endif 201#endif
202 202