DUDS
Distributed Update of Data from Something
duds::ui::graphics::GridLayoutConfig Struct Reference

Informs a PriorityGridLayout object where to place and how large to make Panel objects. More...

#include <GridLayoutConfig.hpp>

Collaboration diagram for duds::ui::graphics::GridLayoutConfig:

Public Types

typedef duds::general::BitFlags< struct GridLayoutConfigFlags > Flags
 The type for configuration flags that adjust how the panel is placed. More...
 

Public Member Functions

 GridLayoutConfig ()=default
 Makes a new configuration that lacks any size-steps and has the default flags. More...
 
 GridLayoutConfig (const GridSizeSteps &gss, Flags flg)
 Constructs a new grid layout. More...
 
 GridLayoutConfig (GridSizeSteps &&gss, Flags flg)
 Constructs a new grid layout. More...
 
 GridLayoutConfig (const GridSizeSteps &gss)
 Constructs a new grid layout. More...
 
 GridLayoutConfig (GridSizeSteps &&gss)
 Constructs a new grid layout. More...
 
 GridLayoutConfig (const GridSizeStep &step)
 Generates a configuration using the given size-step as a template. More...
 
 GridLayoutConfig (GridSizeStep &&step)
 Generates a configuration using the given size-step as a template. More...
 
void center ()
 Sets all the positioning flags to indicate the panel should be centered horizontally and vertically. More...
 
void centerHoriz ()
 Sets the horizontal positioning flags to indicate the panel should be centered. More...
 
void centerVert ()
 Sets the vertcal positioning flags to indicate the panel should be centered. More...
 
void hide ()
 Sets the flag to hide the panel. More...
 
void justifyDown ()
 Sets the vertcal positioning flags to indicate the panel should be justified to the bottom edge. More...
 
void justifyLeft ()
 Sets the horizontal positioning flags to indicate the panel should be justified to the left edge. More...
 
void justifyRight ()
 Sets the horizontal positioning flags to indicate the panel should be justified to the right edge. More...
 
void justifyUp ()
 Sets the vertcal positioning flags to indicate the panel should be justified to the top edge. More...
 
void show ()
 Clear the flag to show the panel. More...
 

Public Attributes

Flags flags = Flags::Zero()
 The configuration flags used for the panel for all of its size-steps. More...
 
GridSizeSteps sizes
 The size-steps for the panel. More...
 

Static Public Attributes

static constexpr Flags PanelCenter = PanelCenterHoriz | PanelCenterVert
 Center the panel horizontally and vertically within its grid spot. More...
 
static constexpr Flags PanelCenterHoriz = Flags::Bit(5)
 Center the panel horizontally within its grid spot. More...
 
static constexpr Flags PanelCenterVert = Flags::Bit(6)
 Center the panel vertically within its grid spot. More...
 
static constexpr Flags PanelExpand = PanelWidthExpand | PanelHeightExpand
 Request both width and height expansion. More...
 
static constexpr Flags PanelHeightExpand = Flags::Bit(2)
 Request that this panel's height be expanded past the requested minumum if there is extra space available on the output image. More...
 
static constexpr Flags PanelHidden = Flags::Bit(0)
 The panel is not showm; this prevents it from being placed in the layout. More...
 
static constexpr Flags PanelJustifyDown = Flags::Bit(4)
 Place the panel's bottom edge to the far bottom in its grid spot. More...
 
static constexpr Flags PanelJustifyLeft = Flags::Zero()
 Place the panel's left edge to the far left in its grid spot. More...
 
static constexpr Flags PanelJustifyRight = Flags::Bit(3)
 Place the panel's right edge to the far right in its grid spot. More...
 
static constexpr Flags PanelJustifyUp = Flags::Zero()
 Place the panel's top edge to the far top in its grid spot. More...
 
static constexpr Flags PanelPositionHorizMask
 Mask of all configuration flags affecting a panel's horizontal positioning. More...
 
static constexpr Flags PanelPositionMask
 Mask of all configuration flags affecting panel position. More...
 
static constexpr Flags PanelPositionVertMask
 Mask of all configuration flags affecting a panel's vertical positioning. More...
 
static constexpr Flags PanelShown = Flags::Zero()
 The panel is shown. More...
 
static constexpr Flags PanelWidthExpand = Flags::Bit(1)
 Request that this panel's width be expanded past the requested minumum if there is extra space available on the row. More...
 

Detailed Description

Informs a PriorityGridLayout object where to place and how large to make Panel objects.

Author
Jeff Jackowski

Definition at line 30 of file GridLayoutConfig.hpp.

