From b130ddc04b249e2d5c54735b4bf748e683f3d30b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 28 May 2016 21:29:00 -0400 Subject: [PATCH] Added a test of having multiple uiRadioButtons in the same parent container and started a test of intrinsic sizes of all non-container controls. --- darwin/radiobuttons.m | 2 -- test/GNUfiles.mk | 1 + test/main.c | 5 ++++- test/page13.c | 30 ++++++++++++++++++++++++++++++ test/test.h | 3 +++ 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 test/page13.c diff --git a/darwin/radiobuttons.m b/darwin/radiobuttons.m index 3b7a236b..b6c663e0 100644 --- a/darwin/radiobuttons.m +++ b/darwin/radiobuttons.m @@ -5,8 +5,6 @@ // This is documented on the NSMatrix page, but the rest of the OS X documentation says to still use NSMatrix. // NSMatrix has weird quirks anyway... -// TODO check that multiple radio buttons on the same parent container work right - // LONGTERM 6 units of spacing between buttons, as suggested by Interface Builder? struct uiRadioButtons { diff --git a/test/GNUfiles.mk b/test/GNUfiles.mk index 6cb4b0e3..94f1fa23 100644 --- a/test/GNUfiles.mk +++ b/test/GNUfiles.mk @@ -19,6 +19,7 @@ CFILES += \ test/page10.c \ test/page11.c \ test/page12.c \ + test/page13.c \ test/spaced.c HFILES += \ diff --git a/test/main.c b/test/main.c index 5b049120..dea51663 100644 --- a/test/main.c +++ b/test/main.c @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) uiWindow *w; uiBox *page2, *page3, *page4, *page5; uiBox *page6, *page7, *page8, *page9, *page10; - uiBox *page11, *page12; + uiBox *page11, *page12, *page13; uiTab *outerTab; uiTab *innerTab; int nomenus = 0; @@ -141,6 +141,9 @@ int main(int argc, char *argv[]) page12 = makePage12(); uiTabAppend(innerTab, "Page 12", uiControl(page12)); + page13 = makePage13(); + uiTabAppend(innerTab, "Page 13", uiControl(page13)); + if (startspaced) setSpaced(1); diff --git a/test/page13.c b/test/page13.c new file mode 100644 index 00000000..264488ed --- /dev/null +++ b/test/page13.c @@ -0,0 +1,30 @@ +// 28 may 2016 +#include "test.h" + +uiBox *makePage13(void) +{ + uiBox *page13; + uiRadioButtons *rb; + uiButton *b; + + page13 = newVerticalBox(); + + rb = uiNewRadioButtons(); + uiRadioButtonsAppend(rb, "Item 1"); + uiRadioButtonsAppend(rb, "Item 2"); + uiRadioButtonsAppend(rb, "Item 3"); + uiBoxAppend(page13, uiControl(rb), 0); + + rb = uiNewRadioButtons(); + uiRadioButtonsAppend(rb, "Item A"); + uiRadioButtonsAppend(rb, "Item B"); + uiBoxAppend(page13, uiControl(rb), 0); + + b = uiNewButton("Horizontal"); + uiBoxAppend(page13, uiControl(b), 0); + + b = uiNewButton("Vertical"); + uiBoxAppend(page13, uiControl(b), 0); + + return page13; +} diff --git a/test/test.h b/test/test.h index b7257e5d..db687576 100644 --- a/test/test.h +++ b/test/test.h @@ -77,3 +77,6 @@ extern uiBox *makePage11(void); // page12.c extern uiBox *makePage12(void); + +// page13.c +extern uiBox *makePage13(void);