Set uiBox to use its own view; BGroupLayout is NOT a view.

This commit is contained in:
Pietro Gagliardi 2015-11-19 09:15:23 -05:00
parent dbea109414
commit 425b1d4fa3
1 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,8 @@ struct boxchild {
struct uiBox {
uiHaikuControl c;
// layouts are not views; all layouts need an associated view
BView *view;
BGroupLayout *layout;
vector<struct boxchild> *controls;
int vertical;
@ -23,7 +25,7 @@ static void onDestroy(uiBox *b);
uiHaikuDefineControlWithOnDestroy(
uiBox, // type name
uiBoxType, // type function
layout, // handle
view, // handle
onDestroy(hthis); // on destroy
)
@ -38,6 +40,7 @@ static void onDestroy(uiBox *b)
b->controls->pop_back();
}
delete b->controls;
// TODO is the layout automatically deleted?
}
static void boxContainerUpdateState(uiControl *c)
@ -123,6 +126,7 @@ static uiBox *finishNewBox(orientation o)
b = (uiBox *) uiNewControl(uiBoxType());
b->layout = new BGroupLayout(o, 0);
b->view = new BView(NULL, B_SUPPORTS_LAYOUT, b->layout);
b->vertical = o == B_VERTICAL;