#pragma once #include "../render/StackLayoutRenderObject.h" #include "ControlHost.h" #include "LayoutControl.h" #include #include #include #include #include #include #include namespace cru::ui::controls { class CRU_UI_API Window : public LayoutControl { private: constexpr static auto kLogTag = "cru::ui::controls::Window"; friend Control; public: static constexpr auto kControlName = "Window"; Window(); static Window* CreatePopup(Control* attached_control); Control* GetAttachedControl(); void SetAttachedControl(Control* control); platform::gui::INativeWindow* GetNativeWindow(); void SetGainFocusOnCreateAndDestroyWhenLoseFocus(bool value); private: std::unique_ptr control_host_; Control* attached_control_; EventHandlerRevokerGuard parent_window_guard_; EventHandlerRevokerListGuard gain_focus_on_create_and_destroy_when_lose_focus_event_guard_; }; } // namespace cru::ui::controls