コード例 #1
0
ファイル: scroller.py プロジェクト: gabbpuy/vindauga
    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()
コード例 #2
0
ファイル: scroll_group.py プロジェクト: gabbpuy/vindauga
    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()