[haiku-commits] r42524 - haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker

  • From: alex@xxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 31 Jul 2011 22:39:15 +0200 (CEST)

Author: aldeck
Date: 2011-07-31 22:39:15 +0200 (Sun, 31 Jul 2011)
New Revision: 42524
Changeset: https://dev.haiku-os.org/changeset/42524

Modified:
   haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.cpp
   haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.h
Log:
* Re-enabled autoscrolling, was standing in the way during the rewrite.
* Simplified conditional call to BScrollbar::SetValue() vs BView::ScrollBy().
  Looking at the source, simply calling BView::ScrollBy() will behave correctly
  in both cases. Quick tests apparently confirms this.
  If i recall correctly R5 could go into a loop and needed such workaround, but
  hopefully that was fixed in Haiku.


Modified: 
haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.cpp
===================================================================
--- 
haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.cpp    
    2011-07-31 18:11:26 UTC (rev 42523)
+++ 
haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.cpp    
    2011-07-31 20:39:15 UTC (rev 42524)
@@ -869,8 +869,8 @@
        // update item count view in window if necessary
        Controller()->ItemCountChanged(CountItems());
 
-       //if (fAutoScrollState != kAutoScrollOff)
-       //      HandleAutoScroll();
+       if (fAutoScrollState != kAutoScrollOff)
+               HandleAutoScroll();
 
        // do we need to update scrollbars?
        // TODO: send a ExtentChanged "event" to the controllerView instead of 
polling
@@ -9131,8 +9131,7 @@
 }
 
 
-// TODO
-/*bool
+bool
 BPoseView::CheckAutoScroll(BPoint mouseLoc, bool shouldScroll)
 {
        if (!fShouldAutoScroll)
@@ -9172,13 +9171,8 @@
 
                if (keepGoing) {
                        wouldScroll = true;
-                       if (shouldScroll) {
-                               if (fVScrollBar != NULL) {
-                                       fVScrollBar->SetValue(
-                                               fVScrollBar->Value() - 
scrollIncrement);
-                               } else
-                                       ScrollBy(0, -scrollIncrement);
-                       }
+                       if (shouldScroll)
+                               ScrollBy(0, -scrollIncrement);
                }
        }
 
@@ -9199,13 +9193,8 @@
 
                if (keepGoing) {
                        wouldScroll = true;
-                       if (shouldScroll) {
-                               if (fVScrollBar != NULL) {
-                                       fVScrollBar->SetValue(
-                                               fVScrollBar->Value() + 
scrollIncrement);
-                               } else
-                                       ScrollBy(0, scrollIncrement);
-                       }
+                       if (shouldScroll)
+                               ScrollBy(0, scrollIncrement);
                }
        }
 
@@ -9226,13 +9215,8 @@
 
                if (keepGoing) {
                        wouldScroll = true;
-                       if (shouldScroll) {
-                               if (fHScrollBar != NULL) {
-                                       fHScrollBar->SetValue(
-                                               fHScrollBar->Value() - 
scrollIncrement);
-                               } else
-                                       ScrollBy(-scrollIncrement, 0);
-                       }
+                       if (shouldScroll)
+                               ScrollBy(-scrollIncrement, 0);
                }
        }
 
@@ -9253,13 +9237,8 @@
 
                if (keepGoing) {
                        wouldScroll = true;
-                       if (shouldScroll) {
-                               if (fHScrollBar != NULL) {
-                                       fHScrollBar->SetValue(
-                                               fHScrollBar->Value() + 
scrollIncrement);
-                               } else
-                                       ScrollBy(scrollIncrement, 0);
-                       }
+                       if (shouldScroll)
+                               ScrollBy(scrollIncrement, 0);
                }
        }
 
@@ -9307,7 +9286,7 @@
                        CheckAutoScroll(mouseLoc, true);
                        break;
        }
-}*/
+}
 
 
 BRect

Modified: 
haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.h
===================================================================
--- haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.h  
2011-07-31 18:11:26 UTC (rev 42523)
+++ haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker/PoseView.h  
2011-07-31 20:39:15 UTC (rev 42524)
@@ -56,7 +56,6 @@
 #include <FilePanel.h>
 #include <MessageRunner.h>
 #include <String.h>
-#include <ScrollBar.h>
 #include <View.h>
 #include <hash_set>
 #include <set>
@@ -590,9 +589,9 @@
                // view drawing
                void SynchronousUpdate(BRect, bool clip = false);
 
-               // scrolling
-               //void HandleAutoScroll();
-               //bool CheckAutoScroll(BPoint mouseLoc, bool shouldScroll);
+               // auto scrolling
+               void HandleAutoScroll();
+               bool CheckAutoScroll(BPoint mouseLoc, bool shouldScroll);
 
                // view extent handling
                void RecalcExtent();


Other related posts:

  • » [haiku-commits] r42524 - haiku/branches/developer/aldeck/tracker_layout/src/kits/tracker - alex