GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
WindowHolder.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace gui_framework
7{
10 {
11 private:
12 std::unique_ptr<BaseComposite> compositeWindow;
13 bool unregisterClass;
14
15 WindowHolder(BaseDialogBox* dialogBox);
16
17 public:
21 WindowHolder(std::unique_ptr<BaseComposite>&& compositeWindow, bool unregisterClass = false) noexcept;
22
23 template<std::derived_from<BaseComposite> T>
24 T* get();
25
26 template<std::derived_from<BaseComposite> T>
27 const T* get() const;
28
29 BaseComposite* get();
30
31 const BaseComposite* get() const;
32
36 int runMainLoop(const std::vector<uint32_t>& registeredHotkeyIds = {});
37
39
40 friend class BaseDialogBox;
41 };
42
43 template<std::derived_from<BaseComposite> T>
45 {
46 return static_cast<T*>(compositeWindow.get());
47 }
48
49 template<std::derived_from<BaseComposite> T>
50 const T* WindowHolder::get() const
51 {
52 return static_cast<T*>(compositeWindow.get());
53 }
54}
#define GUI_FRAMEWORK_API
Base class for all windows that has children windows.
Base class for all dialog boxes.
Provides runMainLoop for top level window.
WindowHolder(std::unique_ptr< BaseComposite > &&compositeWindow, bool unregisterClass=false) noexcept