From a85cd05590d7f727e57e7be00182b5724008e624 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Wed, 22 Sep 2010 04:54:11 +0000 Subject: [PATCH] Adjust tests to use the SetExplicitAlignment function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38776 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/libs/alm/Areas.cpp | 25 +++++++++++-------------- src/tests/libs/alm/TableDemo.cpp | 16 +++++++--------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/tests/libs/alm/Areas.cpp b/src/tests/libs/alm/Areas.cpp index 4fb1791ea6..a65ef1557e 100644 --- a/src/tests/libs/alm/Areas.cpp +++ b/src/tests/libs/alm/Areas.cpp @@ -19,6 +19,8 @@ public: button1->SetExplicitMinSize(BSize(0, 0)); button1->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED)); + //button1->SetExplicitAlignment( + //BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); // create a new BALMLayout and use it for this window BALMLayout* layout = new BALMLayout(); @@ -37,25 +39,20 @@ public: a1->SetLeftInset(10); a1->SetRightInset(10); - Area* a2 = layout->AddArea( - layout->Left(), y1, - layout->Right(), y2, - button2); - a2->SetHorizontalAlignment(B_ALIGN_LEFT); + layout->AddArea(layout->Left(), y1, layout->Right(), y2, button2); + button2->SetExplicitAlignment( + BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); - Area* a3 = layout->AddArea( - layout->Left(), y2, - layout->Right(), y3, + Area* a3 = layout->AddArea(layout->Left(), y2, layout->Right(), y3, button3); - a3->SetHorizontalAlignment(B_ALIGN_HORIZONTAL_CENTER); - a3->SetVerticalAlignment(B_ALIGN_VERTICAL_CENTER); + button3->SetExplicitAlignment( + BAlignment(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER)); a3->HasSameHeightAs(a1); - Area* a4 = layout->AddArea( - layout->Left(), y3, - layout->Right(), layout->Bottom(), + layout->AddArea(layout->Left(), y3, layout->Right(), layout->Bottom(), button4); - a4->SetHorizontalAlignment(B_ALIGN_RIGHT); + button4->SetExplicitAlignment( + BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); } private: diff --git a/src/tests/libs/alm/TableDemo.cpp b/src/tests/libs/alm/TableDemo.cpp index f729fa0cd7..f1ae5c549d 100644 --- a/src/tests/libs/alm/TableDemo.cpp +++ b/src/tests/libs/alm/TableDemo.cpp @@ -30,19 +30,17 @@ public: r2->InsertAfter(r1); BButton* b1 = new BButton("A1"); - Area* a1 = layout->AddArea(r1, c1, b1); - a1->SetHorizontalAlignment(B_ALIGN_LEFT); - a1->SetVerticalAlignment(B_ALIGN_TOP); + layout->AddArea(r1, c1, b1); + b1->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); BButton* b2 = new BButton("A2"); - Area* a2 = layout->AddArea(r2, c1, b2); - a2->SetHorizontalAlignment(B_ALIGN_HORIZONTAL_CENTER); - a2->SetVerticalAlignment(B_ALIGN_VERTICAL_CENTER); + layout->AddArea(r2, c1, b2); + b2->SetExplicitAlignment(BAlignment( + B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER)); BButton* b3 = new BButton("A3"); - Area* a3 = layout->AddArea(r3, c1, b3); - a3->SetHorizontalAlignment(B_ALIGN_RIGHT); - a3->SetVerticalAlignment(B_ALIGN_BOTTOM); + layout->AddArea(r3, c1, b3); + b3->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); r2->HasSameHeightAs(r1); r3->HasSameHeightAs(r1);