#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 { CRU_DEFINE_CLASS_LOG_TAG("cru::ui::controls::Window") friend Control; public: static constexpr auto kControlName = "Window"; Window(); static Window* CreatePopup(); void SetAttachedControl(Control* control); platform::gui::INativeWindow* GetNativeWindow(); void SetGainFocusOnCreateAndDestroyWhenLoseFocus(bool value); private: std::unique_ptr control_host_; Control* attached_control_; EventHandlerRevokerListGuard gain_focus_on_create_and_destroy_when_lose_focus_event_guard_; }; } // namespace cru::ui::controls