MyRP2_ui_core
Loading...
Searching...
No Matches
UIWidget Class Referenceabstract
Inheritance diagram for UIWidget:
TestCursorWidgetWithIncrementalValue TestObjectManagerWidget TestSetOfWidget

Public Member Functions

 UIWidget (UIDisplayDevice *_display_screen, size_t _frame_width, size_t _frame_height, uint8_t _widget_anchor_x, uint8_t _widget_anchor_y, bool _widget_with_border, uint8_t _widget_border_width=1, FramebufferFormat _framebuffer_format=FramebufferFormat::MONO_VLSB, StructFramebufferText _framebuffer_txt_cnf={.font=font_8x8})
 Construct a new UIWidget object.
 
 ~UIWidget ()
 Destroy the UIWidget object.
 
void add_widget (UIWidget *_sub_widget)
 
virtual void refresh ()
 WARNING : this function can be redefined. When several widget display one Model, only le last one must clear_change_flag()
 

Static Public Member Functions

static FramebufferColor blinking_us (uint32_t _blink_period)
 

Protected Member Functions

virtual void set_displayed_model (UIModelObject *_new_displayed_model)
 Set the displayed model object.
 
void set_display_screen (UIDisplayDevice *_new_display_device)
 Set the display screen object.
 
void draw_border ()
 
virtual void draw ()=0
 

Protected Attributes

std::vector< UIWidget * > widgets
 
size_t widget_width {128}
 
size_t widget_height {8}
 
uint8_t widget_start_x
 
uint8_t widget_start_y
 
uint8_t widget_border_width
 

Detailed Description

Definition at line 363 of file ui_core.h.

Constructor & Destructor Documentation

◆ UIWidget()

UIWidget::UIWidget ( UIDisplayDevice * _display_screen,
size_t _frame_width,
size_t _frame_height,
uint8_t _widget_anchor_x,
uint8_t _widget_anchor_y,
bool _widget_with_border,
uint8_t _widget_border_width = 1,
FramebufferFormat _framebuffer_format = FramebufferFormat::MONO_VLSB,
StructFramebufferText _framebuffer_txt_cnf = {.font = font_8x8} )

Construct a new UIWidget object.

Parameters
_display_screen
_frame_width
_frame_height
_widget_anchor_x
_widget_anchor_y
_widget_with_border
_widget_border_width
_framebuffer_format
_framebuffer_txt_cnf

Definition at line 200 of file ui_core.cpp.

◆ ~UIWidget()

UIWidget::~UIWidget ( )

Destroy the UIWidget object.

Definition at line 216 of file ui_core.cpp.

Member Function Documentation

◆ add_widget()

void UIWidget::add_widget ( UIWidget * _sub_widget)
Parameters
_sub_widget

Definition at line 230 of file ui_core.cpp.

◆ blinking_us()

FramebufferColor UIWidget::blinking_us ( uint32_t _blink_period)
static
Parameters
_blink_period
Returns
FramebufferColor

Definition at line 195 of file ui_core.cpp.

◆ draw_border()

void UIWidget::draw_border ( )
protected

Definition at line 190 of file ui_core.cpp.

◆ refresh()

void UIWidget::refresh ( )
virtual

WARNING : this function can be redefined. When several widget display one Model, only le last one must clear_change_flag()

First: Scan all contained sub-widgets if any and call refresh() member function of each of them.

Then: apply refresh() on the containing widget if any changes require a screen redraw and finally : clear model change flag

Reimplemented in TestCursorWidgetWithIncrementalValue, and TestObjectManagerWidget.

Definition at line 235 of file ui_core.cpp.

◆ set_display_screen()

void UIWidget::set_display_screen ( UIDisplayDevice * _new_display_device)
protected

Set the display screen object.

Parameters
_new_display_device

Definition at line 225 of file ui_core.cpp.

◆ set_displayed_model()

void UIWidget::set_displayed_model ( UIModelObject * _new_displayed_model)
protectedvirtual

Set the displayed model object.

Parameters
_new_displayed_model

Definition at line 220 of file ui_core.cpp.

Member Data Documentation

◆ widget_border_width

uint8_t UIWidget::widget_border_width
protected

Definition at line 426 of file ui_core.h.

◆ widget_height

size_t UIWidget::widget_height {8}
protected

Definition at line 411 of file ui_core.h.

◆ widget_start_x

uint8_t UIWidget::widget_start_x
protected

Definition at line 416 of file ui_core.h.

◆ widget_start_y

uint8_t UIWidget::widget_start_y
protected

Definition at line 421 of file ui_core.h.

◆ widget_width

size_t UIWidget::widget_width {128}
protected

Definition at line 406 of file ui_core.h.

◆ widgets

std::vector<UIWidget *> UIWidget::widgets
protected

Definition at line 401 of file ui_core.h.


The documentation for this class was generated from the following files: