neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
radio_button.hpp
Go to the documentation of this file.
1
// radio_button.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
#include "
button.hpp
"
24
25
namespace
neogfx
26
{
27
extern
template
class
widget<i_radio_button>;
28
extern
template
class
button<i_radio_button>;
29
30
class
radio_button
:
public
button<i_radio_button>
31
{
32
meta_object
(
button<i_radio_button>
)
33
public
:
34
define_event
(On, on)
35
define_event
(Off, off)
36
private
:
37
class
disc :
public
widget<>
38
{
39
public
:
40
disc(
radio_button
& aParent);
41
public
:
42
size
minimum_size(
optional_size
const
& aAvailableSpace =
optional_size
{})
const
override
;
43
size
maximum_size(
optional_size
const
& aAvailableSpace =
optional_size
{})
const
override
;
44
};
45
public
:
46
radio_button
(std::string
const
& aText = std::string());
47
radio_button
(
i_widget
& aParent, std::string
const
& aText = std::string());
48
radio_button
(
i_layout
& aLayout, std::string
const
& aText = std::string());
49
protected
:
50
neogfx::object_type
object_type
()
const override
;
51
public
:
52
bool
is_on
()
const override
;
53
bool
is_off
()
const override
;
54
void
set_on
()
override
;
55
public
:
56
const
i_radio_button*
next_button
()
const override
;
57
i_radio_button*
next_button
()
override
;
58
bool
any_siblings_on
()
const override
;
59
public
:
60
neogfx::size_policy
size_policy
()
const override
;
61
public
:
62
rect
element_rect
(
skin_element
aElement)
const override
;
63
protected
:
64
void
paint
(
i_graphics_context
& aGc)
const override
;
65
protected
:
66
void
mouse_entered
(
const
point
& aPosition)
override
;
67
void
mouse_left
()
override
;
68
protected
:
69
void
handle_clicked
()
override
;
70
protected
:
71
bool
can_toggle
()
const override
;
72
bool
set_checked_state
(
const
std::optional<bool>& aCheckedState)
override
;
73
private
:
74
disc iDisc;
75
};
76
}
button.hpp
neogfx::basic_point< coordinate >
neogfx::basic_rect
Definition
geometrical.hpp:761
neogfx::basic_size< coordinate >
neogfx::button
Definition
button.hpp:36
neogfx::i_graphics_context
Definition
i_graphics_context.hpp:124
neogfx::i_layout
Definition
i_layout.hpp:231
neogfx::i_widget
Definition
i_widget.hpp:50
neogfx::radio_button
Definition
radio_button.hpp:31
neogfx::radio_button::mouse_left
void mouse_left() override
neogfx::radio_button::can_toggle
bool can_toggle() const override
neogfx::radio_button::size_policy
neogfx::size_policy size_policy() const override
neogfx::radio_button::set_on
void set_on() override
neogfx::radio_button::radio_button
radio_button(std::string const &aText=std::string())
neogfx::radio_button::handle_clicked
void handle_clicked() override
neogfx::radio_button::radio_button
radio_button(i_layout &aLayout, std::string const &aText=std::string())
neogfx::radio_button::radio_button
radio_button(i_widget &aParent, std::string const &aText=std::string())
neogfx::radio_button::element_rect
rect element_rect(skin_element aElement) const override
neogfx::radio_button::set_checked_state
bool set_checked_state(const std::optional< bool > &aCheckedState) override
neogfx::radio_button::is_on
bool is_on() const override
neogfx::radio_button::paint
void paint(i_graphics_context &aGc) const override
neogfx::radio_button::mouse_entered
void mouse_entered(const point &aPosition) override
neogfx::radio_button::is_off
bool is_off() const override
neogfx::radio_button::next_button
i_radio_button * next_button() override
neogfx::radio_button::next_button
const i_radio_button * next_button() const override
neogfx::radio_button::object_type
neogfx::object_type object_type() const override
neogfx::radio_button::any_siblings_on
bool any_siblings_on() const override
neogfx::widget
Definition
widget.hpp:35
neolib::optional
Definition
optional.hpp:55
neogfx
Definition
action.hpp:28
neogfx::skin_element
skin_element
Definition
i_skinnable_item.hpp:30
neogfx::object_type
object_type
Definition
object_type.hpp:27
meta_object
#define meta_object(...)
Definition
i_object.hpp:28
neogfx.hpp
define_event
#define define_event(name, declName,...)
Definition
event.hpp:200
include
neogfx
gui
widget
radio_button.hpp
Generated by
1.9.8