TGUI  0.9.5
Loading...
Searching...
No Matches
ButtonRenderer.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2022 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
40 using WidgetRenderer::WidgetRenderer;
41
42
48 void setBorders(const Borders& borders);
49
50
57
58
64 void setTextColor(Color color);
65
66
73
74
81
82
89
90
97
98
105
106
113
114
121
122
129
130
137
138
145
146
153
154
160
161
167
168
174
175
181
182
191
192
199
200
209
210
217
218
227
228
235
236
245
246
253
254
263
264
271
272
281
282
289
290
298
299
305
306
314
315
321
322
329
330
337
338
345
346
353
354
361
362
369
370
377
378
385
386
393
394
401
402
409
410
417
418
425
426
433
434
441
442
449
450
458 void setTexture(const Texture& texture);
459
460
466 const Texture& getTexture() const;
467
468
474 void setTextureDown(const Texture& texture);
475
476
482 const Texture& getTextureDown() const;
483
484
490 void setTextureHover(const Texture& texture);
491
492
498 const Texture& getTextureHover() const;
499
500
506 void setTextureDownHover(const Texture& texture);
507
508
515
516
522 void setTextureDisabled(const Texture& texture);
523
524
531
532
538 void setTextureDownDisabled(const Texture& texture);
539
540
547
548
554 void setTextureFocused(const Texture& texture);
555
556
563
564
570 void setTextureDownFocused(const Texture& texture);
571
572
579
580
587
588
595
596
603
604
611
612
619
620
627
628
635
636
643
644
651
652
659
660
667
668
675
676
683
684
691
692
699
700
707
708
713 void setTextOutlineColor(Color outlineColor);
714
715
721
722
727 void setTextOutlineThickness(float outlineThickness);
728
729
735
736
743 void setRoundedBorderRadius(float radius);
744
745
751
752
754 };
755
757
760
762}
763
765
766#endif // TGUI_BUTTON_RENDERER_HPP
Definition ButtonRenderer.hpp:37
void setTextStyleDownHover(TextStyles style)
Changes the text style when in both down and hover state (mouse on button while button pressed)
Color getBorderColorDownHover() const
Returns the color of the borders when in both down and hover state (mouse on button while button pres...
const Texture & getTextureDownFocused() const
Returns the image that is drawn on top of the button image when the button is focused while in presse...
TextStyles getTextStyle() const
Returns text style.
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)
void setBorderColorDownFocused(Color color)
Changes the color of the borders that is used when the button is focused while in pressed state.
void setTextStyleDownDisabled(TextStyles style)
Changes the text style that is used when the button is disabled while in pressed state.
Color getTextColorDownFocused() const
Returns the text color that is used when the button is focused while in pressed state.
void setBackgroundColorHover(Color color)
Changes the color of the background in the hover state (mouse on button, but not pressed)
void setBorderColorDownHover(Color color)
Changes the color of the borders when in both down and hover state (mouse on button while button pres...
void setTextColorDownFocused(Color color)
Changes the color of the text that is used when the button is focused while in pressed state.
void setTextureDownHover(const Texture &texture)
Changes the image that is displayed when in both down and hover state (mouse on button while button p...
void setTextureFocused(const Texture &texture)
Change the image that is drawn on top of the button image when the button is focused.
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.
void setTextColorDownDisabled(Color color)
Changes the color of the text that is used when the button is disabled while in pressed state.
TextStyles getTextStyleDownDisabled() const
Returns text style used when the button is disabled while in pressed state.
void setTextureDownDisabled(const Texture &texture)
Changes the image that is displayed when the button is disabled while in pressed state.
TextStyles getTextStyleFocused() const
Returns text style used when the button is focused.
void setTextOutlineThickness(float outlineThickness)
Changes the thickness of the text outline (0 by default, which means there is no outline).
TextStyles getTextStyleDownFocused() const
Returns text style used when the button is focused while in pressed state.
const Texture & getTexture() const
Returns the image that is displayed.
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)
Color getBackgroundColorDisabled() const
Returns the background color that is used when the button is disabled.
Color getTextColorDownHover() const
Returns the text color when in both down and hover state (mouse on button while button pressed)
void setTextStyleDownFocused(TextStyles style)
Changes the text style that is used when the button is focused while in pressed state.
Color getTextColorFocused() const
Returns the text color that is used when the button is focused.
TextStyles getTextStyleDownHover() const
Returns text style when in both down and hover state (mouse on button while button pressed)
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)
const Texture & getTextureDown() const
Returns the image that is displayed when the mouse is held down on top of the button.
void setBorderColorDownDisabled(Color color)
Changes the color of the borders that is used when the button is disabled while in pressed state.
Color getBackgroundColorDownDisabled() const
Returns the background color that is used when the button is disabled while in pressed state.
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 ...
Color getTextColorDownDisabled() const
Returns the text color that is used when the button is disabled while in pressed state.
Color getTextOutlineColor() const
Returns the outline color of the text (used when TextOutlineThickness > 0)
void setTextureDownFocused(const Texture &texture)
Change the image that is drawn on top of the button image when the button is focused while in pressed...
void setBorderColorHover(Color color)
Changes the color of the borders in the hover state (mouse on button, but not pressed)
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)
TextStyles getTextStyleHover() const
Returns text style in the hover state (mouse on button, but not pressed)
const Texture & getTextureDownHover() const
Returns the image that is displayed when in both down and hover state (mouse on button while button p...
Color getBorderColorDown() const
Returns the color of the borders in the down state (mouse on button and left mouse button being held ...
void setTextColorDownHover(Color color)
Changes the text color when in both down and hover state (mouse on button while button pressed)
Borders getBorders() const
Returns the size of the borders.
const Texture & getTextureHover() const
Returns the image that is displayed when the mouse is located on top of the button.
Color getBorderColorDisabled() const
Returns the color of the borders that is used when the button is disabled.
const Texture & getTextureDisabled() const
Returns the image that is displayed when the button is disabled.
void setBackgroundColorDisabled(Color color)
Changes the color of the background that is used when the button is disabled.
void setBackgroundColorFocused(Color color)
Changes the color of the background that is used when the button is focused.
Color getBackgroundColorDown() const
Returns the background color in the down state (mouse on button and left mouse button being held down...
void setBackgroundColorDownHover(Color color)
Changes the color of the background when in both down and hover state (mouse on button while button p...
void setBackgroundColorDown(Color color)
Changes the color of the background in the down state (mouse on button and left mouse button being he...
const Texture & getTextureDownDisabled() const
Returns the image that is displayed when the button is disabled while in pressed state.
void setTextColorFocused(Color color)
Changes the color of the text that is used when the button is focused.
const Texture & getTextureFocused() const
Returns the image that is drawn on top of the button image when the button is focused.
Color getBorderColor() const
Returns the color of the borders.
Color getBackgroundColorFocused() const
Returns the background color that is used when the button is focused.
Color getBorderColorDownFocused() const
Returns the color of the borders that is used when the button is focused while in pressed state.
float getRoundedBorderRadius() const
Returns the radius for the rounded corners if you want to draw a rounded rectangle as background.
void setBackgroundColorDownFocused(Color color)
Changes the color of the background used when the button is focused while in pressed state.
float getTextOutlineThickness() const
Returns the thickness of the text outline.
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.
void setTextColor(Color color)
Changes the color of the text.
void setBackgroundColor(Color color)
Changes the color of the background.
void setRoundedBorderRadius(float radius)
Changes the radius for the rounded corners if you want to draw a rounded rectangle as background.
Color getBackgroundColorDownFocused() const
Returns the background color that is used when the button is focused while in pressed state.
Color getTextColorDisabled() const
Returns the text color that is used when the button is disabled.
void setTextStyle(TextStyles style)
Changes the text style.
TextStyles getTextStyleDown() const
Returns text style in the down state (mouse on button and left mouse button being held down)
Color getBorderColorDownDisabled() const
Returns the color of the borders that is used when the button is disabled while in pressed state.
Color getTextColor() const
Returns the text color.
TextStyles getTextStyleDisabled() const
Returns text style used when the button is disabled.
void setTextStyleFocused(TextStyles style)
Changes the text style that is used when the button is focused.
Color getBackgroundColorDownHover() const
Returns the background color when in both down and hover state (mouse on button while button pressed)
void setTextStyleDown(TextStyles style)
Changes the text style in the down state (mouse on button and left mouse button being held down)
void setTextStyleHover(TextStyles style)
Changes the text style in the hover state (mouse on button, but not pressed)
void setBorderColorDisabled(Color color)
Changes the color of the borders that is used when the button is disabled.
void setTextStyleDisabled(TextStyles style)
Changes the text style that is used when the button is disabled.
void setBackgroundColorDownDisabled(Color color)
Changes the color of the background that is used when the button is disabled while in pressed state.
void setTextureDisabled(const Texture &texture)
Changes the image that is displayed when the button is disabled.
Wrapper for colors.
Definition Color.hpp:63
Definition Outline.hpp:39
Wrapper for text styles.
Definition TextStyle.hpp:58
Definition Texture.hpp:49
Base class for all renderer classes.
Definition WidgetRenderer.hpp:81
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36