Set uiBox to use its own view; BGroupLayout is NOT a view.
This commit is contained in:
parent
dbea109414
commit
425b1d4fa3
|
@ -12,6 +12,8 @@ struct boxchild {
|
||||||
|
|
||||||
struct uiBox {
|
struct uiBox {
|
||||||
uiHaikuControl c;
|
uiHaikuControl c;
|
||||||
|
// layouts are not views; all layouts need an associated view
|
||||||
|
BView *view;
|
||||||
BGroupLayout *layout;
|
BGroupLayout *layout;
|
||||||
vector<struct boxchild> *controls;
|
vector<struct boxchild> *controls;
|
||||||
int vertical;
|
int vertical;
|
||||||
|
@ -23,7 +25,7 @@ static void onDestroy(uiBox *b);
|
||||||
uiHaikuDefineControlWithOnDestroy(
|
uiHaikuDefineControlWithOnDestroy(
|
||||||
uiBox, // type name
|
uiBox, // type name
|
||||||
uiBoxType, // type function
|
uiBoxType, // type function
|
||||||
layout, // handle
|
view, // handle
|
||||||
onDestroy(hthis); // on destroy
|
onDestroy(hthis); // on destroy
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -38,6 +40,7 @@ static void onDestroy(uiBox *b)
|
||||||
b->controls->pop_back();
|
b->controls->pop_back();
|
||||||
}
|
}
|
||||||
delete b->controls;
|
delete b->controls;
|
||||||
|
// TODO is the layout automatically deleted?
|
||||||
}
|
}
|
||||||
|
|
||||||
static void boxContainerUpdateState(uiControl *c)
|
static void boxContainerUpdateState(uiControl *c)
|
||||||
|
@ -123,6 +126,7 @@ static uiBox *finishNewBox(orientation o)
|
||||||
b = (uiBox *) uiNewControl(uiBoxType());
|
b = (uiBox *) uiNewControl(uiBoxType());
|
||||||
|
|
||||||
b->layout = new BGroupLayout(o, 0);
|
b->layout = new BGroupLayout(o, 0);
|
||||||
|
b->view = new BView(NULL, B_SUPPORTS_LAYOUT, b->layout);
|
||||||
|
|
||||||
b->vertical = o == B_VERTICAL;
|
b->vertical = o == B_VERTICAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue