From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Wasabi/api/wnd/wndclass/oswnd.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Src/Wasabi/api/wnd/wndclass/oswnd.cpp (limited to 'Src/Wasabi/api/wnd/wndclass/oswnd.cpp') diff --git a/Src/Wasabi/api/wnd/wndclass/oswnd.cpp b/Src/Wasabi/api/wnd/wndclass/oswnd.cpp new file mode 100644 index 00000000..021327ab --- /dev/null +++ b/Src/Wasabi/api/wnd/wndclass/oswnd.cpp @@ -0,0 +1,32 @@ +#include +#include "oswnd.h" + +int OSWnd::onInit() +{ + OSWND_PARENT::onInit(); + onSetVisible(isVisible()); + return 1; +} + +void OSWnd::onSetVisible(int show) +{ +#ifdef WIN32 + ShowWindow(getOSHandle(), show ? SW_NORMAL : SW_HIDE); +#endif +} + +int OSWnd::onResize() +{ + OSWND_PARENT::onResize(); +#ifdef WIN32 + if (getOSHandle()) + { + RECT r; + getClientRect(&r); + SetWindowPos(getOSHandle(), NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOACTIVATE); + } +#endif + return 1; +} + + -- cgit