2 * Copyright 2007-2008, Christof Lutteroth, lutteroth@cs.auckland.ac.nz
3 * Copyright 2007-2008, James Kim, jkim202@ec.auckland.ac.nz
4 * Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
5 * Copyright 2012, Haiku, Inc.
6 * Distributed under the terms of the MIT License.
9 #include <Application.h>
11 #include <LayoutBuilder.h>
15 // include this for ALM
16 #include "ALMLayout.h"
19 class NestedLayoutWindow
: public BWindow
{
21 NestedLayoutWindow(BRect frame
)
23 BWindow(frame
, "ALM Nested Layout", B_TITLED_WINDOW
,
24 B_QUIT_ON_WINDOW_CLOSE
| B_AUTO_UPDATE_SIZE_LIMITS
)
26 button1
= new BButton("There should be space above this button!");
28 fLayout
= new BALMLayout();
29 BLayoutBuilder::Group
<>(this, B_VERTICAL
, 0)
34 // add an area containing the button
35 // use the borders of the layout as the borders for the area
36 fLayout
->AddView(button1
, fLayout
->Left(), fLayout
->Top(),
37 fLayout
->Right(), fLayout
->Bottom());
38 button1
->SetExplicitMinSize(BSize(0, 50));
39 button1
->SetExplicitMaxSize(BSize(500, 500));
40 button1
->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH
,
41 B_ALIGN_USE_FULL_HEIGHT
));
50 class NestedLayout
: public BApplication
{
54 BApplication("application/x-vnd.haiku.NestedLayout")
57 frameRect
.Set(100, 100, 300, 300);
58 NestedLayoutWindow
* window
= new NestedLayoutWindow(frameRect
);