The scrollbars need to be constructed before calling

BView::TargetedByScrollView(), otherwise the target view couldn't
access them in that method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34186 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2009-11-22 16:04:59 +00:00
parent 3e7194892b
commit 4ce4d86bc9

View File

@ -681,6 +681,18 @@ BScrollView::_Init(bool horizontal, bool vertical)
if (be_control_look != NULL)
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
if (horizontal) {
fHorizontalScrollBar = new BScrollBar(BRect(0, 0, 14, 14), "_HSB_",
fTarget, 0, 1000, B_HORIZONTAL);
AddChild(fHorizontalScrollBar);
}
if (vertical) {
fVerticalScrollBar = new BScrollBar(BRect(0, 0, 14, 14), "_VSB_",
fTarget, 0, 1000, B_VERTICAL);
AddChild(fVerticalScrollBar);
}
BRect targetFrame;
if (fTarget) {
// layout target and add it
@ -705,18 +717,6 @@ BScrollView::_Init(bool horizontal, bool vertical)
}
}
if (horizontal) {
fHorizontalScrollBar = new BScrollBar(BRect(0, 0, 14, 14), "_HSB_",
fTarget, 0, 1000, B_HORIZONTAL);
AddChild(fHorizontalScrollBar);
}
if (vertical) {
fVerticalScrollBar = new BScrollBar(BRect(0, 0, 14, 14), "_VSB_",
fTarget, 0, 1000, B_VERTICAL);
AddChild(fVerticalScrollBar);
}
_AlignScrollBars(horizontal, vertical, targetFrame);
fPreviousWidth = uint16(Bounds().Width());