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