[haiku-commits] r34186 - haiku/trunk/src/kits/interface

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 22 Nov 2009 17:04:59 +0100 (CET)

Author: jackburton
Date: 2009-11-22 17:04:59 +0100 (Sun, 22 Nov 2009)
New Revision: 34186
Changeset: http://dev.haiku-os.org/changeset/34186/haiku

Modified:
   haiku/trunk/src/kits/interface/ScrollView.cpp
Log:
The scrollbars need to be constructed before calling
BView::TargetedByScrollView(), otherwise the target view couldn't
access them in that method.


Modified: haiku/trunk/src/kits/interface/ScrollView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ScrollView.cpp       2009-11-22 15:17:22 UTC 
(rev 34185)
+++ haiku/trunk/src/kits/interface/ScrollView.cpp       2009-11-22 16:04:59 UTC 
(rev 34186)
@@ -681,6 +681,18 @@
        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 @@
                }
        }
 
-       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());


Other related posts:

  • » [haiku-commits] r34186 - haiku/trunk/src/kits/interface - stefano . ceccherini