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/sepwnd.cpp | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Src/Wasabi/api/wnd/wndclass/sepwnd.cpp (limited to 'Src/Wasabi/api/wnd/wndclass/sepwnd.cpp') diff --git a/Src/Wasabi/api/wnd/wndclass/sepwnd.cpp b/Src/Wasabi/api/wnd/wndclass/sepwnd.cpp new file mode 100644 index 00000000..da45b11b --- /dev/null +++ b/Src/Wasabi/api/wnd/wndclass/sepwnd.cpp @@ -0,0 +1,63 @@ +#include + +#include +#include +#include "sepwnd.h" +#include +#include + +SepWnd::SepWnd() { + bitmap = NULL; + orientation = SEP_UNKNOWN; +} + +SepWnd::~SepWnd() { + if (bitmap) delete bitmap; +} + +int SepWnd::onPaint(Canvas *canvas) { + + PaintBltCanvas paintcanvas; + if (canvas == NULL) { + if (!paintcanvas.beginPaintNC(this)) return 0; + canvas = &paintcanvas; + } + + + if (!bitmap) { + switch (orientation) { + case SEP_VERTICAL: + bitmap = new SkinBitmap(L"studio.FrameVerticalDivider"); + break; + case SEP_HORIZONTAL: + bitmap = new SkinBitmap(L"studio.FrameHorizontalDivider"); + break; + case SEP_UNKNOWN: + return 1; + } + ASSERT(bitmap != NULL); + } + RECT r; + getClientRect(&r); + RenderBaseTexture(canvas, r); + if (bitmap) { + bitmap->stretchToRectAlpha(canvas, &r, 128); + } + return 1; +} + +int SepWnd::setOrientation(int which) { + orientation = which; + return 1; +} + +int SepWnd::onInit() { + SEPWND_PARENT::onInit(); + return 1; +} + +void SepWnd::freeResources() { + SEPWND_PARENT::freeResources(); + if (bitmap) delete bitmap; + bitmap = NULL; +} \ No newline at end of file -- cgit