Filled in more of windows/radiobuttons.c.

This commit is contained in:
Pietro Gagliardi 2015-06-01 13:51:53 -04:00
parent f7c19d2213
commit 5fa84c1914
1 changed files with 23 additions and 11 deletions

View File

@ -97,14 +97,25 @@ static void radiobuttonsResize(uiControl *c, intmax_t x, intmax_t y, intmax_t wi
static uiSizing *radiobuttonsSizing(uiControl *c) static uiSizing *radiobuttonsSizing(uiControl *c)
{ {
// TODO complain("attempt to call uiControlSizing() on uiRadioButtons %p", c);
return NULL; return NULL;
} }
static void radiobuttonsSHED(uiControl *c) #define COMMIT(n, f) \
{ static void radiobuttonsCommit ## n(uiControl *c) \
// TODO { \
} struct radiobuttons *r = (struct radiobuttons *) c; \
uintmax_t i; \
HWND hwnd; \
for (i = 0; i < r->hwnds->len; i++) { \
hwnd = ptrArrayIndex(r->hwnds, HWND, i); \
f(hwnd); \
} \
}
COMMIT(Show, uiWindowsUtilShow)
COMMIT(Hide, uiWindowsUtilHide)
COMMIT(Enable, uiWindowsUtilEnable)
COMMIT(Disable, uiWindowsUtilDisable)
static uintptr_t radiobuttonsStartZOrder(uiControl *c) static uintptr_t radiobuttonsStartZOrder(uiControl *c)
{ {
@ -120,8 +131,9 @@ static uintptr_t radiobuttonsSetZOrder(uiControl *c, uintptr_t insertAfter)
static int radiobuttonsHasTabStops(uiControl *c) static int radiobuttonsHasTabStops(uiControl *c)
{ {
// TODO return 0 if no radio buttons struct radiobuttons *r = (struct radiobuttons *) c;
return 1;
return r->hwnds->len != 0;
} }
static void radiobuttonsAppend(uiRadioButtons *rr, const char *text) static void radiobuttonsAppend(uiRadioButtons *rr, const char *text)
@ -156,10 +168,10 @@ uiRadioButtons *uiNewRadioButtons(void)
uiControl(r)->PreferredSize = radiobuttonsPreferredSize; uiControl(r)->PreferredSize = radiobuttonsPreferredSize;
uiControl(r)->Resize = radiobuttonsResize; uiControl(r)->Resize = radiobuttonsResize;
uiControl(r)->Sizing = radiobuttonsSizing; uiControl(r)->Sizing = radiobuttonsSizing;
uiControl(r)->CommitShow = radiobuttonsSHED; uiControl(r)->CommitShow = radiobuttonsCommitShow;
uiControl(r)->CommitHide = radiobuttonsSHED; uiControl(r)->CommitHide = radiobuttonsCommitHide;
uiControl(r)->CommitEnable = radiobuttonsSHED; uiControl(r)->CommitEnable = radiobuttonsCommitEnable;
uiControl(r)->CommitDisable = radiobuttonsSHED; uiControl(r)->CommitDisable = radiobuttonsCommitDisable;
uiControl(r)->StartZOrder = radiobuttonsStartZOrder; uiControl(r)->StartZOrder = radiobuttonsStartZOrder;
uiControl(r)->SetZOrder = radiobuttonsSetZOrder; uiControl(r)->SetZOrder = radiobuttonsSetZOrder;
uiControl(r)->HasTabStops = radiobuttonsHasTabStops; uiControl(r)->HasTabStops = radiobuttonsHasTabStops;