neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
toolbar_button.hpp
Go to the documentation of this file.
1
// toolbar_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 <
neogfx/app/i_action.hpp
>
24
#include "
push_button.hpp
"
25
26
namespace
neogfx
27
{
28
class
toolbar_button
:
public
push_button
29
{
30
meta_object
(
push_button
)
31
public
:
32
toolbar_button
(
i_action
& aAction);
33
toolbar_button
(
ref_ptr<i_action>
aAction);
34
toolbar_button
(
i_widget
& aParent,
i_action
& aAction);
35
toolbar_button
(
i_widget
& aParent,
ref_ptr<i_action>
aAction);
36
toolbar_button
(
i_layout
& aLayout,
i_action
& aAction);
37
toolbar_button
(
i_layout
& aLayout,
ref_ptr<i_action>
aAction);
38
~toolbar_button
();
39
protected
:
40
virtual
void
layout_items_completed
();
41
public
:
42
const
i_action
&
action
()
const
;
43
i_action
&
action
();
44
public
:
45
virtual
neogfx::size_policy
size_policy
()
const
;
46
virtual
size
minimum_size
(
optional_size
const
& aAvailableSpace =
optional_size
{})
const
;
47
virtual
size
maximum_size
(
optional_size
const
& aAvailableSpace =
optional_size
{})
const
;
48
public
:
49
virtual
void
paint
(
i_graphics_context
& aGc)
const
;
50
public
:
51
virtual
color
base_color
()
const
;
52
public
:
53
virtual
neogfx::focus_policy
focus_policy
()
const
;
54
public
:
55
virtual
void
mouse_button_pressed
(
mouse_button
aButton,
const
point
& aPosition,
key_modifiers_e
aKeyModifiers);
56
virtual
void
mouse_button_released
(
mouse_button
aButton,
const
point
& aPosition);
57
protected
:
58
virtual
void
handle_clicked
();
59
private
:
60
void
init();
61
void
update_state();
62
private
:
63
ref_ptr<i_action>
iAction;
64
sink
iSink;
65
};
66
}
neogfx::basic_point< coordinate >
neogfx::basic_size< coordinate >
neogfx::i_action
Definition
i_action.hpp:32
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::push_button
Definition
push_button.hpp:32
neogfx::sRGB_color
Definition
color.hpp:374
neogfx::toolbar_button
Definition
toolbar_button.hpp:29
neogfx::toolbar_button::action
const i_action & action() const
neogfx::toolbar_button::focus_policy
virtual neogfx::focus_policy focus_policy() const
neogfx::toolbar_button::handle_clicked
virtual void handle_clicked()
neogfx::toolbar_button::layout_items_completed
virtual void layout_items_completed()
neogfx::toolbar_button::mouse_button_pressed
virtual void mouse_button_pressed(mouse_button aButton, const point &aPosition, key_modifiers_e aKeyModifiers)
neogfx::toolbar_button::base_color
virtual color base_color() const
neogfx::toolbar_button::paint
virtual void paint(i_graphics_context &aGc) const
neogfx::toolbar_button::minimum_size
virtual size minimum_size(optional_size const &aAvailableSpace=optional_size{}) const
neogfx::toolbar_button::mouse_button_released
virtual void mouse_button_released(mouse_button aButton, const point &aPosition)
neogfx::toolbar_button::action
i_action & action()
neogfx::toolbar_button::size_policy
virtual neogfx::size_policy size_policy() const
neogfx::toolbar_button::maximum_size
virtual size maximum_size(optional_size const &aAvailableSpace=optional_size{}) const
neolib::optional
Definition
optional.hpp:55
neolib::ref_ptr
Definition
reference_counted.hpp:185
neolib::sink
Definition
i_event.hpp:255
i_action.hpp
neogfx
Definition
action.hpp:28
neogfx::key_modifiers_e
key_modifiers_e
Definition
i_keyboard.hpp:588
neogfx::focus_policy
focus_policy
Definition
widget_bits.hpp:122
neogfx::mouse_button
mouse_button
Definition
i_mouse.hpp:31
meta_object
#define meta_object(...)
Definition
i_object.hpp:28
neogfx.hpp
push_button.hpp
include
neogfx
gui
widget
toolbar_button.hpp
Generated by
1.9.8