diff --git a/src/tests/libs/alm/Areas.cpp b/src/tests/libs/alm/Areas.cpp index a0446fea74..526a50d405 100644 --- a/src/tests/libs/alm/Areas.cpp +++ b/src/tests/libs/alm/Areas.cpp @@ -29,25 +29,23 @@ public: YTab* y2 = layout->AddYTab(); YTab* y3 = layout->AddYTab(); - Area* a1 = layout->AddArea( - layout->Left(), layout->Top(), - layout->Right(), y1, - button1); + Area* a1 = layout->AddView(button1, layout->Left(), layout->Top(), + layout->Right(), y1); a1->SetTopInset(10); a1->SetLeftInset(10); a1->SetRightInset(10); - layout->AddArea(layout->Left(), y1, layout->Right(), y2, button2); + layout->AddView(button2, layout->Left(), y1, layout->Right(), y2); button2->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); - Area* a3 = layout->AddArea(layout->Left(), y2, layout->Right(), y3, - button3); + Area* a3 = layout->AddView(button3, layout->Left(), y2, layout->Right(), + y3); button3->SetExplicitAlignment(BAlignment(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER)); a3->SetHeightAs(a1); - layout->AddArea(layout->Left(), y3, layout->Right(), layout->Bottom(), - button4); + layout->AddView(button4, layout->Left(), y3, layout->Right(), + layout->Bottom()); button4->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); } diff --git a/src/tests/libs/alm/HelloWorld.cpp b/src/tests/libs/alm/HelloWorld.cpp index 02b0f0f93a..3edbc561af 100644 --- a/src/tests/libs/alm/HelloWorld.cpp +++ b/src/tests/libs/alm/HelloWorld.cpp @@ -29,8 +29,8 @@ public: // add an area containing the button // use the borders of the layout as the borders for the area - fLayout->AddArea(fLayout->Left(), fLayout->Top(), fLayout->Right(), - fLayout->Bottom(), button1); + fLayout->AddView(button1, fLayout->Left(), fLayout->Top(), + fLayout->Right(), fLayout->Bottom()); button1->SetExplicitMinSize(BSize(0, 50)); button1->SetExplicitMaxSize(BSize(500, 500)); button1->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, diff --git a/src/tests/libs/alm/Pinwheel.cpp b/src/tests/libs/alm/Pinwheel.cpp index 3613dc5eb9..5013edb240 100644 --- a/src/tests/libs/alm/Pinwheel.cpp +++ b/src/tests/libs/alm/Pinwheel.cpp @@ -49,16 +49,33 @@ public: YTab* y1 = layout->AddYTab(); YTab* y2 = layout->AddYTab(); - Area* a1 = layout->AddArea(layout->Left(), layout->Top(), x2, y1, - button1); - layout->AddArea(x2, layout->Top(), layout->Right(), y2, button2); - Area* a3 = layout->AddArea(x1, y2, layout->Right(), layout->Bottom(), - button3); - layout->AddArea(layout->Left(), y1, x1, layout->Bottom(), button4); - layout->AddArea(x1, y1, x2, y2, textView1); + Area* a1 = layout->AddView(button1, layout->Left(), layout->Top(), x2, + y1); + layout->AddView(button2, x2, layout->Top(), layout->Right(), y2); + Area* a3 = layout->AddView(button3, x1, y2, layout->Right(), + layout->Bottom()); + layout->AddView(button4, layout->Left(), y1, x1, layout->Bottom()); + layout->AddView(textView1, x1, y1, x2, y2); a1->SetWidthAs(a3); a1->SetHeightAs(a3); + + // alternative setup + /* + layout->AddView(button1); + Area* a1 = layout->AreaOf(button1); + Area* a2 = layout->AddViewToRight(button2, a1, layout->Right(), NULL, + layout->AddYTab()); + Area* a3 = layout->AddViewToBottom(button3, a2, layout->Bottom(), + layout->AddXTab(), NULL); + Area* a4 = layout->AddViewToLeft(button4, a3, layout->Left(), + a1->Bottom()); + + layout->AddView(textView1, a4->Right(), a1->Bottom(), a2->Left(), + a3->Top()); + a1->SetWidthAs(a3); + a1->SetHeightAs(a3); + */ } private: diff --git a/src/tests/libs/alm/TableDemo.cpp b/src/tests/libs/alm/TableDemo.cpp index f1ae5c549d..c07f3eb3a7 100644 --- a/src/tests/libs/alm/TableDemo.cpp +++ b/src/tests/libs/alm/TableDemo.cpp @@ -30,16 +30,16 @@ public: r2->InsertAfter(r1); BButton* b1 = new BButton("A1"); - layout->AddArea(r1, c1, b1); + layout->AddView(b1, r1, c1); b1->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); BButton* b2 = new BButton("A2"); - layout->AddArea(r2, c1, b2); + layout->AddView(b2, r2, c1); b2->SetExplicitAlignment(BAlignment( B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER)); BButton* b3 = new BButton("A3"); - layout->AddArea(r3, c1, b3); + layout->AddView(b3, r3, c1); b3->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); r2->HasSameHeightAs(r1); diff --git a/src/tests/libs/alm/TwoViews.cpp b/src/tests/libs/alm/TwoViews.cpp index 6be2a97167..e195cf063e 100644 --- a/src/tests/libs/alm/TwoViews.cpp +++ b/src/tests/libs/alm/TwoViews.cpp @@ -34,10 +34,10 @@ public: // create an extra tab XTab* x1 = layout->AddXTab(); - layout->AddArea(layout->Left(), layout->Top(), x1, layout->Bottom(), - button1); - layout->AddArea(x1, layout->Top(), layout->Right(), layout->Bottom(), - textView1); + layout->AddView(button1, layout->Left(), layout->Top(), x1, + layout->Bottom()); + layout->AddView(textView1, x1, layout->Top(), layout->Right(), + layout->Bottom()); // add a constraint: 2*x1 == right // i.e. x1 is in the middle of the layout