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/*
3neogfx C++ App/Game Engine
4Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6This program is free software: you can redistribute it and / or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
24#include "push_button.hpp"
25
26namespace neogfx
27{
29 {
31 public:
32 toolbar_button(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);
39 protected:
40 virtual void layout_items_completed();
41 public:
42 const i_action& action() const;
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:
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}
const i_action & action() const
virtual neogfx::focus_policy focus_policy() const
virtual void handle_clicked()
virtual void layout_items_completed()
virtual void mouse_button_pressed(mouse_button aButton, const point &aPosition, key_modifiers_e aKeyModifiers)
virtual color base_color() const
virtual void paint(i_graphics_context &aGc) const
virtual size minimum_size(optional_size const &aAvailableSpace=optional_size{}) const
virtual void mouse_button_released(mouse_button aButton, const point &aPosition)
virtual neogfx::size_policy size_policy() const
virtual size maximum_size(optional_size const &aAvailableSpace=optional_size{}) const
mouse_button
Definition i_mouse.hpp:31
#define meta_object(...)
Definition i_object.hpp:28