DUDS
Distributed Update of Data from Something
duds::ui::graphics::Panel Class Referenceabstract

Represents something being drawn in a rectangular region defined by a PriorityGridLayout object. More...

#include <Panel.hpp>

Inheritance diagram for duds::ui::graphics::Panel:

Public Member Functions

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...
 

Detailed Description

Represents something being drawn in a rectangular region defined by a PriorityGridLayout object.

A panel may be added to any number of layout objects, and may be added to one layout multiple times. Each layout identifies a panel by a priority value unique for the layout.

Panels must be managed by a std::shared_ptr.

Author
Jeff Jackowski

Definition at line 52 of file Panel.hpp.

Member Function Documentation

◆ added()

void duds::ui::graphics::Panel::added ( PriorityGridLayout pgl,
unsigned int  pri 
)
virtual

Informs the panel that it is being added to a layout.

The default implementation does nothing.

Parameters
pglThe layout object that is adding the panel.
priThe priority assigned to the panel. This priority is unique for the layout instance, but is not unique between different layout instances.
Exceptions
objectAny exception will prevent the panel from being added to the layout. The exception will be rethrown by the layout.

Definition at line 14 of file Panel.cpp.

◆ removing()

void duds::ui::graphics::Panel::removing ( PriorityGridLayout pgl,
unsigned int  pri 
)
virtual

Informs the panel that it is being removed from a layout.

The default implementation does nothing.

Parameters
pglThe layout object that is removing the panel.
priThe priority assigned to the panel that is being removed.
Exceptions
objectAny exception will prevent the panel from being removed from the layout. The exception will be rethrown by the layout.

Definition at line 16 of file Panel.cpp.

◆ render()

virtual const BppImage* duds::ui::graphics::Panel::render ( ImageLocation offset,
ImageDimensions dim,
PanelMargins margin,
int  sizeStep 
)
pure virtual

Returns the image of the rendered panel.

Parameters
offsetThe location within the returned image that will be the upper left corner of the visible panel. This is initialized to (0,0).
dimThe dimensions of the panel to render. This is initialized to the maximum dimensions alloted to the panel and must not be made larger. It needs to be set to the dimensions of the returned image to show.
marginThe size of a clear (0) border around the panel's image. This is initialized to all zeros. The margin must fit within the panel's dimensions, so if a margin is used, dim must be made smaller. Any edge justification of the panel, or centering, will include the size of the margin.
sizeStepThe index of the panel's size-step that was chosen during layout.
Returns
The panel's image, or nullptr to leave the panel clear. The portion of the image shown will be defined by the values in offset and dim.

Implemented in duds::ui::graphics::EmptyPanel.


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