Added a swap horizontal/vertical uiBox mode to the test program.
This commit is contained in:
parent
4d48b08ae2
commit
2aa1227238
|
@ -33,6 +33,9 @@ int onShouldQuit(void *data)
|
||||||
uiBox *mainBox;
|
uiBox *mainBox;
|
||||||
uiTab *mainTab;
|
uiTab *mainTab;
|
||||||
|
|
||||||
|
uiBox *(*newhbox)(void);
|
||||||
|
uiBox *(*newvbox)(void);
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
uiInitOptions o;
|
uiInitOptions o;
|
||||||
|
@ -42,11 +45,17 @@ int main(int argc, char *argv[])
|
||||||
uiBox *page2, *page3, *page4, *page5;
|
uiBox *page2, *page3, *page4, *page5;
|
||||||
int nomenus = 0;
|
int nomenus = 0;
|
||||||
|
|
||||||
|
newhbox = uiNewHorizontalBox;
|
||||||
|
newvbox = uiNewVerticalBox;
|
||||||
|
|
||||||
memset(&o, 0, sizeof (uiInitOptions));
|
memset(&o, 0, sizeof (uiInitOptions));
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
if (strcmp(argv[i], "nomenus") == 0)
|
if (strcmp(argv[i], "nomenus") == 0)
|
||||||
nomenus = 1;
|
nomenus = 1;
|
||||||
else {
|
else if (strcmp(argv[i], "swaphv") == 0) {
|
||||||
|
newhbox = uiNewVerticalBox;
|
||||||
|
newvbox = uiNewHorizontalBox;
|
||||||
|
} else {
|
||||||
fprintf(stderr, "%s: unrecognized option %s\n", argv[0], argv[i]);
|
fprintf(stderr, "%s: unrecognized option %s\n", argv[0], argv[i]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ static uiBox *makeSet(int omit, int hidden, int stretch)
|
||||||
|
|
||||||
// don't use newHorizontalBox()
|
// don't use newHorizontalBox()
|
||||||
// the point of this test is to test hidden controls and padded
|
// the point of this test is to test hidden controls and padded
|
||||||
hbox = uiNewHorizontalBox();
|
hbox = (*newhbox)();
|
||||||
uiBoxSetPadded(hbox, 1);
|
uiBoxSetPadded(hbox, 1);
|
||||||
if (omit != 0) {
|
if (omit != 0) {
|
||||||
buttons[0] = uiNewButton("First");
|
buttons[0] = uiNewButton("First");
|
||||||
|
@ -44,8 +44,8 @@ uiBox *makePage3(void)
|
||||||
// first the non-stretchy type
|
// first the non-stretchy type
|
||||||
for (hidden = 0; hidden < 4; hidden++) {
|
for (hidden = 0; hidden < 4; hidden++) {
|
||||||
// these two must stay unpadded as well, otherwise the test isn't meaningful
|
// these two must stay unpadded as well, otherwise the test isn't meaningful
|
||||||
hbox2 = uiNewHorizontalBox();
|
hbox2 = (*newhbox)();
|
||||||
vbox = uiNewVerticalBox();
|
vbox = (*newvbox)();
|
||||||
// reference set
|
// reference set
|
||||||
hbox = makeSet(hidden, -1, 0);
|
hbox = makeSet(hidden, -1, 0);
|
||||||
uiBoxAppend(vbox, uiControl(hbox), 0);
|
uiBoxAppend(vbox, uiControl(hbox), 0);
|
||||||
|
|
|
@ -108,7 +108,7 @@ uiBox *newHorizontalBox(void)
|
||||||
{
|
{
|
||||||
uiBox *b;
|
uiBox *b;
|
||||||
|
|
||||||
b = uiNewHorizontalBox();
|
b = (*newhbox)();
|
||||||
append(b, box);
|
append(b, box);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ uiBox *newVerticalBox(void)
|
||||||
{
|
{
|
||||||
uiBox *b;
|
uiBox *b;
|
||||||
|
|
||||||
b = uiNewVerticalBox();
|
b = (*newvbox)();
|
||||||
append(b, box);
|
append(b, box);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
extern void die(const char *, ...);
|
extern void die(const char *, ...);
|
||||||
extern uiBox *mainBox;
|
extern uiBox *mainBox;
|
||||||
extern uiTab *mainTab;
|
extern uiTab *mainTab;
|
||||||
|
extern uiBox *(*newhbox)(void);
|
||||||
|
extern uiBox *(*newvbox)(void);
|
||||||
|
|
||||||
// spaced.c
|
// spaced.c
|
||||||
extern void setSpaced(int);
|
extern void setSpaced(int);
|
||||||
|
|
Loading…
Reference in New Issue