More TODO resolution.
This commit is contained in:
parent
25208dcab4
commit
e46822a9b1
|
@ -22,7 +22,7 @@ static BOOL onWM_COMMAND(uiControl *cc, HWND hwnd, WORD code, LRESULT *lResult)
|
||||||
if (code != BN_CLICKED)
|
if (code != BN_CLICKED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// we didn't use BS_AUTOCHECKBOX (TODO get link) so we have to manage the check state ourselves
|
// we didn't use BS_AUTOCHECKBOX (http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx) so we have to manage the check state ourselves
|
||||||
check = BST_CHECKED;
|
check = BST_CHECKED;
|
||||||
if (SendMessage(c->hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
if (SendMessage(c->hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||||
check = BST_UNCHECKED;
|
check = BST_UNCHECKED;
|
||||||
|
|
|
@ -117,6 +117,21 @@ void uiGroupSetMargined(uiGroup *g, int margined)
|
||||||
uiWindowsControlQueueRelayout(uiWindowsControl(g));
|
uiWindowsControlQueueRelayout(uiWindowsControl(g));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT CALLBACK groupSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
|
||||||
|
{
|
||||||
|
LRESULT lResult;
|
||||||
|
|
||||||
|
if (handleParentMessages(hwnd, uMsg, wParam, lParam, &lResult) != FALSE)
|
||||||
|
return lResult;
|
||||||
|
switch (uMsg) {
|
||||||
|
case WM_NCDESTROY:
|
||||||
|
if (RemoveWindowSubclass(hwnd, groupSubProc, uIdSubclass) == FALSE)
|
||||||
|
logLastError("error removing groupbox subclass in groupSubProc()");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
uiGroup *uiNewGroup(const char *text)
|
uiGroup *uiNewGroup(const char *text)
|
||||||
{
|
{
|
||||||
uiGroup *g;
|
uiGroup *g;
|
||||||
|
@ -132,7 +147,8 @@ uiGroup *uiNewGroup(const char *text)
|
||||||
TRUE);
|
TRUE);
|
||||||
uiFree(wtext);
|
uiFree(wtext);
|
||||||
|
|
||||||
// TODO subclass uiGroup to call parent.c functions
|
if (SetWindowSubclass(g->hwnd, groupSubProc, 0, (DWORD_PTR) g) == FALSE)
|
||||||
|
logLastError("error subclassing groupbox to handle parent messages in uiNewGroup()");
|
||||||
|
|
||||||
uiWindowsFinishNewControl(g, uiGroup);
|
uiWindowsFinishNewControl(g, uiGroup);
|
||||||
uiControl(g)->ContainerUpdateState = groupContainerUpdateState;
|
uiControl(g)->ContainerUpdateState = groupContainerUpdateState;
|
||||||
|
|
|
@ -78,31 +78,34 @@ static void minimumSize(uiWindowsControl *c, uiWindowsSizing *d, intmax_t *width
|
||||||
|
|
||||||
static void radiobuttonsRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height)
|
static void radiobuttonsRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height)
|
||||||
{
|
{
|
||||||
/* TODO
|
uiRadioButtons *r = uiRadioButtons(c);
|
||||||
struct radiobuttons *r = (struct radiobuttons *) c;
|
uiWindowsSizing *d;
|
||||||
intmax_t height1;
|
intmax_t height1;
|
||||||
intmax_t h;
|
intmax_t h;
|
||||||
uintmax_t i;
|
uintmax_t i;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|
||||||
// TODO resize the main hwnd
|
uiWindowsEnsureMoveWindow(r->hwnd, x, y, width, height);
|
||||||
|
|
||||||
height1 = uiWindowsDlgUnitsToY(radiobuttonHeight, d->Sys->BaseY);
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
d = uiWindowsNewSizing(r->hwnd);
|
||||||
|
height1 = uiWindowsDlgUnitsToY(radiobuttonHeight, d->BaseY);
|
||||||
|
uiWindowsFreeSizing(d);
|
||||||
for (i = 0; i < r->hwnds->len; i++) {
|
for (i = 0; i < r->hwnds->len; i++) {
|
||||||
hwnd = ptrArrayIndex(r->hwnds, HWND, i);
|
hwnd = ptrArrayIndex(r->hwnds, HWND, i);
|
||||||
h = height1;
|
h = height1;
|
||||||
if (h > height) // clip to height
|
if (h > height) // clip to height
|
||||||
h = height;
|
h = height;
|
||||||
moveWindow(hwnd, x, y, width, h, d);
|
uiWindowsEnsureMoveWindow(hwnd, x, y, width, h);
|
||||||
y += height1;
|
y += height1;
|
||||||
height -= height1;
|
height -= height1;
|
||||||
if (height <= 0) // clip to height
|
if (height <= 0) // clip to height
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO container update state
|
// TODO commit enable/disable
|
||||||
|
|
||||||
/* TODO
|
/* TODO
|
||||||
static uintptr_t radiobuttonsStartZOrder(uiControl *c)
|
static uintptr_t radiobuttonsStartZOrder(uiControl *c)
|
||||||
|
@ -137,10 +140,9 @@ static int radiobuttonsHasTabStops(uiControl *c)
|
||||||
|
|
||||||
void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
|
void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
|
||||||
{
|
{
|
||||||
/* TODO
|
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
WCHAR *wtext;
|
WCHAR *wtext;
|
||||||
HWND after;
|
//TODO HWND after;
|
||||||
|
|
||||||
wtext = toUTF16(text);
|
wtext = toUTF16(text);
|
||||||
hwnd = uiWindowsEnsureCreateControlHWND(0,
|
hwnd = uiWindowsEnsureCreateControlHWND(0,
|
||||||
|
@ -149,9 +151,10 @@ void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
|
||||||
hInstance, NULL,
|
hInstance, NULL,
|
||||||
TRUE);
|
TRUE);
|
||||||
uiFree(wtext);
|
uiFree(wtext);
|
||||||
uiWindowsUtilSetParent(hwnd, r->parent);
|
uiWindowsEnsureSetParent(hwnd, r->hwnd);
|
||||||
uiWindowsRegisterWM_COMMANDHandler(hwnd, onWM_COMMAND, uiControl(r));
|
uiWindowsRegisterWM_COMMANDHandler(hwnd, onWM_COMMAND, uiControl(r));
|
||||||
|
|
||||||
|
/* TODO
|
||||||
// maintain z-order
|
// maintain z-order
|
||||||
if (r->hwnds->len == 0) // first item
|
if (r->hwnds->len == 0) // first item
|
||||||
uiWindowsUtilSetZOrder(hwnd, r->insertAfter);
|
uiWindowsUtilSetZOrder(hwnd, r->insertAfter);
|
||||||
|
@ -159,10 +162,10 @@ void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
|
||||||
after = ptrArrayIndex(r->hwnds, HWND, r->hwnds->len - 1);
|
after = ptrArrayIndex(r->hwnds, HWND, r->hwnds->len - 1);
|
||||||
uiWindowsUtilSetZOrder(hwnd, (uintptr_t) after);
|
uiWindowsUtilSetZOrder(hwnd, (uintptr_t) after);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
ptrArrayAppend(r->hwnds, hwnd);
|
ptrArrayAppend(r->hwnds, hwnd);
|
||||||
uiControlQueueResize(uiControl(r));
|
uiWindowsControlQueueRelayout(uiWindowsControl(r));
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiRadioButtons *uiNewRadioButtons(void)
|
uiRadioButtons *uiNewRadioButtons(void)
|
||||||
|
|
Loading…
Reference in New Issue