neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
dock.hpp
Go to the documentation of this file.
1// dock.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>
28
29namespace neogfx
30{
31 class dock : public decorated<splitter, i_dock>
32 {
34 public:
35 using item = ref_ptr<i_dockable>;
36 using item_list = neolib::vector<item>;
37 private:
38 using abstract_item = abstract_t<item>;
39 public:
40 dock(i_widget& aParent, dock_area aArea, optional_size const& aInitialSize = {}, optional_size const& aInitialWeight = {});
41 dock(i_layout& aLayout, dock_area aArea, optional_size const& aInitialSize = {}, optional_size const& aInitialWeight = {});
42 public:
43 dock_area area() const override;
44 void set_area(dock_area aArea) override;
45 public:
46 const item_list& items() const override;
47 private:
48 void add(const abstract_item& aItem) override;
49 void remove(const abstract_item& aItem) override;
50 public:
51 neogfx::size_policy size_policy() const override;
52 public:
53 bool part_active(widget_part aPart) const override;
54 public:
55 color palette_color(color_role aColorRole) const override;
56 public:
57 using base_type::show;
58 bool show(bool aVisible) override;
59 private:
60 void init();
61 private:
62 dock_area iArea;
63 item_list iItems;
64 std::optional<property_delegate<optional_size_policy>> iParentLayoutSizePolicyDelegate;
65 };
66}
void set_area(dock_area aArea) override
const item_list & items() const override
color palette_color(color_role aColorRole) const override
dock(i_widget &aParent, dock_area aArea, optional_size const &aInitialSize={}, optional_size const &aInitialWeight={})
bool show(bool aVisible) override
bool part_active(widget_part aPart) const override
dock(i_layout &aLayout, dock_area aArea, optional_size const &aInitialSize={}, optional_size const &aInitialWeight={})
dock_area area() const override
neogfx::size_policy size_policy() const override
dock_area
Definition i_dock.hpp:31
#define meta_object(...)
Definition i_object.hpp:28