Changed uiStackAdd() to uiStackAppend() and uiStackRemove() to uiStackDelete(); this will be the naming system other containers will follow.
This commit is contained in:
parent
1f9975a7fa
commit
eb62b8e32b
|
@ -344,7 +344,7 @@ uiControl *uiNewVerticalStack(void)
|
||||||
|
|
||||||
#define stackCapGrow 32
|
#define stackCapGrow 32
|
||||||
|
|
||||||
void uiStackAdd(uiControl *st, uiControl *c, int stretchy)
|
void uiStackAppend(uiControl *st, uiControl *c, int stretchy)
|
||||||
{
|
{
|
||||||
stack *s = (stack *) (st->data);
|
stack *s = (stack *) (st->data);
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ void uiStackAdd(uiControl *st, uiControl *c, int stretchy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiStackRemove(uiControl *st, uintmax_t index)
|
void uiStackDelete(uiControl *st, uintmax_t index)
|
||||||
{
|
{
|
||||||
stack *s = (stack *) (st->data);
|
stack *s = (stack *) (st->data);
|
||||||
uiControl *removed;
|
uiControl *removed;
|
||||||
|
|
78
new/test.c
78
new/test.c
|
@ -154,14 +154,14 @@ uiControl *movingLabel;
|
||||||
|
|
||||||
static void moveToFirst(uiControl *c, void *data)
|
static void moveToFirst(uiControl *c, void *data)
|
||||||
{
|
{
|
||||||
uiStackRemove(secondStack, 1);
|
uiStackDelete(secondStack, 1);
|
||||||
uiStackAdd(firstStack, movingLabel, 1);
|
uiStackAppend(firstStack, movingLabel, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void moveToSecond(uiControl *c, void *data)
|
static void moveToSecond(uiControl *c, void *data)
|
||||||
{
|
{
|
||||||
uiStackRemove(firstStack, 1);
|
uiStackDelete(firstStack, 1);
|
||||||
uiStackAdd(secondStack, movingLabel, 1);
|
uiStackAppend(secondStack, movingLabel, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -196,7 +196,7 @@ int main(int argc, char *argv[])
|
||||||
stacks[0] = uiNewVerticalStack();
|
stacks[0] = uiNewVerticalStack();
|
||||||
|
|
||||||
e = uiNewEntry();
|
e = uiNewEntry();
|
||||||
uiStackAdd(stacks[0], e, 0);
|
uiStackAppend(stacks[0], e, 0);
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
|
|
||||||
|
@ -205,9 +205,9 @@ int main(int argc, char *argv[])
|
||||||
uiButtonOnClicked(getButton, getWindowText, w);
|
uiButtonOnClicked(getButton, getWindowText, w);
|
||||||
setButton = uiNewButton("Set Window Text");
|
setButton = uiNewButton("Set Window Text");
|
||||||
uiButtonOnClicked(setButton, setWindowText, w);
|
uiButtonOnClicked(setButton, setWindowText, w);
|
||||||
uiStackAdd(stacks[i], getButton, 1);
|
uiStackAppend(stacks[i], getButton, 1);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
stacks[i] = uiNewHorizontalStack();
|
stacks[i] = uiNewHorizontalStack();
|
||||||
|
@ -215,9 +215,9 @@ int main(int argc, char *argv[])
|
||||||
uiButtonOnClicked(getButton, getButtonText, getButton);
|
uiButtonOnClicked(getButton, getButtonText, getButton);
|
||||||
setButton = uiNewButton("Set Button Text");
|
setButton = uiNewButton("Set Button Text");
|
||||||
uiButtonOnClicked(setButton, setButtonText, getButton);
|
uiButtonOnClicked(setButton, setButtonText, getButton);
|
||||||
uiStackAdd(stacks[i], getButton, 1);
|
uiStackAppend(stacks[i], getButton, 1);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
// this will also be used to make sure tab stops work properly when inserted out of creation order, especially on Windows
|
// this will also be used to make sure tab stops work properly when inserted out of creation order, especially on Windows
|
||||||
|
@ -229,9 +229,9 @@ int main(int argc, char *argv[])
|
||||||
uiButtonOnClicked(getButton, getCheckboxText, spaced);
|
uiButtonOnClicked(getButton, getCheckboxText, spaced);
|
||||||
setButton = uiNewButton("Set Checkbox Text");
|
setButton = uiNewButton("Set Checkbox Text");
|
||||||
uiButtonOnClicked(setButton, setCheckboxText, spaced);
|
uiButtonOnClicked(setButton, setCheckboxText, spaced);
|
||||||
uiStackAdd(stacks[i], getButton, 1);
|
uiStackAppend(stacks[i], getButton, 1);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
label = uiNewLabel("Label");
|
label = uiNewLabel("Label");
|
||||||
|
@ -241,60 +241,60 @@ int main(int argc, char *argv[])
|
||||||
uiButtonOnClicked(getButton, getLabelText, label);
|
uiButtonOnClicked(getButton, getLabelText, label);
|
||||||
setButton = uiNewButton("Set Label Text");
|
setButton = uiNewButton("Set Label Text");
|
||||||
uiButtonOnClicked(setButton, setLabelText, label);
|
uiButtonOnClicked(setButton, setLabelText, label);
|
||||||
uiStackAdd(stacks[i], getButton, 1);
|
uiStackAppend(stacks[i], getButton, 1);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
stacks[i] = uiNewHorizontalStack();
|
stacks[i] = uiNewHorizontalStack();
|
||||||
uiStackAdd(stacks[i], spaced, 1);
|
uiStackAppend(stacks[i], spaced, 1);
|
||||||
getButton = uiNewButton("On");
|
getButton = uiNewButton("On");
|
||||||
uiButtonOnClicked(getButton, forceSpacedOn, NULL);
|
uiButtonOnClicked(getButton, forceSpacedOn, NULL);
|
||||||
setButton = uiNewButton("Off");
|
setButton = uiNewButton("Off");
|
||||||
uiButtonOnClicked(setButton, forceSpacedOff, NULL);
|
uiButtonOnClicked(setButton, forceSpacedOff, NULL);
|
||||||
uiStackAdd(stacks[i], getButton, 0);
|
uiStackAppend(stacks[i], getButton, 0);
|
||||||
uiStackAdd(stacks[i], setButton, 0);
|
uiStackAppend(stacks[i], setButton, 0);
|
||||||
setButton = uiNewButton("Show");
|
setButton = uiNewButton("Show");
|
||||||
uiButtonOnClicked(setButton, showSpaced, NULL);
|
uiButtonOnClicked(setButton, showSpaced, NULL);
|
||||||
uiStackAdd(stacks[i], setButton, 0);
|
uiStackAppend(stacks[i], setButton, 0);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
stacks[i] = uiNewHorizontalStack();
|
stacks[i] = uiNewHorizontalStack();
|
||||||
getButton = uiNewButton("Button");
|
getButton = uiNewButton("Button");
|
||||||
uiStackAdd(stacks[i], getButton, 1);
|
uiStackAppend(stacks[i], getButton, 1);
|
||||||
setButton = uiNewButton("Show");
|
setButton = uiNewButton("Show");
|
||||||
uiButtonOnClicked(setButton, showControl, getButton);
|
uiButtonOnClicked(setButton, showControl, getButton);
|
||||||
uiStackAdd(stacks[i], setButton, 0);
|
uiStackAppend(stacks[i], setButton, 0);
|
||||||
setButton = uiNewButton("Hide");
|
setButton = uiNewButton("Hide");
|
||||||
uiButtonOnClicked(setButton, hideControl, getButton);
|
uiButtonOnClicked(setButton, hideControl, getButton);
|
||||||
uiStackAdd(stacks[i], setButton, 0);
|
uiStackAppend(stacks[i], setButton, 0);
|
||||||
setButton = uiNewButton("Enable");
|
setButton = uiNewButton("Enable");
|
||||||
uiButtonOnClicked(setButton, enableControl, getButton);
|
uiButtonOnClicked(setButton, enableControl, getButton);
|
||||||
uiStackAdd(stacks[i], setButton, 0);
|
uiStackAppend(stacks[i], setButton, 0);
|
||||||
setButton = uiNewButton("Disable");
|
setButton = uiNewButton("Disable");
|
||||||
uiButtonOnClicked(setButton, disableControl, getButton);
|
uiButtonOnClicked(setButton, disableControl, getButton);
|
||||||
uiStackAdd(stacks[i], setButton, 0);
|
uiStackAppend(stacks[i], setButton, 0);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
stacks[i] = uiNewHorizontalStack();
|
stacks[i] = uiNewHorizontalStack();
|
||||||
setButton = uiNewButton("Show Stack");
|
setButton = uiNewButton("Show Stack");
|
||||||
uiButtonOnClicked(setButton, showControl, stacks[i - 1]);
|
uiButtonOnClicked(setButton, showControl, stacks[i - 1]);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
setButton = uiNewButton("Hide Stack");
|
setButton = uiNewButton("Hide Stack");
|
||||||
uiButtonOnClicked(setButton, hideControl, stacks[i - 1]);
|
uiButtonOnClicked(setButton, hideControl, stacks[i - 1]);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
setButton = uiNewButton("Enable Stack");
|
setButton = uiNewButton("Enable Stack");
|
||||||
uiButtonOnClicked(setButton, enableControl, stacks[i - 1]);
|
uiButtonOnClicked(setButton, enableControl, stacks[i - 1]);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
setButton = uiNewButton("Disable Stack");
|
setButton = uiNewButton("Disable Stack");
|
||||||
uiButtonOnClicked(setButton, disableControl, stacks[i - 1]);
|
uiButtonOnClicked(setButton, disableControl, stacks[i - 1]);
|
||||||
uiStackAdd(stacks[i], setButton, 1);
|
uiStackAppend(stacks[i], setButton, 1);
|
||||||
uiStackAdd(stacks[0], stacks[i], 0);
|
uiStackAppend(stacks[0], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
uiStackAdd(stacks[0], label, 0);
|
uiStackAppend(stacks[0], label, 0);
|
||||||
|
|
||||||
tab = uiNewTab();
|
tab = uiNewTab();
|
||||||
uiWindowSetChild(w, tab);
|
uiWindowSetChild(w, tab);
|
||||||
|
@ -309,18 +309,18 @@ int main(int argc, char *argv[])
|
||||||
firstStack = stacks[i];
|
firstStack = stacks[i];
|
||||||
getButton = uiNewButton("Move Here");
|
getButton = uiNewButton("Move Here");
|
||||||
uiButtonOnClicked(getButton, moveToFirst, NULL);
|
uiButtonOnClicked(getButton, moveToFirst, NULL);
|
||||||
uiStackAdd(stacks[i], getButton, 0);
|
uiStackAppend(stacks[i], getButton, 0);
|
||||||
movingLabel = uiNewLabel("This label moves!");
|
movingLabel = uiNewLabel("This label moves!");
|
||||||
uiStackAdd(stacks[i], movingLabel, 1);
|
uiStackAppend(stacks[i], movingLabel, 1);
|
||||||
uiStackAdd(stacks[page2stack], stacks[i], 0);;
|
uiStackAppend(stacks[page2stack], stacks[i], 0);;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
stacks[i] = uiNewHorizontalStack();
|
stacks[i] = uiNewHorizontalStack();
|
||||||
secondStack = stacks[i];
|
secondStack = stacks[i];
|
||||||
getButton = uiNewButton("Move Here");
|
getButton = uiNewButton("Move Here");
|
||||||
uiButtonOnClicked(getButton, moveToSecond, NULL);
|
uiButtonOnClicked(getButton, moveToSecond, NULL);
|
||||||
uiStackAdd(stacks[i], getButton, 0);
|
uiStackAppend(stacks[i], getButton, 0);
|
||||||
uiStackAdd(stacks[page2stack], stacks[i], 0);
|
uiStackAppend(stacks[page2stack], stacks[i], 0);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if (i != nStacks) {
|
if (i != nStacks) {
|
||||||
|
|
4
new/ui.h
4
new/ui.h
|
@ -133,8 +133,8 @@ 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 uiStackAppend(uiControl *, uiControl *, int);
|
||||||
void uiStackRemove(uiControl *, uintmax_t);
|
void uiStackDelete(uiControl *, uintmax_t);
|
||||||
int uiStackPadded(uiControl *);
|
int uiStackPadded(uiControl *);
|
||||||
void uiStackSetPadded(uiControl *, int);
|
void uiStackSetPadded(uiControl *, int);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue