Max OS
0.3
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1
9
#ifndef MaxOS_GUI_WINDOW_H
10
#define MaxOS_GUI_WINDOW_H
11
12
#include <stdint.h>
13
#include <
gui/widget.h
>
14
#include <
gui/widgets/text.h
>
15
16
namespace
MaxOS{
17
18
namespace
gui{
19
24
class
Window
:
public
CompositeWidget
{
25
26
private
:
27
widgets::Text
m_title;
28
29
// Resizes
30
WidgetMover
m_mover;
31
WidgetMoverResizerTop
m_resizer_top;
32
WidgetMoverResizerBottom
m_resizer_bottom;
33
WidgetMoverResizerLeft
m_resizer_left;
34
WidgetMoverResizerRight
m_resizer_right;
35
WidgetMoverResizerTopLeft
m_resizer_top_left;
36
WidgetMoverResizerTopRight
m_resizer_top_right;
37
WidgetMoverResizerBottomLeft
m_resizer_bottom_left;
38
WidgetMoverResizerBottomRight
m_resizer_bottom_right;
39
40
41
public
:
42
43
uint8_t
frame_thickness
{ 5 };
44
uint8_t
title_bar_height
{ 10 };
45
46
common::Colour
area_colour
;
47
common::Colour
frame_colour
;
48
common::Colour
frame_border_colour
;
49
50
Window
(int32_t left, int32_t top, uint32_t width, uint32_t height,
const
string
& title_text);
51
Window
(
Widget
* contained_widget,
const
string
& title_text);
52
~Window
();
53
54
void
draw_self
(
common::GraphicsContext
* gc,
common::Rectangle<int32_t>
& area)
override
;
55
void
add_child
(
Widget
* child)
override
;
56
57
drivers::peripherals::MouseEventHandler
*
on_mouse_button_pressed
(uint32_t x, uint32_t y, uint8_t button)
override
;
58
};
59
}
60
}
61
#endif
//MaxOS_GUI_WINDOW_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::drivers::peripherals::MouseEventHandler
Handles events that are triggered by the mouse driver.
Definition
mouse.h:72
MaxOS::gui::CompositeWidget
A widget that can contain other widgets.
Definition
widget.h:88
MaxOS::gui::WidgetMoverResizer< 1, 1, 0, 0 >
MaxOS::gui::Widget
A graphical object that can be drawn on the screen.
Definition
widget.h:29
MaxOS::gui::Window
A window that can be moved and resized and contains a widget.
Definition
window.h:24
MaxOS::gui::Window::title_bar_height
uint8_t title_bar_height
How large the bar at the top of the window is.
Definition
window.h:44
MaxOS::gui::Window::frame_thickness
uint8_t frame_thickness
How thick the bar around the window is.
Definition
window.h:43
MaxOS::gui::Window::on_mouse_button_pressed
drivers::peripherals::MouseEventHandler * on_mouse_button_pressed(uint32_t x, uint32_t y, uint8_t button) override
Handles the mouse button being pressed.
Definition
window.cpp:103
MaxOS::gui::Window::area_colour
common::Colour area_colour
The background colour of the window inner area.
Definition
window.h:46
MaxOS::gui::Window::frame_colour
common::Colour frame_colour
The colour of the bar around the window.
Definition
window.h:47
MaxOS::gui::Window::draw_self
void draw_self(common::GraphicsContext *gc, common::Rectangle< int32_t > &area) override
Draws the window and its children.
Definition
window.cpp:154
MaxOS::gui::Window::add_child
void add_child(Widget *child) override
Adds a child to the window.
Definition
window.cpp:220
MaxOS::gui::Window::frame_border_colour
common::Colour frame_border_colour
The colour of the border around the bar around the window.
Definition
window.h:48
MaxOS::gui::widgets::Text
A box that can be used to display text.
Definition
text.h:24
text.h
Defines a Text widget for displaying text in the GUI.
widget.h
Defines a base Widget class and CompositeWidget class for creating graphical user interface elements.
kernel
include
gui
window.h
Generated by
1.9.8