From 25bbd589159f16e4e29e93ef0b0950fc3cbf817a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 31 Aug 2015 15:16:36 -0400 Subject: [PATCH] And wrote up the new Windows control.c. Let's take this to the bridge!... oh right, box.c :| --- redo/windows/control.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 redo/windows/control.c diff --git a/redo/windows/control.c b/redo/windows/control.c new file mode 100644 index 00000000..dd2a9acd --- /dev/null +++ b/redo/windows/control.c @@ -0,0 +1,37 @@ +// 16 august 2015 +#include "uipriv_windows.h" + +static uintmax_t type_uiWindowsControl = 0; + +uintmax_t uiWindowsControlType(void) +{ + if (type_uiWindowsControl == 0) + type_uiWindowsControl = uiRegisterType("uiWindowsControl", uiControlType(), sizeof (uiWindowsControl)); + return type_uiWindowsControl; +} + +static void defaultCommitShow(uiControl *c) +{ + ShowWindow((HWND) uiControlHandle(c), SW_SHOW); +} + +static void defaultCommitHide(uiControl *c) +{ + ShowWindow((HWND) uiControlHandle(c), SW_HIDE); +} + +void osCommitEnable(uiControl *c) +{ + EnableWindow((HWND) uiControlHandle(c), TRUE); +} + +void osCommitDisable(uiControl *c) +{ + EnableWindow((HWND) uiControlHandle(c), FALSE); +} + +void uiWindowsFinishControl(uiControl *c) +{ + c->CommitShow = defaultCommitShow; + c->CommitHide = defaultCommitHide; +}