Added uiStackPadded().
This commit is contained in:
parent
10ea719dc8
commit
a7281f9034
|
@ -255,7 +255,12 @@ void uiStackAdd(uiControl *st, uiControl *c, int stretchy)
|
||||||
updateParent(s->parent);
|
updateParent(s->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO get padded
|
int uiStackPadded(uiControl *c)
|
||||||
|
{
|
||||||
|
stack *s = (stack *) (c->data);
|
||||||
|
|
||||||
|
return s->padded;
|
||||||
|
}
|
||||||
|
|
||||||
void uiStackSetPadded(uiControl *c, int padded)
|
void uiStackSetPadded(uiControl *c, int padded)
|
||||||
{
|
{
|
||||||
|
|
15
new/test.c
15
new/test.c
|
@ -98,6 +98,16 @@ static void forceSpacedOff(uiControl *c, void *data)
|
||||||
uiCheckboxSetChecked(spaced, 0);
|
uiCheckboxSetChecked(spaced, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void showSpaced(uiControl *c, void *data)
|
||||||
|
{
|
||||||
|
char msg[] = { 'm', ' ', '0', ' ', 'p', ' ', '0', '\0' };
|
||||||
|
|
||||||
|
// TODO margined
|
||||||
|
if (uiStackPadded(stacks[0]))
|
||||||
|
msg[6] = '1';
|
||||||
|
uiEntrySetText(e, msg);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
uiInitError *err;
|
uiInitError *err;
|
||||||
|
@ -158,10 +168,11 @@ int main(int argc, char *argv[])
|
||||||
uiButtonOnClicked(setButton, forceSpacedOff, NULL);
|
uiButtonOnClicked(setButton, forceSpacedOff, NULL);
|
||||||
uiStackAdd(stacks[4], getButton, 0);
|
uiStackAdd(stacks[4], getButton, 0);
|
||||||
uiStackAdd(stacks[4], setButton, 0);
|
uiStackAdd(stacks[4], setButton, 0);
|
||||||
|
setButton = uiNewButton("Show");
|
||||||
|
uiButtonOnClicked(setButton, showSpaced, NULL);
|
||||||
|
uiStackAdd(stacks[4], setButton, 0);
|
||||||
uiStackAdd(stacks[0], stacks[4], 0);
|
uiStackAdd(stacks[0], stacks[4], 0);
|
||||||
|
|
||||||
// TODO get spaced values
|
|
||||||
|
|
||||||
uiWindowShow(w);
|
uiWindowShow(w);
|
||||||
uiMain();
|
uiMain();
|
||||||
printf("after uiMain()\n");
|
printf("after uiMain()\n");
|
||||||
|
|
2
new/ui.h
2
new/ui.h
|
@ -64,7 +64,7 @@ void uiButtonOnClicked(uiControl *, void (*)(uiControl *, void *), void *);
|
||||||
uiControl *uiNewHorizontalStack(void);
|
uiControl *uiNewHorizontalStack(void);
|
||||||
uiControl *uiNewVerticalStack(void);
|
uiControl *uiNewVerticalStack(void);
|
||||||
void uiStackAdd(uiControl *, uiControl *, int);
|
void uiStackAdd(uiControl *, uiControl *, int);
|
||||||
// TODO get padded
|
int uiStackPadded(uiControl *);
|
||||||
void uiStackSetPadded(uiControl *, int);
|
void uiStackSetPadded(uiControl *, int);
|
||||||
|
|
||||||
uiControl *uiNewEntry(void);
|
uiControl *uiNewEntry(void);
|
||||||
|
|
Loading…
Reference in New Issue