From 83cb20058289ef906086d10fe7333cfe7ec95018 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 16 Apr 2015 09:53:00 -0400 Subject: [PATCH] Fixed some build errors in the Windows backend. --- windows/button.c | 6 +++--- windows/checkbox.c | 8 ++++---- windows/tab.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/windows/button.c b/windows/button.c index d216d79d..fd7afa3d 100644 --- a/windows/button.c +++ b/windows/button.c @@ -63,7 +63,7 @@ static void defaultOnClicked(uiButton *b, void *data) static char *getText(uiButton *b) { - return uiWindowsControlText(uiControl(c)); + return uiWindowsControlText(uiControl(b)); } static void setText(uiButton *b, const char *text) @@ -71,9 +71,9 @@ static void setText(uiButton *b, const char *text) uiWindowsControlSetText(uiControl(b), text); } -static void setOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data) +static void setOnClicked(uiButton *bb, void (*f)(uiButton *, void *), void *data) { - struct button *b = (struct button *) b; + struct button *b = (struct button *) bb; b->onClicked = f; b->onClickedData = data; diff --git a/windows/checkbox.c b/windows/checkbox.c index 5d81620b..c1d5a6f5 100644 --- a/windows/checkbox.c +++ b/windows/checkbox.c @@ -3,7 +3,7 @@ struct checkbox { uiCheckbox c; - void (*onToggled)(uiControl *, void *); + void (*onToggled)(uiCheckbox *, void *); void *onToggledData; }; @@ -17,7 +17,7 @@ static BOOL onWM_COMMAND(uiControl *cc, WORD code, LRESULT *lResult) return FALSE; // we didn't use BS_AUTOCHECKBOX (see controls_windows.go) so we have to manage the check state ourselves - hwnd = uiControlHWND(c); + hwnd = uiControlHWND(uiControl(c)); check = BST_CHECKED; if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) check = BST_UNCHECKED; @@ -74,7 +74,7 @@ static void setOnToggled(uiCheckbox *cc, void (*f)(uiCheckbox *, void *), void * c->onToggledData = data; } -static int getChecked(uiChecckbox *c) +static int getChecked(uiCheckbox *c) { HWND hwnd; @@ -100,7 +100,7 @@ uiCheckbox *uiNewCheckbox(const char *text) uiWindowsNewControlParams p; WCHAR *wtext; - c = uiNew(struct checkbox) + c = uiNew(struct checkbox); p.dwExStyle = 0; p.lpClassName = L"button"; diff --git a/windows/tab.c b/windows/tab.c index 1afef829..09d8abfb 100644 --- a/windows/tab.c +++ b/windows/tab.c @@ -132,7 +132,7 @@ void addPage(uiTab *tt, const char *name, uiControl *child) t->pages = (uiParent **) uiRealloc(t->pages, t->cap * sizeof (uiParent *), "uiParent *[]"); } - hwnd = uiControlHWND(c); + hwnd = uiControlHWND(uiControl(t)); n = SendMessageW(hwnd, TCM_GETITEMCOUNT, 0, 0); parent = uiNewParent((uintptr_t) hwnd); @@ -179,7 +179,7 @@ uiTab *uiNewTab(void) uiWindowsNewControl(uiControl(t), &p); hwnd = uiControlHWND(uiControl(t)); - if ((*fv_SetWindowSubclass)(hwnd, tabSubProc, 0, (DWORD_PTR) c) == FALSE) + if ((*fv_SetWindowSubclass)(hwnd, tabSubProc, 0, (DWORD_PTR) t) == FALSE) logLastError("error subclassing Tab to give it its own resize handler in uiNewTab()"); uiControl(t)->PreferredSize = preferredSize;