TGUI 1.13
Loading...
Searching...
No Matches
EditBoxRenderer.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2026 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#ifndef TGUI_EDIT_BOX_RENDERER_HPP
26#define TGUI_EDIT_BOX_RENDERER_HPP
27
28#include <TGUI/Renderers/WidgetRenderer.hpp>
29
31
32namespace tgui
33{
34 class TGUI_API EditBoxRenderer : public WidgetRenderer
35 {
36 public:
38
45
51 [[nodiscard]] TextStyles getTextStyle() const;
52
63
69 [[nodiscard]] TextStyles getDefaultTextStyle() const;
70
76 void setBorders(const Borders& borders);
77
83 [[nodiscard]] Borders getBorders() const;
84
93 void setPadding(const Padding& padding);
94
102 [[nodiscard]] Padding getPadding() const;
103
109 void setCaretWidth(float width);
110
116 [[nodiscard]] float getCaretWidth() const;
117
123 void setTextColor(Color textColor);
124
130 [[nodiscard]] Color getTextColor() const;
131
138
144 [[nodiscard]] Color getTextColorDisabled() const;
145
150 void setTextColorFocused(Color textColor);
151
156 [[nodiscard]] Color getTextColorFocused() const;
157
163 void setSelectedTextColor(Color selectedTextColor);
164
170 [[nodiscard]] Color getSelectedTextColor() const;
171
177 void setSelectedTextBackgroundColor(Color selectedTextBackgroundColor);
178
185
191 void setDefaultTextColor(Color defaultTextColor);
192
198 [[nodiscard]] Color getDefaultTextColor() const;
199
208
214 [[nodiscard]] Color getBackgroundColor() const;
215
224
230 [[nodiscard]] Color getBackgroundColorHover() const;
231
240
246 [[nodiscard]] Color getBackgroundColorDisabled() const;
247
255
260 [[nodiscard]] Color getBackgroundColorFocused() const;
261
267 void setCaretColor(Color caretColor);
268
274 [[nodiscard]] Color getCaretColor() const;
275
281 void setCaretColorHover(Color caretColor);
282
288 [[nodiscard]] Color getCaretColorHover() const;
289
294 TGUI_DEPRECATED("Use setCaretColor instead, caret is never shown in unfocused state")
295 void setCaretColorFocused(Color caretColor);
296
301 TGUI_DEPRECATED("Use getCaretColor instead, caret is never shown in unfocused state")
302 [[nodiscard]] Color getCaretColorFocused() const;
303
310
316 [[nodiscard]] Color getBorderColor() const;
317
324
330 [[nodiscard]] Color getBorderColorHover() const;
331
338
344 [[nodiscard]] Color getBorderColorDisabled() const;
345
351
356 [[nodiscard]] Color getBorderColorFocused() const;
357
365 void setTexture(const Texture& texture);
366
372 [[nodiscard]] const Texture& getTexture() const;
373
379 void setTextureHover(const Texture& texture);
380
386 [[nodiscard]] const Texture& getTextureHover() const;
387
393 void setTextureDisabled(const Texture& texture);
394
400 [[nodiscard]] const Texture& getTextureDisabled() const;
401
407 void setTextureFocused(const Texture& texture);
408
414 [[nodiscard]] const Texture& getTextureFocused() const;
415
424 void setRoundedBorderRadius(float radius);
425
431 [[nodiscard]] float getRoundedBorderRadius() const;
432 };
433} // namespace tgui
434
435#endif // TGUI_EDIT_BOX_RENDERER_HPP
Wrapper for colors.
Definition Color.hpp:63
Definition EditBoxRenderer.hpp:35
void setBorderColorFocused(Color color)
Changes the color of the borders used when the edit box is focused.
const Texture & getTexture() const
Returns the image that is displayed.
TextStyles getTextStyle() const
Returns text style.
Padding getPadding() const
Returns the size of the padding.
void setPadding(const Padding &padding)
Changes the padding of the edit box.
void setDefaultTextColor(Color defaultTextColor)
Sets the color of the default text that can optionally be displayed when the edit box is empty.
void setBorders(const Borders &borders)
Changes the size of the borders.
Color getBorderColor() const
Returns the color of the borders.
void setCaretColor(Color caretColor)
Sets the color that will be used inside the edit box for the blinking caret.
void setTextColorFocused(Color textColor)
Sets the text color that will be used inside the edit box when the edit box is focused.
const Texture & getTextureHover() const
Returns the image that is displayed when the mouse is located on top of the edit box.
Color getCaretColorFocused() const
Returns the color that will be used for the blinking caret when the edit box is focused.
Color getTextColorFocused() const
Returns the text color that will be used inside the edit box when the edit box is focused.
void setSelectedTextBackgroundColor(Color selectedTextBackgroundColor)
Sets the background color of the selected text that will be used inside the edit box.
void setTextureFocused(const Texture &texture)
Changes the image that is drawn on top of the edit box image when the edit box is focused.
void setBorderColorDisabled(Color color)
Changes the color of the borders used when the edit box is disabled.
void setBackgroundColor(Color color)
Changes the color of the background.
Borders getBorders() const
Returns the size of the borders.
void setBorderColor(Color color)
Changes the color of the borders.
Color getBorderColorHover() const
Returns the color of the borders used when the mouse is on top of the edit box.
Color getCaretColorHover() const
Returns the color that will be used for the blinking caret when the mouse is on top of the edit box.
void setTextStyle(TextStyles style)
Changes the text style.
void setTexture(const Texture &texture)
Changes the image that is displayed.
void setBackgroundColorFocused(Color color)
Changes the color of the background when the edit box is focused.
void setBackgroundColorDisabled(Color color)
Changes the color of the background when the edit box is disabled.
float getRoundedBorderRadius() const
Returns the radius for the rounded corners if you want to draw a rounded rectangle as background.
void setTextureDisabled(const Texture &texture)
Changes the image that is displayed when the edit box is disabled.
void setDefaultTextStyle(TextStyles style)
Changes the text style of the default text (the text drawn when the edit box is empty).
void setTextureHover(const Texture &texture)
Changes the image that is displayed when the mouse is located on top of the edit box.
float getCaretWidth() const
Returns the caret width.
Color getCaretColor() const
Returns the color that will be used inside the edit box for the blinking caret.
Color getBorderColorFocused() const
Returns the color of the borders used when the edit box is focused.
const Texture & getTextureDisabled() const
Returns the image that is displayed when the edit box is disabled.
Color getBackgroundColorFocused() const
Returns the color of the background when the edit box is focused.
void setCaretWidth(float width)
Changes the width of the caret.
void setBorderColorHover(Color color)
Changes the color of the borders used when the mouse is on top of the edit box.
Color getDefaultTextColor() const
Returns the color of the default text that can optionally be displayed when the edit box is empty.
Color getBackgroundColorHover() const
Returns the color of the background in the hover state (mouse on edit box).
void setSelectedTextColor(Color selectedTextColor)
Sets the text color of the selected text that will be used inside the edit box.
void setTextColorDisabled(Color textColor)
Sets the text color that will be used inside the edit box when the edit box is disabled.
TextStyles getDefaultTextStyle() const
Returns the text style of the default text (the text drawn when the edit box is empty).
Color getSelectedTextColor() const
Returns the text color of the selected text that will be used inside the edit box.
WidgetRenderer()=default
Default constructor.
Color getBackgroundColorDisabled() const
Returns the color of the background when the edit box is disabled.
Color getSelectedTextBackgroundColor() const
Returns the background color of the selected text that will be used inside the edit box.
Color getTextColor() const
Returns the text color that will be used inside the edit box.
void setBackgroundColorHover(Color color)
Changes the color of the background in the hover state (mouse on edit box, but not pressed).
Color getBackgroundColor() const
Returns the color of the background.
void setCaretColorHover(Color caretColor)
Sets the color that will be used for the blinking caret when the mouse is on top of the edit box.
const Texture & getTextureFocused() const
Returns the image that is drawn on top of the edit box image when the edit box is focused.
Color getBorderColorDisabled() const
Returns the color of the borders used when the edit box is disabled.
void setRoundedBorderRadius(float radius)
Changes the radius for the rounded corners if you want to draw a rounded rectangle as background.
void setCaretColorFocused(Color caretColor)
Sets the color that will be used for the blinking caret when the edit box is focused.
Color getTextColorDisabled() const
Returns the text color that will be used inside the edit box when the edit box is disabled.
void setTextColor(Color textColor)
Sets the text color that will be used inside the edit box.
Wrapper for text styles.
Definition TextStyle.hpp:55
Texture wrapper that internally reuses resources when multiple Texture objects are loaded from the sa...
Definition Texture.hpp:53
WidgetRenderer()=default
Default constructor.
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:37