13using namespace MaxOS::gui;
14using namespace MaxOS::common;
15using namespace MaxOS::drivers;
16using namespace MaxOS::drivers::peripherals;
29 m_title(0, -(10 + 5) + 2, width - 2 * 5, 10 + 5 - 3,
title_text),
32 m_resizer_bottom(
this),
34 m_resizer_right(
this),
35 m_resizer_top_left(
this),
36 m_resizer_top_right(
this),
37 m_resizer_bottom_left(
this),
38 m_resizer_bottom_right(
this)
68 m_resizer_bottom(
this),
70 m_resizer_right(
this),
71 m_resizer_top_left(
this),
72 m_resizer_top_right(
this),
73 m_resizer_bottom_left(
this),
74 m_resizer_bottom_right(
this)
93Window::~Window() =
default;
118 return &m_resizer_top_left;
121 return &m_resizer_left;
124 return &m_resizer_bottom_left;
127 return &m_resizer_top;
133 return &m_resizer_bottom;
136 return &m_resizer_top_right;
139 return &m_resizer_right;
142 return &m_resizer_bottom_right;
223 if (
child !=
nullptr) {
Stores the red, green, blue and alpha values of a colour. Can be parsed from a hex string,...
Draws pixels to the screen, and handles drawing lines, rectangles and circles.
Stores the left, top, width and height of a rectangle.
Type height
The height of the rectangle.
Type top
The top coordinate of the rectangle.
bool intersects(const Rectangle< Type > &)
Rectangle< Type > intersection(const Rectangle< Type > &)
Type left
The left coordinate of the rectangle.
Type width
The width of the rectangle.
Handles events that are triggered by the mouse driver.
uint8_t title_bar_height
How large the bar at the top of the window is.
uint8_t frame_thickness
How thick the bar around the window is.
drivers::peripherals::MouseEventHandler * on_mouse_button_pressed(uint32_t x, uint32_t y, uint8_t button) override
Handles the mouse button being pressed.
common::Colour area_colour
The background colour of the window inner area.
common::Colour frame_colour
The colour of the bar around the window.
Window(int32_t left, int32_t top, uint32_t width, uint32_t height, const string &title_text)
Construct a new Window object at a specific position and size (relative to the screen) with a title.
void draw_self(common::GraphicsContext *gc, common::Rectangle< int32_t > &area) override
Draws the window and its children.
void add_child(Widget *child) override
Adds a child to the window.
common::Colour frame_border_colour
The colour of the border around the bar around the window.
common::Colour foreground_colour
The colour of the text characters.
common::Colour background_colour
The colour to draw behind the text characters.
Defines a Text widget for displaying text in the GUI.
Defines a Window class for creating movable and resizable GUI windows.