10 #ifndef GRIDLAYOUTCONFIG_HPP 11 #define GRIDLAYOUTCONFIG_HPP 140 sizes(gss), flags(flg) { }
148 sizes(
std::
move(gss)), flags(flg) { }
177 flags &= ~PanelPositionHorizMask;
184 flags.
setMasked(PanelJustifyRight, PanelPositionHorizMask);
191 flags.
setMasked(PanelCenterHoriz, PanelPositionHorizMask);
198 flags &= ~PanelPositionVertMask;
205 flags.
setMasked(PanelJustifyDown, PanelPositionVertMask);
212 flags.
setMasked(PanelCenterVert, PanelPositionVertMask);
219 flags.
setMasked(PanelCenter, PanelPositionMask);
231 flags &= ~PanelHidden;
265 std::enable_if_t<std::is_integral<Int0>::value,
bool> =
true,
266 std::enable_if_t<std::is_integral<Int1>::value,
bool> =
true 269 c((
std::int16_t)col), r((
std::int16_t)row) { }
274 return (gl.
r == r) && (gl.
c == c);
280 return (gl.
r != r) || (gl.
c != c);
323 ) : minDim(id), loc(gl), flags(flg) { }
414 #endif // #ifndef GRIDLAYOUTCONFIG_HPP static constexpr Flags PanelPositionVertMask
Mask of all configuration flags affecting a panel's vertical positioning.
void justifyRight()
Sets the horizontal positioning flags to indicate the panel should be justified to the right edge...
static constexpr Flags PanelHeightExpand
Request that this panel's height be expanded past the requested minumum if there is extra space avail...
std::uint16_t r
The row position.
void centerHoriz()
Sets the horizontal positioning flags to indicate the panel should be centered.
std::vector< GridSizeStep > GridSizeSteps
A vector of size-step information for a Panel in a PriorityGridLayout.
static constexpr Flags PanelCenter
Center the panel horizontally and vertically within its grid spot.
constexpr bool operator==(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
void hide()
Sets the flag to hide the panel.
void show()
Clear the flag to show the panel.
A single size-step used by a PriorityGridLayout to place a Panel.
static constexpr Flags PanelWidthExpand
Request that this panel's width be expanded past the requested minumum if there is extra space availa...
GridLayoutConfig::Flags flags
Configuration flags that are OR'd with the flags in GridLayoutConfig to produce the final configurati...
static constexpr BitFlags Zero()
Makes a bit flags container with all flags cleared.
void center()
Sets all the positioning flags to indicate the panel should be centered horizontally and vertically...
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
void centerVert()
Sets the vertcal positioning flags to indicate the panel should be centered.
The location of a panel in a PriorityGridLayout.
void justifyDown()
Sets the vertcal positioning flags to indicate the panel should be justified to the bottom edge...
Flags flags
The configuration flags used for the panel for all of its size-steps.
static constexpr Flags PanelShown
The panel is shown.
Stores the dimensions of an image.
static constexpr Flags PanelCenterVert
Center the panel vertically within its grid spot.
void justifyUp()
Sets the vertcal positioning flags to indicate the panel should be justified to the top edge...
std::uint16_t c
The column position.
void justifyUp()
Sets the vertcal positioning flags to indicate the panel should be justified to the top edge...
static constexpr BitFlags Bit(int b)
Makes a bit flags container with a single bit set that is specified by digit number rather than value...
static constexpr Flags PanelJustifyDown
Place the panel's bottom edge to the far bottom in its grid spot.
static constexpr Flags PanelJustifyLeft
Place the panel's left edge to the far left in its grid spot.
constexpr bool operator!=(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
constexpr GridSizeStep(const ImageDimensions &id, const GridLocation &gl, const GridLayoutConfig::Flags flg)
Constructs a new GridSizeStep with the given values.
static constexpr Flags PanelHidden
The panel is not showm; this prevents it from being placed in the layout.
void justifyLeft()
Sets the horizontal positioning flags to indicate the panel should be justified to the left edge...
static constexpr Flags PanelJustifyUp
Place the panel's top edge to the far top in its grid spot.
void center()
Sets all the positioning flags to indicate the panel should be centered horizontally and vertically...
void centerHoriz()
Sets the horizontal positioning flags to indicate the panel should be centered.
void justifyDown()
Sets the vertcal positioning flags to indicate the panel should be justified to the bottom edge...
GridLayoutConfig(const GridSizeSteps &gss, Flags flg)
Constructs a new grid layout.
GridSizeSteps sizes
The size-steps for the panel.
void centerVert()
Sets the vertcal positioning flags to indicate the panel should be centered.
ImageDimensions minDim
The minimum size required for the Panel for this size-step.
GridLayoutConfig(GridSizeSteps &&gss)
Constructs a new grid layout.
GridLayoutConfig(const GridSizeSteps &gss)
Constructs a new grid layout.
constexpr GridSizeStep(const ImageDimensions &id, const GridLocation &gl)
Constructs a new GridSizeStep with the given values, and cleared (0) configuration flags...
duds::general::BitFlags< struct GridLayoutConfigFlags > Flags
The type for configuration flags that adjust how the panel is placed.
static constexpr Flags PanelJustifyRight
Place the panel's right edge to the far right in its grid spot.
GridLayoutConfig()=default
Makes a new configuration that lacks any size-steps and has the default flags.
void justifyLeft()
Sets the horizontal positioning flags to indicate the panel should be justified to the left edge...
void show()
Clear the flag to show the panel.
General graphics related code.
Informs a PriorityGridLayout object where to place and how large to make Panel objects.
static constexpr Flags PanelExpand
Request both width and height expansion.
void justifyRight()
Sets the horizontal positioning flags to indicate the panel should be justified to the right edge...
static constexpr Flags PanelPositionMask
Mask of all configuration flags affecting panel position.
GridLocation loc
The location within the grid to place the Panel.
GridLayoutConfig(GridSizeSteps &&gss, Flags flg)
Constructs a new grid layout.
void hide()
Sets the flag to hide the panel.
static constexpr Flags PanelPositionHorizMask
Mask of all configuration flags affecting a panel's horizontal positioning.
constexpr GridLocation(Int0 col, Int1 row)
Construct with the given location.
static constexpr Flags PanelCenterHoriz
Center the panel horizontally within its grid spot.
BitFlags setMasked(const BitFlags &bf, const BitFlags &mask)
Changes only the bits in a masked range.