2 * Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
3 * Distributed under the terms of the MIT License.
8 #include <Application.h>
13 // include this for ALM
14 #include "ALMLayout.h"
15 #include "ALMLayoutBuilder.h"
18 class ThreeButtonsWindow
: public BWindow
{
20 ThreeButtonsWindow(BRect frame
)
22 BWindow(frame
, "ALM Three Buttons", B_TITLED_WINDOW
,
23 B_QUIT_ON_WINDOW_CLOSE
)
25 BButton
* button1
= new BButton("A");
26 BButton
* button2
= new BButton("B");
27 BButton
* button3
= new BButton("C");
29 button1
->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH
,
30 B_ALIGN_USE_FULL_HEIGHT
));
31 button1
->SetExplicitMaxSize(BSize(500, 50));
33 button2
->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH
,
34 B_ALIGN_USE_FULL_HEIGHT
));
35 button2
->SetExplicitMaxSize(BSize(500, 500));
37 button3
->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH
,
38 B_ALIGN_USE_FULL_HEIGHT
));
39 button3
->SetExplicitMaxSize(BSize(500, 500));
41 fLayout
= new BALMLayout(0, 0);
42 BALM::BALMLayoutBuilder(this, fLayout
)
43 .Add(button1
, fLayout
->Left(), fLayout
->Top(), fLayout
->Right())
46 .AddBelow(button3
, fLayout
->Bottom());
49 BSize min
= fLayout
->MinSize();
50 BSize max
= fLayout
->MaxSize();
51 SetSizeLimits(min
.Width(), max
.Width(), min
.Height(), max
.Height());
63 BApplication
app("application/x-vnd.haiku.ThreeButtons");
66 frameRect
.Set(100, 100, 600, 300);
67 ThreeButtonsWindow
* window
= new ThreeButtonsWindow(frameRect
);