neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
color_widget.hpp
Go to the documentation of this file.
1
// color_widget.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
#pragma once
20
21
#include <
neogfx/neogfx.hpp
>
22
#include <
neolib/core/variant.hpp
>
23
#include <
neogfx/app/i_resource.hpp
>
24
#include <
neogfx/gfx/color.hpp
>
25
#include <
neogfx/gui/widget/framed_widget.hpp
>
26
#include <
neogfx/gui/widget/button.hpp
>
27
28
namespace
neogfx
29
{
30
class
color_widget
:
public
button
<>
31
{
32
meta_object
(
button<>
)
33
public
:
34
define_event
(ColorChanged, color_changed)
35
public
:
36
color_widget
(
const
neogfx::color
& aColor =
neogfx::color
{});
37
color_widget
(
i_widget
& aParent,
const
neogfx::color
& aColor =
neogfx::color
{});
38
color_widget
(
i_layout
& aLayout,
const
neogfx::color
& aColor =
neogfx::color
{});
39
public
:
40
neogfx::color
const
&
color
()
const
;
41
void
set_color
(
neogfx::color
const
& aColor);
42
public
:
43
neogfx::size_policy
size_policy
()
const override
;
44
size
minimum_size
(
optional_size
const
& aAvailableSpace =
optional_size
{})
const
override
;
45
public
:
46
void
paint
(
i_graphics_context
& aGc)
const override
;
47
private
:
48
void
init();
49
private
:
50
neogfx::color
iColor;
51
};
52
}
button.hpp
neogfx::basic_size< coordinate >
neogfx::button
Definition
button.hpp:36
neogfx::color_widget
Definition
color_widget.hpp:31
neogfx::color_widget::minimum_size
size minimum_size(optional_size const &aAvailableSpace=optional_size{}) const override
neogfx::color_widget::color
neogfx::color const & color() const
neogfx::color_widget::set_color
void set_color(neogfx::color const &aColor)
neogfx::color_widget::paint
void paint(i_graphics_context &aGc) const override
neogfx::color_widget::size_policy
neogfx::size_policy size_policy() const override
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::sRGB_color
Definition
color.hpp:374
neolib::optional
Definition
optional.hpp:55
framed_widget.hpp
color.hpp
i_resource.hpp
neogfx
Definition
action.hpp:28
meta_object
#define meta_object(...)
Definition
i_object.hpp:28
neogfx.hpp
define_event
#define define_event(name, declName,...)
Definition
event.hpp:200
variant.hpp
include
neogfx
gui
widget
color_widget.hpp
Generated by
1.9.8