Beispiel #1
0
    def scrollDraw(self):
        """
        Checks to see if `delta` matches the current positions of the scroll
        bars. If not, `delta` is set to the correct value and `drawView()` is called to
        redraw the scroller.
        """
        d = Point()

        if self._hScrollBar:
            d.x = self._hScrollBar.value
        else:
            d.x = 0

        if self._vScrollBar:
            d.y = self._vScrollBar.value
        else:
            d.y = 0

        if d.x != self.delta.x or d.y != self.delta.y:
            self.setCursor(self.cursor.x + self.delta.x - d.x,
                           self.cursor.y + self.delta.y - d.y)
            self.delta = d
            if self._drawLock:
                self._drawFlag = True
            else:
                self.drawView()
Beispiel #2
0
    def scrollDraw(self):
        d = Point(0, 0)
        d.x = self.hScrollBar.value if self.hScrollBar else 0
        d.y = self.vScrollBar.value if self.vScrollBar else 0

        if d.x != self.delta.x or d.y != self.delta.y:
            info = self.ScrollInfo()
            info.delta = self.delta - d
            info.ignore = self.background
            self.lock()
            try:
                self.forEach(self.doScroll, info)
                self.delta = d
            finally:
                self.unlock()
            self.drawView()