Class evab::PaddingV¶
template <class T>
Decorator that adds vertical padding (top and bottom) to any element. More...
#include <evabPadding.h>
Inherits the following classes: T
Public Functions¶
| Type | Name |
|---|---|
| PaddingV (Args &&... args) Constructor forwarding all arguments to the base element. |
Protected Functions¶
| Type | Name |
|---|---|
| void | drawer (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused) override Draws the element with vertical padding. |
Detailed Description¶
This class wraps an element and adds empty space at the top and bottom, effectively centering the content vertically within the available area.
The padding is applied as follows: * Top: 1 tile cleared * Content: drawn in the middle rows * Bottom: 1 tile cleared
Template parameters:
TBase element type to decorate
Note:
The element must be at least 3 tiles tall to have visible content. If the height is less than 3, the content may be clipped.
See also: PaddingH For horizontal padding (left and right)
// Add vertical padding to an InputInt
PaddingV<InputInt> paddedInput(42);
// Use with Labeled decorator
PaddingV<LabeledLeft<InputInt>> paddedLabel("Value", 42);
Public Functions Documentation¶
function PaddingV¶
Constructor forwarding all arguments to the base element.
template<typename... Args>
inline evab::PaddingV::PaddingV (
Args &&... args
)
Template parameters:
ArgsTypes of the constructor arguments
Parameters:
argsArguments forwarded to the base element constructor
Protected Functions Documentation¶
function drawer¶
Draws the element with vertical padding.
inline void evab::PaddingV::drawer (
Screen * aScreen,
Coor aPos,
Coor aSize,
unsigned char aIsFocused
) override
Clears one tile at the top and bottom, then draws the base element in the remaining vertical space.
Parameters:
aScreenScreen to draw onaPosPosition on screenaSizeSize of the elementaIsFocusedFocus state (1 = focused, 0 = not focused)
The documentation for this class was generated from the following file src/evabPadding.h