Added a test for BListView. There's little layout related to test, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -12,6 +12,7 @@ SimpleTest WidgetLayoutTest :
|
|||||||
CheckBoxTest.cpp
|
CheckBoxTest.cpp
|
||||||
ControlTest.cpp
|
ControlTest.cpp
|
||||||
GroupView.cpp
|
GroupView.cpp
|
||||||
|
ListViewTest.cpp
|
||||||
RadioButton.cpp
|
RadioButton.cpp
|
||||||
StringView.cpp
|
StringView.cpp
|
||||||
Test.cpp
|
Test.cpp
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007, Ingo Weinhold <[email protected]>.
|
||||||
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ListViewTest.h"
|
||||||
|
|
||||||
|
#include <ListView.h>
|
||||||
|
#include <StringItem.h>
|
||||||
|
|
||||||
|
|
||||||
|
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()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007, Ingo Weinhold <[email protected]>.
|
||||||
|
* 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
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "CheckBox.h"
|
#include "CheckBox.h"
|
||||||
#include "CheckBoxTest.h"
|
#include "CheckBoxTest.h"
|
||||||
#include "GroupView.h"
|
#include "GroupView.h"
|
||||||
|
#include "ListViewTest.h"
|
||||||
#include "StringView.h"
|
#include "StringView.h"
|
||||||
#include "Test.h"
|
#include "Test.h"
|
||||||
#include "TwoDimensionalSliderView.h"
|
#include "TwoDimensionalSliderView.h"
|
||||||
@@ -276,6 +277,8 @@ main(int argc, const char* const* argv)
|
|||||||
test = new ButtonTest;
|
test = new ButtonTest;
|
||||||
} else if (strcmp(testName, "checkbox") == 0) {
|
} else if (strcmp(testName, "checkbox") == 0) {
|
||||||
test = new CheckBoxTest;
|
test = new CheckBoxTest;
|
||||||
|
} else if (strcmp(testName, "listview") == 0) {
|
||||||
|
test = new ListViewTest;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Error: Invalid test name: \"%s\"\n", testName);
|
fprintf(stderr, "Error: Invalid test name: \"%s\"\n", testName);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user