Member Typedef Documentation

◆ Flags

The type for configuration flags that adjust how the panel is placed.

Definition at line 45 of file GridLayoutConfig.hpp.

Constructor & Destructor Documentation

◆ GridLayoutConfig() [1/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( )
default

Makes a new configuration that lacks any size-steps and has the default flags.

Referenced by GridLayoutConfig().

◆ GridLayoutConfig() [2/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( const GridSizeSteps gss,
Flags  flg 
)
inline

Constructs a new grid layout.

Parameters
gssThe size-steps for a panel.
flgThe configuration flags.

Definition at line 139 of file GridLayoutConfig.hpp.

◆ GridLayoutConfig() [3/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( GridSizeSteps &&  gss,
Flags  flg 
)
inline

Constructs a new grid layout.

Parameters
gssThe size-steps for a panel; these are moved into this new object.
flgThe configuration flags.

Definition at line 147 of file GridLayoutConfig.hpp.

◆ GridLayoutConfig() [4/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( const GridSizeSteps gss)
inline

Constructs a new grid layout.

Parameters
gssThe size-steps for a panel.

Definition at line 153 of file GridLayoutConfig.hpp.

◆ GridLayoutConfig() [5/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( GridSizeSteps &&  gss)
inline

Constructs a new grid layout.

Parameters
gssThe size-steps for a panel; these are moved into this new object.

Definition at line 159 of file GridLayoutConfig.hpp.

◆ GridLayoutConfig() [6/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( const GridSizeStep step)

Generates a configuration using the given size-step as a template.

The size-step is copied to be the only item in sizes, and the configuration flags are also copied into flags.

Definition at line 30 of file GridLayoutConfig.cpp.

◆ GridLayoutConfig() [7/7]

duds::ui::graphics::GridLayoutConfig::GridLayoutConfig ( GridSizeStep &&  step)

Generates a configuration using the given size-step as a template.

The size-step is moved into sizes, and the configuration flags are also copied into flags.

Definition at line 34 of file GridLayoutConfig.cpp.

Member Function Documentation

◆ center()

void duds::ui::graphics::GridLayoutConfig::center ( )
inline

Sets all the positioning flags to indicate the panel should be centered horizontally and vertically.

Definition at line 218 of file GridLayoutConfig.hpp.

◆ centerHoriz()

void duds::ui::graphics::GridLayoutConfig::centerHoriz ( )
inline

Sets the horizontal positioning flags to indicate the panel should be centered.

Definition at line 190 of file GridLayoutConfig.hpp.

◆ centerVert()

void duds::ui::graphics::GridLayoutConfig::centerVert ( )
inline

Sets the vertcal positioning flags to indicate the panel should be centered.

Definition at line 211 of file GridLayoutConfig.hpp.

◆ hide()

void duds::ui::graphics::GridLayoutConfig::hide ( )
inline

Sets the flag to hide the panel.

Definition at line 224 of file GridLayoutConfig.hpp.

◆ justifyDown()

void duds::ui::graphics::GridLayoutConfig::justifyDown ( )
inline

Sets the vertcal positioning flags to indicate the panel should be justified to the bottom edge.

Definition at line 204 of file GridLayoutConfig.hpp.

◆ justifyLeft()

void duds::ui::graphics::GridLayoutConfig::justifyLeft ( )
inline

Sets the horizontal positioning flags to indicate the panel should be justified to the left edge.

This is the default configuration.

Definition at line 176 of file GridLayoutConfig.hpp.

◆ justifyRight()

void duds::ui::graphics::GridLayoutConfig::justifyRight ( )
inline

Sets the horizontal positioning flags to indicate the panel should be justified to the right edge.

Definition at line 183 of file GridLayoutConfig.hpp.

◆ justifyUp()

void duds::ui::graphics::GridLayoutConfig::justifyUp ( )
inline

Sets the vertcal positioning flags to indicate the panel should be justified to the top edge.

This is the default configuration.

Definition at line 197 of file GridLayoutConfig.hpp.

◆ show()

void duds::ui::graphics::GridLayoutConfig::show ( )
inline

Clear the flag to show the panel.

Definition at line 230 of file GridLayoutConfig.hpp.

Member Data Documentation

◆ flags

Flags duds::ui::graphics::GridLayoutConfig::flags = Flags::Zero()

The configuration flags used for the panel for all of its size-steps.

The actual flags used will be the result of OR'ing these flags with the ones of the selected size-step.

Definition at line 128 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::PriorityGridLayout::PanelStatus::flags().

◆ PanelCenter

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelCenter = PanelCenterHoriz | PanelCenterVert
static

Center the panel horizontally and vertically within its grid spot.

Definition at line 105 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::center().

◆ PanelCenterHoriz

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelCenterHoriz = Flags::Bit(5)
static

Center the panel horizontally within its grid spot.

Definition at line 97 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::centerHoriz(), and duds::ui::graphics::PriorityGridLayout::render().

◆ PanelCenterVert

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelCenterVert = Flags::Bit(6)
static

Center the panel vertically within its grid spot.

Definition at line 101 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::centerVert(), and duds::ui::graphics::PriorityGridLayout::render().

◆ PanelExpand

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelExpand = PanelWidthExpand | PanelHeightExpand
static

Request both width and height expansion.

Definition at line 75 of file GridLayoutConfig.hpp.

◆ PanelHeightExpand

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelHeightExpand = Flags::Bit(2)
static

Request that this panel's height be expanded past the requested minumum if there is extra space available on the output image.

All panels in the same row will be given the same height. If multiple panels on the row make this request, the result is the same as one panel making the request. If multiple panels in different rows make this request, extra height will be provided about evenly among the rows.

Definition at line 71 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::PriorityGridLayout::layout().

◆ PanelHidden

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelHidden = Flags::Bit(0)
static

The panel is not showm; this prevents it from being placed in the layout.

Use this to temporarily make a panel disappear without having to remove configuration data from vectors.

Definition at line 51 of file GridLayoutConfig.hpp.

Referenced by hide(), duds::ui::graphics::GridSizeStep::hide(), duds::ui::graphics::PriorityGridLayout::layout(), and duds::ui::graphics::GridSizeStep::show().

◆ PanelJustifyDown

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelJustifyDown = Flags::Bit(4)
static

Place the panel's bottom edge to the far bottom in its grid spot.

Definition at line 93 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::justifyDown(), and duds::ui::graphics::PriorityGridLayout::render().

◆ PanelJustifyLeft

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelJustifyLeft = Flags::Zero()
static

Place the panel's left edge to the far left in its grid spot.

This is the default.

Definition at line 80 of file GridLayoutConfig.hpp.

◆ PanelJustifyRight

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelJustifyRight = Flags::Bit(3)
static

Place the panel's right edge to the far right in its grid spot.

Definition at line 84 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::justifyRight(), and duds::ui::graphics::PriorityGridLayout::render().

◆ PanelJustifyUp

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelJustifyUp = Flags::Zero()
static

Place the panel's top edge to the far top in its grid spot.

This is the default.

Definition at line 89 of file GridLayoutConfig.hpp.

◆ PanelPositionHorizMask

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelPositionHorizMask
static
Initial value:

Mask of all configuration flags affecting a panel's horizontal positioning.

Definition at line 110 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::centerHoriz(), duds::ui::graphics::GridSizeStep::justifyLeft(), and duds::ui::graphics::GridSizeStep::justifyRight().

◆ PanelPositionMask

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelPositionMask
static
Initial value:

Mask of all configuration flags affecting panel position.

Definition at line 121 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::center().

◆ PanelPositionVertMask

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelPositionVertMask
static
Initial value:

Mask of all configuration flags affecting a panel's vertical positioning.

Definition at line 116 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::GridSizeStep::centerVert(), duds::ui::graphics::GridSizeStep::justifyDown(), and duds::ui::graphics::GridSizeStep::justifyUp().

◆ PanelShown

constexpr Flags duds::ui::graphics::GridLayoutConfig::PanelShown = Flags::Zero()
static

The panel is shown.

This is the default.

Definition at line 55 of file GridLayoutConfig.hpp.

◆ PanelWidthExpand

constexpr GridLayoutConfig::Flags duds::ui::graphics::GridLayoutConfig::PanelWidthExpand = Flags::Bit(1)
static

Request that this panel's width be expanded past the requested minumum if there is extra space available on the row.

If multiple panels on the row make this request, extra width will be provided about evenly among the panels.

Definition at line 62 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::PriorityGridLayout::layout().

◆ sizes

GridSizeSteps duds::ui::graphics::GridLayoutConfig::sizes

The size-steps for the panel.

The size-steps are given in order of precedence; the layout will use the first size-step, starting at index 0, that fits. A size-step does not fit if it is too large for the remaining area, or if its grid location is already taken by a higher priority Panel.

If no size-steps are present (sizes.empty() is true), the corresponding Panel will not be placed.

Definition at line 41 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::PriorityGridLayout::PanelStatus::currentStep(), duds::ui::graphics::PriorityGridLayout::PanelStatus::flags(), and GridLayoutConfig().


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