1 #include <Application.h>
9 class AreasWindow
: public BWindow
{
11 AreasWindow(BRect frame
)
13 BWindow(frame
, "ALM Areas", B_TITLED_WINDOW
, B_QUIT_ON_WINDOW_CLOSE
)
15 button1
= new BButton("1");
16 button2
= new BButton("2");
17 button3
= new BButton("3");
18 button4
= new BButton("4");
20 button1
->SetExplicitMinSize(BSize(0, 0));
21 button1
->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED
, B_SIZE_UNLIMITED
));
23 // create a new BALMLayout and use it for this window
24 BALMLayout
* layout
= new BALMLayout(6);
28 BReference
<YTab
> y1
= layout
->AddYTab();
29 BReference
<YTab
> y2
= layout
->AddYTab();
30 BReference
<YTab
> y3
= layout
->AddYTab();
32 Area
* a1
= layout
->AddView(button1
, layout
->Left(), layout
->Top(),
36 a1
->SetRightInset(10);
38 layout
->AddView(button2
, layout
->Left(), y1
, layout
->Right(), y2
);
39 button2
->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT
, B_ALIGN_TOP
));
41 Area
* a3
= layout
->AddView(button3
, layout
->Left(), y2
, layout
->Right(),
43 button3
->SetExplicitAlignment(BAlignment(B_ALIGN_HORIZONTAL_CENTER
,
44 B_ALIGN_VERTICAL_CENTER
));
47 layout
->AddView(button4
, layout
->Left(), y3
, layout
->Right(),
49 button4
->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT
,
53 BSize min
= layout
->MinSize();
54 BSize max
= layout
->MaxSize();
55 SetSizeLimits(min
.Width(), max
.Width(), min
.Height(), max
.Height());
66 class Areas
: public BApplication
{
70 BApplication("application/x-vnd.haiku.Areas")
73 frameRect
.Set(100, 100, 300, 300);
74 AreasWindow
* window
= new AreasWindow(frameRect
);