14 namespace duds {
namespace ui {
namespace menu {
namespace renderers {
48 std::uint16_t minsize,
55 posInd = std::make_unique<duds::ui::graphics::BppPositionIndicator>(
96 propTextDim.
w = width;
103 cache->font()->estimatedMaxCharacterSize();
104 propTextDim.
h = fntDim.
h;
109 propTextDim.
w -= iDim.
w;
110 propTextDim.
h = std::max(propTextDim.
h, iDim.
h);
114 propTextDim.
w -= iDim.
w;
115 propTextDim.
h = std::max(propTextDim.
h, iDim.
h);
117 if (
flgs & BppMenuRenderer::HorizontalList) {
123 propTextDim.
h = std::max(propTextDim.
h,
iconDim.
h);
127 if ((propTextDim.
h > fit.
h) ||
129 ((~
flgs & DoNotShowText) && (propTextDim.
w < fntDim.
w))
137 if (~
flgs & DoNotShowText) {
152 if (
flgs & HorizontalList) {
253 fracidx = mova.
size() - 1;
277 if (idx == fracidx) {
283 bool selected = mova.selectedVisible() == idx;
297 if (
disIcon && mitem->isDisabled()) {
306 if (mitem->isToggle()) {
310 }
else if (
togOnIcon && mitem->isToggledOn()) {
321 if (iitem && iitem->
icon()) {
333 if (~
flgs & DoNotShowText) {
336 if (!mitem->label().empty()) {
339 text =
cache->text(mitem->label());
343 text =
cache->text(mitem->label() +
" " + mitem->value());
344 }
else if (!mitem->value().empty()) {
347 valtext =
cache->text(mitem->value());
358 textDim.
w - valtext->dimensions().w,
378 if (!mitem->value().empty()) {
391 img->write(text, pos, valDim);
398 pos.
x + valDim.
w - text->width(),
427 if (idx == fracidx) {
491 posInd->range(mova.menu()->size());
492 posInd->render(dest, mova.firstIndex(), mova.lastIndex());
Stores a location within an image.
std::int16_t y
Vertical coordinate.
static constexpr Flags AlignRight
Align each line to the right.
std::int16_t x
Horizontal coordinate.
constexpr bool empty() const
True if the dimensions indicate zero area.
std::shared_ptr< const BppImage > ConstBppImageSptr
constexpr ImageDimensions minExtent(const ImageDimensions &dim) const
Returns new dimensions that only cover the union of this dimension and the given dimension.
BitFlags clear()
Clear all bits.
Stores the dimensions of an image.
BitFlags set(const BitFlags &bf)
Set all bits in this object that are set in bf.
std::shared_ptr< BppImage > BppImageSptr
Performs a bitwise exclusive-or operation with the destination and source data, and places the result...
boost::error_info< struct Info_ImageDimensions, ImageDimensions > ImageErrorSourceDimensions
Image dimensions for a source image relevant to the error.
ImageDimensions MaxExtent(const BppImage *i0, const BppImage *i1)
Returns the maximum extent of the dimensions of two bit-per-pixel images.
static std::shared_ptr< BppImage > make(const ImageDimensions &id)
Convenience function to make a shared pointer to an image using the BppImage(const ImageDimensions &)...
General graphics related code.
static constexpr Flags AlignLeft
Align each line to the left.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
boost::error_info< struct Info_FrameDimensions, ImageDimensions > ImageErrorTargetDimensions
Image dimensions for a target image relevant to the error.
BitFlags setMasked(const BitFlags &bf, const BitFlags &mask)
Changes only the bits in a masked range.