neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
tool_title_bar.hpp
Go to the documentation of this file.
1
// tool_title_bar.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 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/gui/widget/timer.hpp
>
24
#include <
neogfx/gfx/color.hpp
>
25
#include <
neogfx/gfx/texture.hpp
>
26
#include <
neogfx/gui/layout/horizontal_layout.hpp
>
27
#include <
neogfx/gui/layout/spacer.hpp
>
28
#include <
neogfx/gui/widget/i_tool.hpp
>
29
#include <
neogfx/gui/widget/label.hpp
>
30
#include <
neogfx/gui/widget/push_button.hpp
>
31
#include <
neogfx/gui/widget/i_title_bar.hpp
>
32
33
namespace
neogfx
34
{
35
class
tool_title_bar
:
public
widget
<i_title_bar>
36
{
37
meta_object
(
widget<i_title_bar>
)
38
public
:
39
typedef
i_title_bar
abstract_type
;
40
public
:
41
tool_title_bar
(
i_standard_layout_container
& aContainer, std::string
const
& aTitle = std::string{});
42
public
:
43
void
set_icon
(
i_texture
const
& aIcon)
override
;
44
i_string
const
&
title
()
const override
;
45
void
set_title
(
i_string
const
& aTitle)
override
;
46
public
:
47
const
image_widget
&
icon_widget
()
const override
;
48
image_widget
&
icon_widget
()
override
;
49
const
text_widget
&
title_widget
()
const override
;
50
text_widget
&
title_widget
()
override
;
51
protected
:
52
size
minimum_size
(
optional_size
const
& aAvailableSpace = {})
const
override
;
53
protected
:
54
neogfx::widget_type
widget_type
()
const override
;
55
protected
:
56
color
palette_color
(
color_role
aColorRole)
const override
;
57
protected
:
58
neogfx::focus_policy
focus_policy
()
const override
;
59
void
focus_gained
(focus_reason aFocusReason)
override
;
60
private
:
61
void
update_textures();
62
void
update_state();
63
private
:
64
i_standard_layout_container
& iContainer;
65
widget_timer
iUpdater;
66
horizontal_layout
iLayout;
67
text_widget
iTitle;
68
push_button
iPinButton;
69
push_button
iUnpinButton;
70
push_button
iCloseButton;
71
sink
iSink;
72
mutable
std::optional<std::pair<color, texture>> iPinTexture;
73
mutable
std::optional<std::pair<color, texture>> iUnpinTexture;
74
mutable
std::optional<std::pair<color, texture>> iCloseTexture;
75
bool
iStateActive;
76
};
77
}
neogfx::basic_size< coordinate >
neogfx::horizontal_layout
Definition
horizontal_layout.hpp:29
neogfx::i_standard_layout_container
Definition
i_layout.hpp:64
neogfx::i_texture
Definition
i_texture.hpp:84
neogfx::i_title_bar
Definition
i_title_bar.hpp:30
neogfx::image_widget
Definition
image_widget.hpp:31
neogfx::push_button
Definition
push_button.hpp:32
neogfx::sRGB_color
Definition
color.hpp:374
neogfx::text_widget
Definition
text_widget.hpp:28
neogfx::tool_title_bar
Definition
tool_title_bar.hpp:36
neogfx::tool_title_bar::title_widget
text_widget & title_widget() override
neogfx::tool_title_bar::tool_title_bar
tool_title_bar(i_standard_layout_container &aContainer, std::string const &aTitle=std::string{})
neogfx::tool_title_bar::title_widget
const text_widget & title_widget() const override
neogfx::tool_title_bar::title
i_string const & title() const override
neogfx::tool_title_bar::focus_policy
neogfx::focus_policy focus_policy() const override
neogfx::tool_title_bar::icon_widget
const image_widget & icon_widget() const override
neogfx::tool_title_bar::focus_gained
void focus_gained(focus_reason aFocusReason) override
neogfx::tool_title_bar::widget_type
neogfx::widget_type widget_type() const override
neogfx::tool_title_bar::set_title
void set_title(i_string const &aTitle) override
neogfx::tool_title_bar::palette_color
color palette_color(color_role aColorRole) const override
neogfx::tool_title_bar::minimum_size
size minimum_size(optional_size const &aAvailableSpace={}) const override
neogfx::tool_title_bar::set_icon
void set_icon(i_texture const &aIcon) override
neogfx::tool_title_bar::icon_widget
image_widget & icon_widget() override
neogfx::widget_timer
Definition
timer.hpp:31
neogfx::widget
Definition
widget.hpp:35
neogfx::widget< i_title_bar >::abstract_type
i_widget abstract_type
Definition
widget.hpp:69
neolib::i_string
Definition
i_string.hpp:49
neolib::optional
Definition
optional.hpp:55
neolib::sink
Definition
i_event.hpp:255
color.hpp
texture.hpp
horizontal_layout.hpp
i_title_bar.hpp
i_tool.hpp
label.hpp
neogfx
Definition
action.hpp:28
neogfx::widget_type
widget_type
Definition
widget_bits.hpp:27
neogfx::focus_policy
focus_policy
Definition
widget_bits.hpp:122
neogfx::color_role
color_role
Definition
i_palette.hpp:31
meta_object
#define meta_object(...)
Definition
i_object.hpp:28
timer.hpp
neogfx.hpp
push_button.hpp
spacer.hpp
include
neogfx
gui
widget
tool_title_bar.hpp
Generated by
1.9.8