diff --git a/src/tests/kits/interface/layout/widget_layout_test/Jamfile b/src/tests/kits/interface/layout/widget_layout_test/Jamfile index 1ea6e3b143..8092018bf7 100644 --- a/src/tests/kits/interface/layout/widget_layout_test/Jamfile +++ b/src/tests/kits/interface/layout/widget_layout_test/Jamfile @@ -12,6 +12,7 @@ SimpleTest WidgetLayoutTest : CheckBoxTest.cpp ControlTest.cpp GroupView.cpp + ListViewTest.cpp RadioButton.cpp StringView.cpp Test.cpp diff --git a/src/tests/kits/interface/layout/widget_layout_test/ListViewTest.cpp b/src/tests/kits/interface/layout/widget_layout_test/ListViewTest.cpp new file mode 100644 index 0000000000..318ad12aca --- /dev/null +++ b/src/tests/kits/interface/layout/widget_layout_test/ListViewTest.cpp @@ -0,0 +1,24 @@ +/* + * Copyright 2007, Ingo Weinhold . + * All rights reserved. Distributed under the terms of the MIT License. + */ + +#include "ListViewTest.h" + +#include +#include + + +ListViewTest::ListViewTest() + : Test("ListView", NULL), + fListView(new BListView(BRect(0, 0, -1, -1), NULL)) +{ + SetView(fListView); + + // add a view items + for (int32 i = 0; i < 15; i++) { + BString itemText("list item "); + itemText << i; + fListView->AddItem(new BStringItem(itemText.String())); + } +} diff --git a/src/tests/kits/interface/layout/widget_layout_test/ListViewTest.h b/src/tests/kits/interface/layout/widget_layout_test/ListViewTest.h new file mode 100644 index 0000000000..513335830d --- /dev/null +++ b/src/tests/kits/interface/layout/widget_layout_test/ListViewTest.h @@ -0,0 +1,24 @@ +/* + * Copyright 2007, Ingo Weinhold . + * All rights reserved. Distributed under the terms of the MIT License. + */ +#ifndef WIDGET_LAYOUT_TEST_LIST_VIEW_TEST_H +#define WIDGET_LAYOUT_TEST_LIST_VIEW_TEST_H + + +#include "Test.h" + + +class BListView; + + +class ListViewTest : public Test { +public: + ListViewTest(); + +private: + BListView* fListView; +}; + + +#endif // WIDGET_LAYOUT_TEST_LIST_VIEW_TEST_H diff --git a/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp b/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp index c93f706053..5492dfb1a0 100644 --- a/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp +++ b/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp @@ -13,6 +13,7 @@ #include "CheckBox.h" #include "CheckBoxTest.h" #include "GroupView.h" +#include "ListViewTest.h" #include "StringView.h" #include "Test.h" #include "TwoDimensionalSliderView.h" @@ -276,6 +277,8 @@ main(int argc, const char* const* argv) test = new ButtonTest; } else if (strcmp(testName, "checkbox") == 0) { test = new CheckBoxTest; + } else if (strcmp(testName, "listview") == 0) { + test = new ListViewTest; } else { fprintf(stderr, "Error: Invalid test name: \"%s\"\n", testName); exit(1);