summaryrefslogtreecommitdiff
path: root/plugingui/widget.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-10-18 14:49:43 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2011-10-18 14:49:43 +0200
commit3e85cc8bfccf63236e815eba64acd99fbe154daf (patch)
treec3988ded4857263cebff1515999fa5f44aa39b85 /plugingui/widget.cc
parentef47c71a29292ff9114a67d782e526ac662a1f32 (diff)
New Label and LED widgets.
Diffstat (limited to 'plugingui/widget.cc')
-rw-r--r--plugingui/widget.cc43
1 files changed, 42 insertions, 1 deletions
diff --git a/plugingui/widget.cc b/plugingui/widget.cc
index 12100dc..04af3c2 100644
--- a/plugingui/widget.cc
+++ b/plugingui/widget.cc
@@ -87,7 +87,48 @@ Widget::Widget(GlobalContext *gctx, Widget *parent)
XNextEvent(gctx->display, &e);
if(e.type == MapNotify) break;
}
-#endif
+#endif/*X11*/
+
+#ifdef WIN32
+ WNDCLASSEX wcex;
+ WNDID wndId;
+
+ wctx->m_hwnd = 0;
+ wctx->m_className = NULL;
+
+ memset(&wcex, 0, sizeof(wcex));
+
+ /*
+ Time to register a window class. Generic flags and everything. cbWndExtra is the
+ size of a pointer to an object - we need this in the wndproc handler.
+ */
+ wcex.cbSize = sizeof(WNDCLASSEX);
+ wcex.style = class_style;
+ wcex.lpfnWndProc = (WNDPROC) data;
+ wcex.cbWndExtra = sizeof(CWindow *);
+ wcex.hInstance = GetModuleHandle(NULL);
+
+ // if(ex_style && WS_EX_TRANSPARENT == WS_EX_TRANSPARENT) {
+ // wcex.hbrBackground = NULL;
+ // } else {
+ wcex.hbrBackground = (HBRUSH) COLOR_BACKGROUND + 1;
+ // }
+
+ wcex.lpszClassName = wctx->m_className = strdup(className);
+
+ RegisterClassEx(&wcex);
+
+ if(parent) {
+ style = style | WS_CHILD;
+ wndId = parent->getWndId();
+ } else {
+ style = style | WS_OVERLAPPEDWINDOW;
+ wndId = 0;
+ }
+
+ wctx->m_hwnd = CreateWindowEx(ex_style, wctx->m_className, "DGBasisWidget", style, x, y, w, h,
+ wndId, NULL, GetModuleHandle(NULL), NULL);
+#endif/*WIN32*/
}
Widget::~Widget()