Removed the uiBox parent stuff from box.c; it's no longer needed (and having the parented check there isn't necessary; it'll be reached eventually).
This commit is contained in:
parent
33d6609675
commit
025b00a6ac
16
redo/box.c
16
redo/box.c
|
@ -7,8 +7,6 @@ struct box {
|
||||||
void (*baseDestroy)(uiControl *);
|
void (*baseDestroy)(uiControl *);
|
||||||
struct ptrArray *controls;
|
struct ptrArray *controls;
|
||||||
int vertical;
|
int vertical;
|
||||||
void (*baseSetParent)(uiControl *, uiControl *);
|
|
||||||
uiControl *parent;
|
|
||||||
int padded;
|
int padded;
|
||||||
void (*baseResize)(uiControl *, intmax_t, intmax_t, intmax_t, intmax_t, uiSizing *);
|
void (*baseResize)(uiControl *, intmax_t, intmax_t, intmax_t, intmax_t, uiSizing *);
|
||||||
};
|
};
|
||||||
|
@ -25,8 +23,6 @@ static void boxDestroy(uiControl *c)
|
||||||
struct box *b = (struct box *) c;
|
struct box *b = (struct box *) c;
|
||||||
struct boxControl *bc;
|
struct boxControl *bc;
|
||||||
|
|
||||||
if (b->parent != NULL)
|
|
||||||
complain("attempt to destroy uiBox %p while it has a parent", b);
|
|
||||||
// don't chain up to base here; we need to destroy children ourselves first
|
// don't chain up to base here; we need to destroy children ourselves first
|
||||||
while (b->controls->len != 0) {
|
while (b->controls->len != 0) {
|
||||||
bc = ptrArrayIndex(b->controls, struct boxControl *, 0);
|
bc = ptrArrayIndex(b->controls, struct boxControl *, 0);
|
||||||
|
@ -41,16 +37,6 @@ static void boxDestroy(uiControl *c)
|
||||||
uiFree(b);
|
uiFree(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void boxSetParent(uiControl *c, uiControl *parent)
|
|
||||||
{
|
|
||||||
struct box *b = (struct box *) c;
|
|
||||||
|
|
||||||
// this does all the actual work
|
|
||||||
(*(b->baseSetParent))(uiControl(b), parent);
|
|
||||||
// we just need to have a copy of the parent ourselves for boxSetPadded()
|
|
||||||
b->parent = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void boxPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height)
|
static void boxPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height)
|
||||||
{
|
{
|
||||||
struct box *b = (struct box *) c;
|
struct box *b = (struct box *) c;
|
||||||
|
@ -277,8 +263,6 @@ uiBox *uiNewHorizontalBox(void)
|
||||||
|
|
||||||
b->baseDestroy = uiControl(b)->Destroy;
|
b->baseDestroy = uiControl(b)->Destroy;
|
||||||
uiControl(b)->Destroy = boxDestroy;
|
uiControl(b)->Destroy = boxDestroy;
|
||||||
b->baseSetParent = uiControl(b)->SetParent;
|
|
||||||
uiControl(b)->SetParent = boxSetParent;
|
|
||||||
uiControl(b)->PreferredSize = boxPreferredSize;
|
uiControl(b)->PreferredSize = boxPreferredSize;
|
||||||
b->baseResize = uiControl(b)->Resize;
|
b->baseResize = uiControl(b)->Resize;
|
||||||
uiControl(b)->Resize = boxResize;
|
uiControl(b)->Resize = boxResize;
|
||||||
|
|
Loading…
Reference in New Issue