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>
24#include <neogfx/gfx/color.hpp>
27
28namespace neogfx
29{
30 class color_widget : public button<>
31 {
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}
size minimum_size(optional_size const &aAvailableSpace=optional_size{}) const override
neogfx::color const & color() const
void set_color(neogfx::color const &aColor)
void paint(i_graphics_context &aGc) const override
neogfx::size_policy size_policy() const override
#define meta_object(...)
Definition i_object.hpp:28
#define define_event(name, declName,...)
Definition event.hpp:200