Max OS
0.3
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1
9
#ifndef MAXOS_GUI_WDIGETS_TEXT_H
10
#define MAXOS_GUI_WDIGETS_TEXT_H
11
12
#include <cstdint>
13
#include <
common/graphicsContext.h
>
14
#include <
gui/widget.h
>
15
#include <
gui/font.h
>
16
17
18
namespace
MaxOS::gui::widgets {
19
24
class
Text
:
public
Widget
{
25
26
private
:
27
string
m_widget_text;
28
29
public
:
30
31
gui::Font
font
;
32
33
common::Colour
foreground_colour
;
34
common::Colour
background_colour
;
35
36
Text
(int32_t left, int32_t top, uint32_t width, uint32_t height,
const
string
& text);
37
~Text
();
38
39
void
draw
(
common::GraphicsContext
* gc,
common::Rectangle<int32_t>
& area)
override
;
40
void
update_text
(
const
string
&);
41
42
};
43
}
44
45
46
#endif
//MAXOS_GUI_WDIGETS_TEXT_H
MaxOS::common::Colour
Stores the red, green, blue and alpha values of a colour. Can be parsed from a hex string,...
Definition
colour.h:91
MaxOS::common::GraphicsContext
Draws pixels to the screen, and handles drawing lines, rectangles and circles.
Definition
graphicsContext.h:22
MaxOS::common::Rectangle
Stores the left, top, width and height of a rectangle.
Definition
rectangle.h:22
MaxOS::gui::Font
A class that can be used to draw text.
Definition
font.h:27
MaxOS::gui::Widget
A graphical object that can be drawn on the screen.
Definition
widget.h:29
MaxOS::gui::widgets::Text
A box that can be used to display text.
Definition
text.h:24
MaxOS::gui::widgets::Text::foreground_colour
common::Colour foreground_colour
The colour of the text characters.
Definition
text.h:33
MaxOS::gui::widgets::Text::draw
void draw(common::GraphicsContext *gc, common::Rectangle< int32_t > &area) override
Draw the text on the screen.
Definition
text.cpp:45
MaxOS::gui::widgets::Text::background_colour
common::Colour background_colour
The colour to draw behind the text characters.
Definition
text.h:34
MaxOS::gui::widgets::Text::update_text
void update_text(const string &)
Update the text of the widget.
Definition
text.cpp:69
MaxOS::gui::widgets::Text::font
gui::Font font
The font to use for the text.
Definition
text.h:31
font.h
Defines a Font class for drawing text onto a graphics context.
graphicsContext.h
Defines a GraphicsContext class for drawing pixels, lines, rectangles and circles to the screen.
widget.h
Defines a base Widget class and CompositeWidget class for creating graphical user interface elements.
kernel
include
gui
widgets
text.h
Generated by
1.9.8