DUDS
Distributed Update of Data from Something
duds::ui::graphics::SingleLayoutPanel Class Reference

A variation of a Panel that can only be added to one layout at a time, and that keeps track of its own priority and the layout object. More...

#include <SingleLayoutPanel.hpp>

Inheritance diagram for duds::ui::graphics::SingleLayoutPanel:
Collaboration diagram for duds::ui::graphics::SingleLayoutPanel:

Public Member Functions

virtual void added (PriorityGridLayout *l, int p)
 Records the layout object and priority that has been assigned to this panel. More...
 
int layoutPriority () const
 Returns the priority assigned to this panel when added to a layout, or zero if not added. More...
 
PriorityGridLayoutowner () const
 Returns the layout object that has added this Panel, or nullptr if no layout has the panel. More...
 
GridLayoutConfigpanelConfig ()
 Returns the panel's layout configuration. More...
 
virtual void removing (PriorityGridLayout *l, int p)
 Records that the panel has been removed from the layout. More...
 
- Public Member Functions inherited from duds::ui::graphics::Panel
virtual void added (PriorityGridLayout *pgl, unsigned int pri)
 Informs the panel that it is being added to a layout. More...
 
virtual void removing (PriorityGridLayout *pgl, unsigned int pri)
 Informs the panel that it is being removed from a layout. More...
 
virtual const BppImagerender (ImageLocation &offset, ImageDimensions &dim, PanelMargins &margin, int sizeStep)=0
 Returns the image of the rendered panel. More...
 

Private Attributes

PriorityGridLayoutpgl = nullptr
 The layout object that has added this Panel, or nullptr if not added. More...
 
unsigned int pri = 0
 The priority value assigned to this Panel when added to a layout. More...
 

Detailed Description

A variation of a Panel that can only be added to one layout at a time, and that keeps track of its own priority and the layout object.

By tracking its layout and priority, the SingleLayoutPanel offers the panelConfig() function that makes it easier to modify its layout configuration.

Author
Jeff Jackowski

Definition at line 25 of file SingleLayoutPanel.hpp.

Member Function Documentation

◆ added()

void duds::ui::graphics::SingleLayoutPanel::added ( PriorityGridLayout l,
int  p 
)
virtual

Records the layout object and priority that has been assigned to this panel.

Exceptions
PanelAlreadyAddedErrorSingleLayoutPanel objects may only be used by one layout at any given time. The exception will prevent the layout from adding this panel.

Definition at line 24 of file SingleLayoutPanel.cpp.

Referenced by layoutPriority().

◆ layoutPriority()

int duds::ui::graphics::SingleLayoutPanel::layoutPriority ( ) const
inline

Returns the priority assigned to this panel when added to a layout, or zero if not added.

Definition at line 46 of file SingleLayoutPanel.hpp.

◆ owner()

PriorityGridLayout* duds::ui::graphics::SingleLayoutPanel::owner ( ) const
inline

Returns the layout object that has added this Panel, or nullptr if no layout has the panel.

Definition at line 39 of file SingleLayoutPanel.hpp.

◆ panelConfig()

GridLayoutConfig & duds::ui::graphics::SingleLayoutPanel::panelConfig ( )

Returns the panel's layout configuration.

The configuration may be modified, but not in a thread-safe manner. If modifications are made, PriorityGridLayout::layout() must be called prior to rendering again.

Returns
The panel's layout configuration. Do not modify this while PriorityGridLayout::layout() or PriorityGridLayout::render() of owner() are running on another thread.
Exceptions
PanelNotAddedErrorThe panel has not been added to a layout, or has been removed from a layout, so it has no layout configuration.

Definition at line 17 of file SingleLayoutPanel.cpp.

Referenced by layoutPriority().

◆ removing()

void duds::ui::graphics::SingleLayoutPanel::removing ( PriorityGridLayout l,
int  p 
)
virtual

Records that the panel has been removed from the layout.

After removal, the panel may be added to a layout.

Definition at line 34 of file SingleLayoutPanel.cpp.

Referenced by layoutPriority().

Member Data Documentation

◆ pgl

PriorityGridLayout* duds::ui::graphics::SingleLayoutPanel::pgl = nullptr
private

The layout object that has added this Panel, or nullptr if not added.

Definition at line 29 of file SingleLayoutPanel.hpp.

Referenced by added(), owner(), panelConfig(), and removing().

◆ pri

unsigned int duds::ui::graphics::SingleLayoutPanel::pri = 0
private

The priority value assigned to this Panel when added to a layout.

Definition at line 33 of file SingleLayoutPanel.hpp.

Referenced by added(), layoutPriority(), panelConfig(), and removing().


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