1.10
radiobox.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_RADIOBOX_H
7#define EGT_RADIOBOX_H
8
14#include <egt/button.h>
15#include <egt/detail/meta.h>
16#include <string>
17
18namespace egt
19{
20inline namespace v1
21{
22
23class Painter;
24class Frame;
25
31class EGT_API RadioBox : public Switch
32{
33public:
34
39 explicit RadioBox(const std::string& text = {},
40 const Rect& rect = {}) noexcept;
41
47 explicit RadioBox(Frame& parent,
48 const std::string& text = {},
49 const Rect& rect = {}) noexcept;
50
51 using Switch::Switch;
52
58 void radiobox_align(const AlignFlags& align)
59 {
60 switch_align(align);
61 }
62
66 EGT_NODISCARD AlignFlags radiobox_align() const { return switch_align(); }
67
68 void draw(Painter& painter, const Rect& rect) override;
69
70protected:
71
72 void draw_switch(Painter& painter, const Rect& handle) const override;
73};
74
75}
76}
77
78#endif
Alignment flags.
Definition widgetflags.h:379
A Frame is a Widget that has children widgets.
Definition frame.h:45
Drawing interface for 2D graphics.
Definition painter.h:45
Boolean RadioBox.
Definition radiobox.h:32
RadioBox(Frame &parent, const std::string &text={}, const Rect &rect={}) noexcept
void draw(Painter &painter, const Rect &rect) override
Draw the widget.
void radiobox_align(const AlignFlags &align)
Set the alignment of the image relative to the text.
Definition radiobox.h:58
void draw_switch(Painter &painter, const Rect &handle) const override
EGT_NODISCARD AlignFlags radiobox_align() const
Get the image alignment.
Definition radiobox.h:66
RadioBox(const std::string &text={}, const Rect &rect={}) noexcept
Definition button.h:234
T & align(T &widget, const AlignFlags &a)
Helper to set alignment of a widget.
Definition widgetflags.h:624
EGT framework namespace.
Definition animation.h:24