TGUI  0.8.8
ButtonRenderer.hpp
1 //
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 
34 namespace 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 
85  void setTextColorHover(Color color);
86 
87 
95 
96 
103  void setTextColorDown(Color color);
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 
249  void setBorderColor(Color color);
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 
346  Texture& getTexture() const;
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 
423  void setTextStyle(TextStyle style);
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 
528  float getTextOutlineThickness() const;
529 
530 
532  };
533 
535 }
536 
538 
539 #endif // TGUI_BUTTON_RENDERER_HPP
void setBackgroundColorDown(Color color)
Changes the color of the background in the down state (mouse on button and left mouse button being he...
Color getBackgroundColorDown() const
Returns the background color in the down state (mouse on button and left mouse button being held down...
Definition: ButtonRenderer.hpp:37
Color getTextColorHover() const
Returns the text color in the hover state (mouse on button, but not pressed)
void setTextureDown(const Texture &texture)
Changes 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 setBackgroundColorHover(Color color)
Changes the color of the background in the hover state (mouse on button, but not pressed)
void setBorders(const Borders &borders)
Changes the size of the borders.
void setBorderColorFocused(Color color)
Changes the color of the borders that is used when the button is focused (while not hovered)
void setTextStyleFocused(TextStyle style)
Changes the text style that is used when the button is focused (while not hovered)
Color getTextColor() const
Returns the text color.
Base class for all renderer classes.
Definition: WidgetRenderer.hpp:81
Texture & getTexture() const
Returns the image that is displayed.
Color getTextColorDisabled() const
Returns the text color that is used when the button is disabled.
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...
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37
TextStyle getTextStyleFocused() const
Returns text style used when the button is focused.
Color getBorderColorDisabled() const
Returns the color of the borders that is used when the button is disabled.
Wrapper for colors.
Definition: Color.hpp:49
Color getTextColorDown() const
Returns the text color in the down state (mouse on button and left mouse button being held down)
Color getTextColorFocused() const
Returns the text color that is used when the button is focused.
void setTextColorDisabled(Color color)
Changes the color of the text that is used when the button is disabled.
void setBorderColorDown(Color color)
Changes the color of the borders in the down state (mouse on button and left mouse button being held ...
void setTextOutlineColor(Color outlineColor)
Changes the outline color of the text (used when TextOutlineThickness > 0)
void setTextStyle(TextStyle style)
Changes the text style.
void setTextColor(Color color)
Changes the color of the text.
TextStyle getTextStyleDown() const
Returns text style in the down state (mouse on button and left mouse button being held down)
Color getBackgroundColorFocused() const
Returns the background color that is used when the button is focused.
Definition: Texture.hpp:42
void setTextStyleHover(TextStyle style)
Changes the text style in the hover state (mouse on button, but not pressed)
void setTextOutlineThickness(float outlineThickness)
Changes the thickness of the text outline (0 by default, which means there is no outline).
Color getBorderColor() const
Returns the color of the borders.
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)
Texture & getTextureFocused() const
Returns the image that is drawn on top of the button image when the button is focused.
TextStyle getTextStyle() const
Returns text style.
void setBackgroundColor(Color color)
Changes the color of the background.
void setBackgroundColorFocused(Color color)
Changes the color of the background that is used when the button is focused (while not hovered)
Borders getBorders() const
Returns the size of the borders.
void setTextColorHover(Color color)
Changes the color of the text in the hover state (mouse on button, but not pressed)
void setBorderColorHover(Color color)
Changes the color of the borders in the hover state (mouse on button, but not pressed)
void setTextColorDown(Color color)
Changes the color of the text in the down state (mouse on button and left mouse button being held dow...
Texture & getTextureDown() const
Returns the image that is displayed when the mouse is held down on top of the button.
Color getBackgroundColorHover() const
Returns the background color in the hover state (mouse on button, but not pressed)
Definition: Outline.hpp:39
Color getBackgroundColor() const
Returns the background color.
void setBorderColor(Color color)
Changes the color of the borders.
TextStyle getTextStyleHover() const
Returns text style in the hover state (mouse on button, but not pressed)
Color getBorderColorHover() const
Returns the color of the borders in the hover state (mouse on button, but not pressed)
void setTexture(const Texture &texture)
Change the image that is displayed.
WidgetRenderer()=default
Default constructor.
TextStyle getTextStyleDisabled() const
Returns text style used when the button is disabled.
void setTextColorFocused(Color color)
Changes the color of the text that is used when the button is focused (while not hovered)
void setTextStyleDisabled(TextStyle style)
Changes the text style that is used when the button is disabled.
void setTextureHover(const Texture &texture)
Changes the image that is displayed when the mouse is located on top of the button.
void setTextStyleDown(TextStyle style)
Changes the text style in the down state (mouse on button and left mouse button being held down)
Color getBorderColorFocused() const
Returns the color of the borders that is used when the button is focused.
Color getBackgroundColorDisabled() const
Returns the background color that is used when the button is disabled.
Color getBorderColorDown() const
Returns the color of the borders in the down state (mouse on button and left mouse button being held ...
Texture & getTextureDisabled() const
Returns the image that is displayed when the button is disabled.
float getTextOutlineThickness() const
Returns the thickness of the text outline.
void setTextureDisabled(const Texture &texture)
Changes the image that is displayed when the button is disabled.
Wrapper for text styles.
Definition: TextStyle.hpp:47
void setBackgroundColorDisabled(Color color)
Changes the color of the background that is used when the button is disabled.