neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
view_container.hpp
Go to the documentation of this file.
1// view_container.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>
33
34namespace neogfx::mvc
35{
36 class view_stack : public drag_drop_target<framed_scrollable_widget>
37 {
39 public:
40 view_stack(i_layout& aLayout, i_view_container& aParent);
41 public:
42 void add_view(i_view& aView);
43 void remove_view(i_view& aView);
44 protected:
45 neogfx::focus_policy focus_policy() const override;
46 private:
47 stack_layout iLayout;
48 i_view_container& iParent;
49 };
50
51 template <typename Base = scrollable_widget<>>
53 {
55 public:
56 define_declared_event(ViewAdded, view_added, i_view&)
57 define_declared_event(ViewRemoved, view_removed, i_view&)
58 public:
61 public:
62 bool is_widget() const override;
63 const i_widget& as_widget() const override;
64 i_widget& as_widget() override;
65 const i_tab_container& tab_container() const override;
67 const mvc::view_stack& view_stack() const override;
68 mvc::view_stack& view_stack() override;
69 public:
70 i_layout& page_layout() override;
71 public:
72 view_container_style style() const override;
73 void change_style(view_container_style aNewStyle) override;
74 public:
75 void add_controller(i_controller& aController) override;
76 void add_controller(std::shared_ptr<i_controller> aController) override;
77 void remove_controller(i_controller& aController) override;
78 public:
79 bool is_managing_layout() const override;
80 private:
82 vertical_layout iLayout0;
83 horizontal_layout iLayout1;
84 mvc::view_stack iViewStack;
85 std::vector<std::shared_ptr<i_controller>> iControllers;
86 };
87
89}
const i_tab_container & tab_container() const override
bool is_widget() const override
void change_style(view_container_style aNewStyle) override
view_container_style style() const override
void remove_controller(i_controller &aController) override
const i_widget & as_widget() const override
bool is_managing_layout() const override
const mvc::view_stack & view_stack() const override
void add_controller(i_controller &aController) override
i_layout & page_layout() override
void remove_view(i_view &aView)
neogfx::focus_policy focus_policy() const override
void add_view(i_view &aView)
view_container scrollable_view_container
#define meta_object(...)
Definition i_object.hpp:28
#define define_declared_event(name, declName,...)
Definition event.hpp:195