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  {
198 
202  };
203 
204 
206  const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
207  {
208  "ScrollBarSize",
209  "MenuHeight",
210  "WindowButtonWidth",
211  "CheckBoxWidth",
212  "MessageBoxWidth",
213  "MessageBoxHeight",
214  "ButtonWidth",
215  "ButtonHeight",
216  "TextDistanceX",
217  "TextDistanceY",
218  "TitleBarTextX",
219  "TitleBarTextY",
220  "MessageBoxGapSpace",
221  "MessageBoxMinTextWidth",
222  "MessageBoxMaxTextWidth",
223  "MessageBoxMinTextHeight",
224  "MessageBoxMaxTextHeight",
225  "ButtonPressedImageOffsetX",
226  "ButtonPressedImageOffsetY",
227  "ButtonPressedTextOffsetX",
228  "ButtonPressedTextOffsetY",
229  "ButtonPressedSpriteOffsetX",
230  "ButtonPressedSpriteOffsetY",
231  0
232  };
233 
234 
236  {
253 
256  };
257 
259  const c8* const GUISkinTextNames[EGDT_COUNT+1] =
260  {
261  "MessageBoxOkay",
262  "MessageBoxCancel",
263  "MessageBoxYes",
264  "MessageBoxNo",
265  "WindowButtonClose",
266  "WindowButtonMaximize",
267  "WindowButtonMinimize",
268  "WindowButtonRestore",
269  0
270  };
271 
274  {
315 
322 
325  };
326 
327  const c8* const GUISkinIconNames[EGDI_COUNT+1] =
328  {
329  "windowMaximize",
330  "windowRestore",
331  "windowClose",
332  "windowMinimize",
333  "windowResize",
334  "cursorUp",
335  "cursorDown",
336  "cursorLeft",
337  "cursorRight",
338  "menuMore",
339  "checkBoxChecked",
340  "dropDown",
341  "smallCursorUp",
342  "smallCursorDown",
343  "radioButtonChecked",
344  "moreLeft",
345  "moreRight",
346  "moreUp",
347  "moreDown",
348  "expand",
349  "collapse",
350  "file",
351  "directory",
352  0
353  };
354 
355  // Customizable fonts
357  {
371  };
372 
373  const c8* const GUISkinFontNames[EGDF_COUNT+1] =
374  {
375  "defaultFont",
376  "buttonFont",
377  "windowFont",
378  "menuFont",
379  "tooltipFont",
380  0
381  };
382 
385  {
386  public:
387 
389  virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
390 
392  virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
393 
395  virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
396 
398 
400  virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
401 
403 
405  virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
406 
408  virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
409 
411  virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0;
412 
414  virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
415 
417  virtual IGUISpriteBank* getSpriteBank() const = 0;
418 
420  virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
421 
423 
424  virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
425 
427 
431  virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
432 
434 
442  virtual void draw3DButtonPaneStandard(IGUIElement* element,
443  const core::rect<s32>& rect,
444  const core::rect<s32>* clip=0) = 0;
445 
447 
455  virtual void draw3DButtonPanePressed(IGUIElement* element,
456  const core::rect<s32>& rect,
457  const core::rect<s32>* clip=0) = 0;
458 
460 
471  virtual void draw3DSunkenPane(IGUIElement* element,
472  video::SColor bgcolor, bool flat, bool fillBackGround,
473  const core::rect<s32>& rect,
474  const core::rect<s32>* clip=0) = 0;
475 
477 
491  bool drawTitleBar, video::SColor titleBarColor,
492  const core::rect<s32>& rect,
493  const core::rect<s32>* clip=0,
494  core::rect<s32>* checkClientArea=0) = 0;
495 
497 
505  virtual void draw3DMenuPane(IGUIElement* element,
506  const core::rect<s32>& rect,
507  const core::rect<s32>* clip=0) = 0;
508 
510 
516  virtual void draw3DToolBar(IGUIElement* element,
517  const core::rect<s32>& rect,
518  const core::rect<s32>* clip=0) = 0;
519 
521 
529  virtual void draw3DTabButton(IGUIElement* element, bool active,
530  const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
531 
533 
542  virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
543  const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
544 
546 
555  virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
556  const core::position2di position, u32 starttime=0, u32 currenttime=0,
557  bool loop=false, const core::rect<s32>* clip=0) = 0;
558 
560 
568  virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
569  const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
570 
572  virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
573  };
574 
575 
576 } // end namespace gui
577 } // end namespace irr
578 
579 #endif
580 
icon for menu children
Definition: IGUISkin.h:294
virtual IGUISpriteBank * getSpriteBank() const =0
returns the sprite bank
icon indicating that there is more content to the right
Definition: IGUISkin.h:308
Tooltip text for window close button.
Definition: IGUISkin.h:246
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 an unscaled button image down when a button is pressed and the unpressed image looks i...
Definition: IGUISkin.h:189
icon indicating that there is more content above
Definition: IGUISkin.h:310
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:304
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
Active window border.
Definition: IGUISkin.h:73
pixels to move an unscaled button sprite down when a button is pressed
Definition: IGUISkin.h:197
Text of item(s) selected in a control.
Definition: IGUISkin.h:85
char c8
8 bit character variable.
Definition: irrTypes.h:35
scroll bar down button
Definition: IGUISkin.h:288
minus icon for trees
Definition: IGUISkin.h:317
const c8 *const GUISkinColorNames[EGDC_COUNT+1]
Names for default skin colors.
Definition: IGUISkin.h:119
Aligned to parent's top or left side (default)
Definition: EGUIAlignment.h:15
Tool tip background color.
Definition: IGUISkin.h:93
restore window button
Definition: IGUISkin.h:278
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:259
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:321
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:284
virtual void draw3DButtonPanePressed(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a pressed 3d button pane
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size)=0
sets a default size
scroll bar right button
Definition: IGUISkin.h:292
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:384
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's sprite bank
pixels to move the button text to the right when a button is pressed
Definition: IGUISkin.h:191
Inactive window border.
Definition: IGUISkin.h:87
Tooltip text for window restore button.
Definition: IGUISkin.h:252
const c8 *const GUISkinFontNames[EGDF_COUNT+1]
Definition: IGUISkin.h:373
width of a checkbox check
Definition: IGUISkin.h:159
minimize window button
Definition: IGUISkin.h:282
Inactive window caption.
Definition: IGUISkin.h:89
distance for text from background
Definition: IGUISkin.h:171
EGUI_DEFAULT_TEXT
Definition: IGUISkin.h:235
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:238
Tooltip text for window minimize button.
Definition: IGUISkin.h:250
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
pixels to move an unscaled button image to the right when a button is pressed and the unpressed image...
Definition: IGUISkin.h:187
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
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:298
Burning's skin.
Definition: IGUISkin.h:39
<< icon indicating there is more content to the left
Definition: IGUISkin.h:306
For static text, edit boxes, lists and most other places.
Definition: IGUISkin.h:359
Text for the Cancel button on a message box.
Definition: IGUISkin.h:240
const c8 *const GUISkinIconNames[EGDI_COUNT+1]
Definition: IGUISkin.h:327
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:244
this value is not used, it only specifies the number of skin types
Definition: IGUISkin.h:45
default with / height of scrollbar. Also width of drop-down button in comboboxes.
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
pixels to move an unscaled button sprite to the right when a button is pressed
Definition: IGUISkin.h:195
Font for menu items.
Definition: IGUISkin.h:365
value not used, it only specifies the number of icons
Definition: IGUISkin.h:324
this value is not used, it only specifies the number of default texts
Definition: IGUISkin.h:255
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:206
virtual EGUI_SKIN_TYPE getType() const
get the type of this skin
Definition: IGUISkin.h:572
file icon for file selection
Definition: IGUISkin.h:319
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:314
Base class of all GUI elements.
Definition: IGUIElement.h:23
Tooltip text for window maximize button.
Definition: IGUISkin.h:248
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:290
Font for buttons.
Definition: IGUISkin.h:361
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:242
close window button
Definition: IGUISkin.h:280
2d vector template class with lots of operators and methods.
Definition: dimension2d.h:16
plus icon for trees
Definition: IGUISkin.h:314
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:363
free space in a messagebox between borders and contents on all sides
Definition: IGUISkin.h:177
width and height of a window titlebar button (like minimize/maximize/close buttons)....
Definition: IGUISkin.h:157
EGUI_DEFAULT_FONT
Definition: IGUISkin.h:356
distance for text from background
Definition: IGUISkin.h:169
Text on a button.
Definition: IGUISkin.h:79
Font for tooltips.
Definition: IGUISkin.h:367
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:276
Window background.
Definition: IGUISkin.h:97
Tool tip text color.
Definition: IGUISkin.h:91
height of a default button (OK and cancel buttons)
Definition: IGUISkin.h:167
EGUI_DEFAULT_ICON
Customizable symbols for GUI.
Definition: IGUISkin.h:273
Scrollbar gray area.
Definition: IGUISkin.h:95
pixels to move the button text down when a button 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:286
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:312