Irrlicht 3D Engine
IGUISkin.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_SKIN_H_INCLUDED__
6 #define __I_GUI_SKIN_H_INCLUDED__
7 
9 #include "EGUIAlignment.h"
10 #include "SColor.h"
11 #include "rect.h"
12 
13 namespace irr
14 {
15 namespace gui
16 {
17  class IGUIFont;
18  class IGUISpriteBank;
19  class IGUIElement;
20 
22 
31  {
34 
37 
40 
43 
46  };
47 
49  const c8* const GUISkinTypeNames[EGST_COUNT+1] =
50  {
51  "windowsClassic",
52  "windowsMetallic",
53  "burning",
54  "unknown",
55  0,
56  };
57 
58 
61  {
112 
116  };
117 
119  const c8* const GUISkinColorNames[EGDC_COUNT+1] =
120  {
121  "3DDarkShadow",
122  "3DShadow",
123  "3DFace",
124  "3DHighlight",
125  "3DLight",
126  "ActiveBorder",
127  "ActiveCaption",
128  "AppWorkspace",
129  "ButtonText",
130  "GrayText",
131  "Highlight",
132  "HighlightText",
133  "InactiveBorder",
134  "InactiveCaption",
135  "ToolTip",
136  "ToolTipBackground",
137  "ScrollBar",
138  "Window",
139  "WindowSymbol",
140  "Icon",
141  "IconHighlight",
142  "GrayWindowSymbol",
143  "Editable",
144  "GrayEditable",
145  "FocusedEditable",
146  0,
147  };
148 
151  {
194 
198  };
199 
200 
202  const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
203  {
204  "ScrollBarSize",
205  "MenuHeight",
206  "WindowButtonWidth",
207  "CheckBoxWidth",
208  "MessageBoxWidth",
209  "MessageBoxHeight",
210  "ButtonWidth",
211  "ButtonHeight",
212  "TextDistanceX",
213  "TextDistanceY",
214  "TitleBarTextX",
215  "TitleBarTextY",
216  "MessageBoxGapSpace",
217  "MessageBoxMinTextWidth",
218  "MessageBoxMaxTextWidth",
219  "MessageBoxMinTextHeight",
220  "MessageBoxMaxTextHeight",
221  "ButtonPressedImageOffsetX",
222  "ButtonPressedImageOffsetY",
223  "ButtonPressedTextOffsetX",
224  "ButtonPressedTextOffsetY",
225  0
226  };
227 
228 
230  {
247 
250  };
251 
253  const c8* const GUISkinTextNames[EGDT_COUNT+1] =
254  {
255  "MessageBoxOkay",
256  "MessageBoxCancel",
257  "MessageBoxYes",
258  "MessageBoxNo",
259  "WindowButtonClose",
260  "WindowButtonMaximize",
261  "WindowButtonMinimize",
262  "WindowButtonRestore",
263  0
264  };
265 
268  {
309 
316 
319  };
320 
321  const c8* const GUISkinIconNames[EGDI_COUNT+1] =
322  {
323  "windowMaximize",
324  "windowRestore",
325  "windowClose",
326  "windowMinimize",
327  "windowResize",
328  "cursorUp",
329  "cursorDown",
330  "cursorLeft",
331  "cursorRight",
332  "menuMore",
333  "checkBoxChecked",
334  "dropDown",
335  "smallCursorUp",
336  "smallCursorDown",
337  "radioButtonChecked",
338  "moreLeft",
339  "moreRight",
340  "moreUp",
341  "moreDown",
342  "expand",
343  "collapse",
344  "file",
345  "directory",
346  0
347  };
348 
349  // Customizable fonts
351  {
365  };
366 
367  const c8* const GUISkinFontNames[EGDF_COUNT+1] =
368  {
369  "defaultFont",
370  "buttonFont",
371  "windowFont",
372  "menuFont",
373  "tooltipFont",
374  0
375  };
376 
379  {
380  public:
381 
383  virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
384 
386  virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
387 
389  virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
390 
392 
394  virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
395 
397 
399  virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
400 
402  virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
403 
405  virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0;
406 
408  virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
409 
411  virtual IGUISpriteBank* getSpriteBank() const = 0;
412 
414  virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
415 
417 
418  virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
419 
421 
425  virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
426 
428 
436  virtual void draw3DButtonPaneStandard(IGUIElement* element,
437  const core::rect<s32>& rect,
438  const core::rect<s32>* clip=0) = 0;
439 
441 
449  virtual void draw3DButtonPanePressed(IGUIElement* element,
450  const core::rect<s32>& rect,
451  const core::rect<s32>* clip=0) = 0;
452 
454 
465  virtual void draw3DSunkenPane(IGUIElement* element,
466  video::SColor bgcolor, bool flat, bool fillBackGround,
467  const core::rect<s32>& rect,
468  const core::rect<s32>* clip=0) = 0;
469 
471 
485  bool drawTitleBar, video::SColor titleBarColor,
486  const core::rect<s32>& rect,
487  const core::rect<s32>* clip=0,
488  core::rect<s32>* checkClientArea=0) = 0;
489 
491 
499  virtual void draw3DMenuPane(IGUIElement* element,
500  const core::rect<s32>& rect,
501  const core::rect<s32>* clip=0) = 0;
502 
504 
510  virtual void draw3DToolBar(IGUIElement* element,
511  const core::rect<s32>& rect,
512  const core::rect<s32>* clip=0) = 0;
513 
515 
523  virtual void draw3DTabButton(IGUIElement* element, bool active,
524  const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
525 
527 
536  virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
537  const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
538 
540 
549  virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
550  const core::position2di position, u32 starttime=0, u32 currenttime=0,
551  bool loop=false, const core::rect<s32>* clip=0) = 0;
552 
554 
562  virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
563  const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
564 
566  virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
567  };
568 
569 
570 } // end namespace gui
571 } // end namespace irr
572 
573 #endif
574 
icon for menu children
Definition: IGUISkin.h:288
virtual IGUISpriteBank * getSpriteBank() const =0
returns the sprite bank
icon indicating that there is more content to the right
Definition: IGUISkin.h:302
Tooltip text for window close button.
Definition: IGUISkin.h:240
virtual void draw3DSunkenPane(IGUIElement *element, video::SColor bgcolor, bool flat, bool fillBackGround, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a sunken 3d pane
pixels to move the button image down when a pushbutton is pressed
Definition: IGUISkin.h:189
icon indicating that there is more content above
Definition: IGUISkin.h:304
Grayed (disabled) window background for editable field (editbox, checkbox-field)
Definition: IGUISkin.h:109
virtual void setFont(IGUIFont *font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT)=0
sets a default font
An object which is able to serialize and deserialize its attributes into an attributes object...
virtual void setSpriteBank(IGUISpriteBank *bank)=0
sets the sprite bank
EGUI_DEFAULT_SIZE
Enumeration for default sizes.
Definition: IGUISkin.h:150
virtual void draw3DMenuPane(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a standard 3d menu pane
Show focus of window background for editable field (editbox or when checkbox-field is pressed) ...
Definition: IGUISkin.h:111
EGUI_SKIN_TYPE
Enumeration of available default skins.
Definition: IGUISkin.h:30
selection dot in a radio button
Definition: IGUISkin.h:298
Sprite bank interface.
virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t *newText)=0
Sets a default text.
virtual void draw3DButtonPaneStandard(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a standard 3d button pane
height of menu
Definition: IGUISkin.h:155
Active window border.
Definition: IGUISkin.h:73
Text of item(s) selected in a control.
Definition: IGUISkin.h:85
char c8
8 bit character variable.
Definition: irrTypes.h:31
scroll bar down button
Definition: IGUISkin.h:282
minus icon for trees
Definition: IGUISkin.h:311
const c8 *const GUISkinColorNames[EGDC_COUNT+1]
Names for default skin colors.
Definition: IGUISkin.h:119
Aligned to parent&#39;s top or left side (default)
Definition: EGUIAlignment.h:15
Tool tip background color.
Definition: IGUISkin.h:93
restore window button
Definition: IGUISkin.h:272
width of a default button
Definition: IGUISkin.h:165
minimal space to reserve for messagebox text-height
Definition: IGUISkin.h:183
Window symbols like on close buttons, scroll bars and check boxes.
Definition: IGUISkin.h:99
virtual IGUIFont * getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const =0
returns the default font
const c8 *const GUISkinTextNames[EGDT_COUNT+1]
Names for default skin sizes.
Definition: IGUISkin.h:253
virtual void draw2DRectangle(IGUIElement *element, const video::SColor &color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)=0
draws a 2d rectangle.
folder icon for file selection
Definition: IGUISkin.h:315
virtual core::rect< s32 > draw3DWindowBackground(IGUIElement *element, bool drawTitleBar, video::SColor titleBarColor, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, core::rect< s32 > *checkClientArea=0)=0
draws a window background
virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const =0
returns default color
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
resize icon for bottom right corner of a window
Definition: IGUISkin.h:278
virtual void draw3DButtonPanePressed(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a pressed 3d button pane
smaller down arrow
Definition: IGUISkin.h:296
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size)=0
sets a default size
scroll bar right button
Definition: IGUISkin.h:286
const c8 *const GUISkinTypeNames[EGST_COUNT+1]
Names for gui element types.
Definition: IGUISkin.h:49
A skin modifies the look of the GUI elements.
Definition: IGUISkin.h:378
virtual void drawIcon(IGUIElement *element, EGUI_DEFAULT_ICON icon, const core::position2di position, u32 starttime=0, u32 currenttime=0, bool loop=false, const core::rect< s32 > *clip=0)=0
draws an icon, usually from the skin&#39;s sprite bank
pixels to move the button text to the right when a pushbutton is pressed
Definition: IGUISkin.h:191
Inactive window border.
Definition: IGUISkin.h:87
Tooltip text for window restore button.
Definition: IGUISkin.h:246
const c8 *const GUISkinFontNames[EGDF_COUNT+1]
Definition: IGUISkin.h:367
width of a checkbox check
Definition: IGUISkin.h:159
minimize window button
Definition: IGUISkin.h:276
Inactive window caption.
Definition: IGUISkin.h:89
distance for text from background
Definition: IGUISkin.h:171
EGUI_DEFAULT_TEXT
Definition: IGUISkin.h:229
Face color for three-dimensional display elements and for dialog box backgrounds. ...
Definition: IGUISkin.h:67
virtual const wchar_t * getDefaultText(EGUI_DEFAULT_TEXT text) const =0
Returns a default text.
Icons in a list or tree.
Definition: IGUISkin.h:101
Font interface.
Definition: IGUIFont.h:39
maximal space to reserve for messagebox text-width
Definition: IGUISkin.h:181
Text for the OK button on a message box.
Definition: IGUISkin.h:232
Tooltip text for window minimize button.
Definition: IGUISkin.h:244
signed int s32
32 bit signed variable.
Definition: irrTypes.h:66
pixels to move the button image to the right when a pushbutton is pressed
Definition: IGUISkin.h:187
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:58
EGUI_DEFAULT_COLOR
Enumeration for skin colors.
Definition: IGUISkin.h:60
virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor)=0
sets a default color
down arrow for dropdown menus
Definition: IGUISkin.h:292
Burning&#39;s skin.
Definition: IGUISkin.h:39
<< icon indicating there is more content to the left
Definition: IGUISkin.h:300
For static text, edit boxes, lists and most other places.
Definition: IGUISkin.h:353
Text for the Cancel button on a message box.
Definition: IGUISkin.h:234
const c8 *const GUISkinIconNames[EGDI_COUNT+1]
Definition: IGUISkin.h:321
virtual s32 getSize(EGUI_DEFAULT_SIZE size) const =0
returns size for the given size type
Active window title bar text.
Definition: IGUISkin.h:75
Text for the No button on a message box.
Definition: IGUISkin.h:238
this value is not used, it only specifies the number of skin types
Definition: IGUISkin.h:45
default with / height of scrollbar
Definition: IGUISkin.h:153
Dark shadow for three-dimensional display elements.
Definition: IGUISkin.h:63
Light color for three-dimensional display elements (for edges facing the light source.)
Definition: IGUISkin.h:71
Font for menu items.
Definition: IGUISkin.h:359
value not used, it only specifies the number of icons
Definition: IGUISkin.h:318
this value is not used, it only specifies the number of default texts
Definition: IGUISkin.h:249
Item(s) selected in a control.
Definition: IGUISkin.h:83
const c8 *const GUISkinSizeNames[EGDS_COUNT+1]
Names for default skin sizes.
Definition: IGUISkin.h:202
virtual EGUI_SKIN_TYPE getType() const
get the type of this skin
Definition: IGUISkin.h:566
file icon for file selection
Definition: IGUISkin.h:313
minimal space to reserve for messagebox text-width
Definition: IGUISkin.h:179
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index)=0
Sets a default icon.
Class representing a 32 bit ARGB color.
Definition: SColor.h:201
Base class of all GUI elements.
Definition: IGUIElement.h:25
Tooltip text for window maximize button.
Definition: IGUISkin.h:242
Default windows look and feel.
Definition: IGUISkin.h:33
Window background for editable field (editbox, checkbox-field)
Definition: IGUISkin.h:107
An unknown skin, not serializable at present.
Definition: IGUISkin.h:42
scroll bar left button
Definition: IGUISkin.h:284
Font for buttons.
Definition: IGUISkin.h:355
virtual void draw3DToolBar(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a standard 3d tool bar
Text for the Yes button on a message box.
Definition: IGUISkin.h:236
close window button
Definition: IGUISkin.h:274
2d vector template class with lots of operators and methods.
Definition: dimension2d.h:16
plus icon for trees
Definition: IGUISkin.h:308
virtual void draw3DTabBody(IGUIElement *element, bool border, bool background, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)=0
draws a tab control body
Grayed (disabled) window symbols like on close buttons, scroll bars and check boxes.
Definition: IGUISkin.h:105
Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons.
Definition: IGUISkin.h:36
Selected icons in a list or tree.
Definition: IGUISkin.h:103
Background color of multiple document interface (MDI) applications.
Definition: IGUISkin.h:77
virtual void draw3DTabButton(IGUIElement *element, bool active, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)=0
draws a tab button
Font for window title bars.
Definition: IGUISkin.h:357
free space in a messagebox between borders and contents on all sides
Definition: IGUISkin.h:177
width of a window button
Definition: IGUISkin.h:157
EGUI_DEFAULT_FONT
Definition: IGUISkin.h:350
distance for text from background
Definition: IGUISkin.h:169
Text on a button.
Definition: IGUISkin.h:79
Font for tooltips.
Definition: IGUISkin.h:361
Shadow color for three-dimensional display elements (for edges facing away from the light source)...
Definition: IGUISkin.h:65
maximize window button
Definition: IGUISkin.h:270
Window background.
Definition: IGUISkin.h:97
Tool tip text color.
Definition: IGUISkin.h:91
height of a default button
Definition: IGUISkin.h:167
EGUI_DEFAULT_ICON
Customizable symbols for GUI.
Definition: IGUISkin.h:267
Scrollbar gray area.
Definition: IGUISkin.h:95
pixels to move the button text down when a pushbutton is pressed
Definition: IGUISkin.h:193
distance for text in the title bar, from the left of the window rect
Definition: IGUISkin.h:173
maximal space to reserve for messagebox text-height
Definition: IGUISkin.h:185
scroll bar up button
Definition: IGUISkin.h:280
Grayed (disabled) text.
Definition: IGUISkin.h:81
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const =0
Returns a default icon.
distance for text in the title bar, from the top of the window rect
Definition: IGUISkin.h:175
Highlight color for three-dimensional display elements (for edges facing the light source...
Definition: IGUISkin.h:69
icon indicating that there is more content below
Definition: IGUISkin.h:306