Now also checks the SetTarget() functionality.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6668 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-02-20 21:29:01 +00:00
parent 52bb9b2d33
commit b14df7ac85

View File

@ -141,14 +141,24 @@ KnobWindow::KnobWindow(bool horiz, bool vert)
}
BView *view = new BView(frame, "main view", B_FOLLOW_ALL, B_WILL_DRAW);
view->SetViewColor(200, 200, 21);
BScrollView *scroller = new BScrollView("scroller", view, B_FOLLOW_ALL, 0, horiz, vert);
AddChild(scroller);
// check the SetTarget() functionality
BView *outer = new BView(frame, "main view", B_FOLLOW_ALL, B_WILL_DRAW);
outer->SetViewColor(200, 200, 21);
BView *inner = new BView(frame.OffsetToCopy(B_ORIGIN).InsetBySelf(3, 3),
"inner", B_FOLLOW_ALL, B_WILL_DRAW);
inner->SetViewColor(200, 42, 42);
view->AddChild(inner);
outer->AddChild(inner);
BScrollView *scroller = new BScrollView("scroller", view, B_FOLLOW_ALL, 0, horiz, vert);
AddChild(scroller);
scroller->RemoveChild(view);
// works with and without it
scroller->SetTarget(NULL);
scroller->SetTarget(outer);
delete view;
gNumWindows++;
}