TGUI  0.8.9
ButtonRenderer.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2020 Bruno Van de Velde (vdv_b@tgui.eu)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25
26#ifndef TGUI_BUTTON_RENDERER_HPP
27#define TGUI_BUTTON_RENDERER_HPP
28
29
30#include <TGUI/Renderers/WidgetRenderer.hpp>
31
33
34namespace tgui
35{
36 class TGUI_API ButtonRenderer : public WidgetRenderer
37 {
38 public:
39
41
42
49 void setBorders(const Borders& borders);
50
51
59
60
67 void setTextColor(Color color);
68
69
77
78
86
87
95
96
104
105
113
114
122
123
131
132
138
139
145
146
156
157
165
166
176
177
185
186
196
197
205
206
216
217
225
226
234
235
241
242
250
251
259
260
268
269
277
278
286
287
295
296
304
305
313
314
320
321
327
328
337 void setTexture(const Texture& texture);
338
339
347
348
355 void setTextureHover(const Texture& texture);
356
357
365
366
373 void setTextureDown(const Texture& texture);
374
375
383
384
391 void setTextureDisabled(const Texture& texture);
392
393
401
402
407 void setTextureFocused(const Texture& texture);
408
409
415
416
424
425
433
434
442
443
451
452
460
461
469
470
478
479
487
488
494
495
501
502
507 void setTextOutlineColor(Color outlineColor);
508
509
515
516
521 void setTextOutlineThickness(float outlineThickness);
522
523
529
530
532 };
533
535}
536
538
539#endif // TGUI_BUTTON_RENDERER_HPP
Definition: ButtonRenderer.hpp:37
void setTextColorHover(Color color)
Changes the color of the text in the hover state (mouse on button, but not pressed)
void setTextOutlineColor(Color outlineColor)
Changes the outline color of the text (used when TextOutlineThickness > 0)
Texture & getTextureDisabled() const
Returns the image that is displayed when the button is disabled.
void setTextStyle(TextStyle style)
Changes the text style.
void setBackgroundColorHover(Color color)
Changes the color of the background in the hover state (mouse on button, but not pressed)
TextStyle getTextStyle() const
Returns text style.
void setTextureFocused(const Texture &texture)
Change the image that is drawn on top of the button image when the button is focused (while not hover...
void setTextureHover(const Texture &texture)
Changes the image that is displayed when the mouse is located on top of the button.
void setTextureDown(const Texture &texture)
Changes the image that is displayed when the mouse is held down on top of the button.
TextStyle getTextStyleDown() const
Returns text style in the down state (mouse on button and left mouse button being held down)
void setTextOutlineThickness(float outlineThickness)
Changes the thickness of the text outline (0 by default, which means there is no outline).
void setTextColorDown(Color color)
Changes the color of the text in the down state (mouse on button and left mouse button being held dow...
Color getTextColorDown() const
Returns the text color in the down state (mouse on button and left mouse button being held down)
TextStyle getTextStyleHover() const
Returns text style in the hover state (mouse on button, but not pressed)
Color getBackgroundColorDisabled() const
Returns the background color that is used when the button is disabled.
void setTextStyleFocused(TextStyle style)
Changes the text style that is used when the button is focused (while not hovered)
Color getTextColorFocused() const
Returns the text color that is used when the button is focused.
Color getTextColorHover() const
Returns the text color in the hover state (mouse on button, but not pressed)
void setBorderColor(Color color)
Changes the color of the borders.
void setTexture(const Texture &texture)
Change the image that is displayed.
Color getBorderColorHover() const
Returns the color of the borders in the hover state (mouse on button, but not pressed)
Color getBorderColorFocused() const
Returns the color of the borders that is used when the button is focused.
void setBorderColorDown(Color color)
Changes the color of the borders in the down state (mouse on button and left mouse button being held ...
Texture & getTextureHover() const
Returns the image that is displayed when the mouse is located on top of the button.
Color getTextOutlineColor() const
Returns the outline color of the text (used when TextOutlineThickness > 0)
TextStyle getTextStyleFocused() const
Returns text style used when the button is focused.
void setBorderColorHover(Color color)
Changes the color of the borders in the hover state (mouse on button, but not pressed)
TextStyle getTextStyleDisabled() const
Returns text style used when the button is disabled.
void setBorders(const Borders &borders)
Changes the size of the borders.
Color getBackgroundColor() const
Returns the background color.
Color getBackgroundColorHover() const
Returns the background color in the hover state (mouse on button, but not pressed)
void setTextStyleHover(TextStyle style)
Changes the text style in the hover state (mouse on button, but not pressed)
Color getBorderColorDown() const
Returns the color of the borders in the down state (mouse on button and left mouse button being held ...
Borders getBorders() const
Returns the size of the borders.
Color getBorderColorDisabled() const
Returns the color of the borders that is used when the button is disabled.
void setBackgroundColorDisabled(Color color)
Changes the color of the background that is used when the button is disabled.
Texture & getTextureFocused() const
Returns the image that is drawn on top of the button image when the button is focused.
void setBackgroundColorFocused(Color color)
Changes the color of the background that is used when the button is focused (while not hovered)
Color getBackgroundColorDown() const
Returns the background color in the down state (mouse on button and left mouse button being held down...
void setBackgroundColorDown(Color color)
Changes the color of the background in the down state (mouse on button and left mouse button being he...
void setTextColorFocused(Color color)
Changes the color of the text that is used when the button is focused (while not hovered)
Color getBorderColor() const
Returns the color of the borders.
Color getBackgroundColorFocused() const
Returns the background color that is used when the button is focused.
float getTextOutlineThickness() const
Returns the thickness of the text outline.
void setTextStyleDisabled(TextStyle style)
Changes the text style that is used when the button is disabled.
void setTextColorDisabled(Color color)
Changes the color of the text that is used when the button is disabled.
void setBorderColorFocused(Color color)
Changes the color of the borders that is used when the button is focused (while not hovered)
void setTextColor(Color color)
Changes the color of the text.
void setBackgroundColor(Color color)
Changes the color of the background.
Color getTextColorDisabled() const
Returns the text color that is used when the button is disabled.
void setTextStyleDown(TextStyle style)
Changes the text style in the down state (mouse on button and left mouse button being held down)
Color getTextColor() const
Returns the text color.
Texture & getTexture() const
Returns the image that is displayed.
Texture & getTextureDown() const
Returns the image that is displayed when the mouse is held down on top of the button.
void setBorderColorDisabled(Color color)
Changes the color of the borders that is used when the button is disabled.
void setTextureDisabled(const Texture &texture)
Changes the image that is displayed when the button is disabled.
Wrapper for colors.
Definition: Color.hpp:49
Definition: Outline.hpp:39
Wrapper for text styles.
Definition: TextStyle.hpp:47
Definition: Texture.hpp:42
Base class for all renderer classes.
Definition: WidgetRenderer.hpp:81
WidgetRenderer()=default
Default constructor.
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37