Fixed some build errors in the Windows backend.
This commit is contained in:
parent
54c5d551f0
commit
8f4788d506
|
@ -63,7 +63,7 @@ static void defaultOnClicked(uiButton *b, void *data)
|
||||||
|
|
||||||
static char *getText(uiButton *b)
|
static char *getText(uiButton *b)
|
||||||
{
|
{
|
||||||
return uiWindowsControlText(uiControl(c));
|
return uiWindowsControlText(uiControl(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setText(uiButton *b, const char *text)
|
static void setText(uiButton *b, const char *text)
|
||||||
|
@ -71,9 +71,9 @@ static void setText(uiButton *b, const char *text)
|
||||||
uiWindowsControlSetText(uiControl(b), 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->onClicked = f;
|
||||||
b->onClickedData = data;
|
b->onClickedData = data;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
struct checkbox {
|
struct checkbox {
|
||||||
uiCheckbox c;
|
uiCheckbox c;
|
||||||
void (*onToggled)(uiControl *, void *);
|
void (*onToggled)(uiCheckbox *, void *);
|
||||||
void *onToggledData;
|
void *onToggledData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ static BOOL onWM_COMMAND(uiControl *cc, WORD code, LRESULT *lResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// we didn't use BS_AUTOCHECKBOX (see controls_windows.go) so we have to manage the check state ourselves
|
// 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;
|
check = BST_CHECKED;
|
||||||
if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||||
check = BST_UNCHECKED;
|
check = BST_UNCHECKED;
|
||||||
|
@ -74,7 +74,7 @@ static void setOnToggled(uiCheckbox *cc, void (*f)(uiCheckbox *, void *), void *
|
||||||
c->onToggledData = data;
|
c->onToggledData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getChecked(uiChecckbox *c)
|
static int getChecked(uiCheckbox *c)
|
||||||
{
|
{
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ uiCheckbox *uiNewCheckbox(const char *text)
|
||||||
uiWindowsNewControlParams p;
|
uiWindowsNewControlParams p;
|
||||||
WCHAR *wtext;
|
WCHAR *wtext;
|
||||||
|
|
||||||
c = uiNew(struct checkbox)
|
c = uiNew(struct checkbox);
|
||||||
|
|
||||||
p.dwExStyle = 0;
|
p.dwExStyle = 0;
|
||||||
p.lpClassName = L"button";
|
p.lpClassName = L"button";
|
||||||
|
|
|
@ -132,7 +132,7 @@ void addPage(uiTab *tt, const char *name, uiControl *child)
|
||||||
t->pages = (uiParent **) uiRealloc(t->pages, t->cap * sizeof (uiParent *), "uiParent *[]");
|
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);
|
n = SendMessageW(hwnd, TCM_GETITEMCOUNT, 0, 0);
|
||||||
|
|
||||||
parent = uiNewParent((uintptr_t) hwnd);
|
parent = uiNewParent((uintptr_t) hwnd);
|
||||||
|
@ -179,7 +179,7 @@ uiTab *uiNewTab(void)
|
||||||
uiWindowsNewControl(uiControl(t), &p);
|
uiWindowsNewControl(uiControl(t), &p);
|
||||||
|
|
||||||
hwnd = uiControlHWND(uiControl(t));
|
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()");
|
logLastError("error subclassing Tab to give it its own resize handler in uiNewTab()");
|
||||||
|
|
||||||
uiControl(t)->PreferredSize = preferredSize;
|
uiControl(t)->PreferredSize = preferredSize;
|
||||||
|
|
Loading…
Reference in New Issue