コード例 #1
0
ファイル: Wlists.py プロジェクト: mmrvka/xbmc
    def adjust(self, oldbounds):
        self.SetPort()
        # Appearance frames are drawn outside the specified bounds,
        # so we always need to outset the invalidated area.
        self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
        self.GetWindow().InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))

        if oldbounds[:2] == self._bounds[:2]:
            # set visRgn to empty, to prevent nasty drawing side effect of LSize()
            Qd.RectRgn(self._parentwindow.wid.GetWindowPort().visRgn,
                       (0, 0, 0, 0))
            # list still has the same upper/left coordinates, use LSize
            l, t, r, b = self._bounds
            width = r - l - 17
            height = b - t - 2
            vl, vt, vr, vb = self._viewbounds
            self._viewbounds = vl, vt, vl + width, vt + height
            self._list.LSize(width, height)
            # now *why* doesn't the list manager recalc the cellrect???
            l, t, r, b = self._list.LRect((0, 0))
            cellheight = b - t
            self._list.LCellSize((width / self._cols, cellheight))
            # reset visRgn
            self._parentwindow.wid.CalcVis()
        else:
            # oh well, since the list manager doesn't have a LMove call,
            # we have to make the list all over again...
            sel = self.getselection()
            topcell = self.gettopcell()
            self._list = None
            self.setdrawingmode(0)
            self.createlist()
            self.setselection(sel)
            self.settopcell(topcell)
            self.setdrawingmode(1)
コード例 #2
0
 def adjust(self, oldbounds):
     if self._isdefault:
         old = Qd.InsetRect(oldbounds, -4, -4)
         new = Qd.InsetRect(self._bounds, -4, -4)
         Qd.EraseRect(old)
         self.GetWindow().InvalWindowRect(old)
         self.GetWindow().InvalWindowRect(new)
     ControlWidget.adjust(self, oldbounds)
コード例 #3
0
 def adjust(self, oldbounds):
     self.SetPort()
     if self._selected:
         self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
         self.GetWindow().InvalWindowRect(Qd.InsetRect(
             self._bounds, -3, -3))
     else:
         self.GetWindow().InvalWindowRect(oldbounds)
         self.GetWindow().InvalWindowRect(self._bounds)
コード例 #4
0
ファイル: Wwindows.py プロジェクト: mmrvka/xbmc
def windowbounds(preferredsize, minsize=None):
    "Return sensible window bounds"

    global _windowcounter
    if len(preferredsize) == 4:
        bounds = l, t, r, b = preferredsize
        desktopRgn = Win.GetGrayRgn()
        tempRgn = Qd.NewRgn()
        Qd.RectRgn(tempRgn, bounds)
        union = Qd.UnionRgn(tempRgn, desktopRgn, tempRgn)
        equal = Qd.EqualRgn(tempRgn, desktopRgn)
        Qd.DisposeRgn(tempRgn)
        if equal:
            return bounds
        else:
            preferredsize = r - l, b - t
    if not minsize:
        minsize = preferredsize
    minwidth, minheight = minsize
    width, height = preferredsize

    sl, st, sr, sb = screenbounds = Qd.InsetRect(
        Qd.GetQDGlobalsScreenBits().bounds, 4, 4)
    l, t = getnextwindowpos()
    if (l + width) > sr:
        _windowcounter = 0
        l, t = getnextwindowpos()
    r = l + width
    b = t + height
    if (t + height) > sb:
        b = sb
        if (b - t) < minheight:
            b = t + minheight
    return l, t, r, b
コード例 #5
0
 def draw(self, visRgn = None):
     if self._visible:
         Qd.FrameRect(self._bounds)
         Qd.EraseRect(Qd.InsetRect(self._bounds, 1, 1))
         l, t, r, b = self._bounds
         l = l + 2
         t = t + 3
         pictframe = (l, t, l + 10, t + 10)
         Qd.DrawPicture(_arrowright, pictframe)
コード例 #6
0
ファイル: Wlists.py プロジェクト: mmrvka/xbmc
 def draw(self, visRgn=None):
     if self._visible:
         if not visRgn:
             visRgn = self._parentwindow.wid.GetWindowPort().visRgn
         self._list.LUpdate(visRgn)
         state = [kThemeStateActive,
                  kThemeStateInactive][not self._activated]
         App.DrawThemeListBoxFrame(Qd.InsetRect(self._bounds, 1, 1), state)
         if self._selected and self._activated:
             self.drawselframe(1)
コード例 #7
0
 def draw(self, visRgn=None):
     if self._visible:
         l, t, r, b = Qd.InsetRect(self._bounds, 1, 1)
         Qd.RGBForeColor(self._color)
         Qd.PaintRect((l, t, r, b))
         Qd.RGBForeColor(self._darkercolor)
         Qd.MoveTo(l, b)
         Qd.LineTo(r, b)
         Qd.LineTo(r, t)
         Qd.RGBForeColor((0, 0, 0))
コード例 #8
0
ファイル: Wtext.py プロジェクト: mmrvka/xbmc
 def adjust(self, oldbounds):
     self.SetPort()
     # Note: if App.DrawThemeEditTextFrame is ever used, it will be necessary
     # to unconditionally outset the invalidated rectangles, since Appearance
     # frames are drawn outside the bounds.
     if self._selected and self._parentwindow._hasselframes:
         self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
         self.GetWindow().InvalWindowRect(Qd.InsetRect(
             self._bounds, -3, -3))
     else:
         self.GetWindow().InvalWindowRect(oldbounds)
         self.GetWindow().InvalWindowRect(self._bounds)
     viewrect, destrect = self._calctextbounds()
     self.ted.WESetViewRect(viewrect)
     self.ted.WESetDestRect(destrect)
     if self.wrap:
         self.ted.WECalText()
     if self.ted.WEGetDestRect()[3] < viewrect[1]:
         self.selview()
     self.updatescrollbars()
コード例 #9
0
 def draw(self, visRgn=None):
     if self._visible:
         if not visRgn:
             visRgn = self._parentwindow.wid.GetWindowPort().visRgn
         Qd.PenPat(Qd.GetQDGlobalsGray())
         rect = self._bounds
         Qd.FrameRect(rect)
         rect = Qd.InsetRect(rect, 3, 3)
         Qd.PenNormal()
         Qd.RGBForeColor(self._color)
         Qd.PaintRect(rect)
         Qd.RGBForeColor((0, 0, 0))
コード例 #10
0
ファイル: Wlists.py プロジェクト: mmrvka/xbmc
 def setdrawingmode(self, onoff):
     if onoff:
         self.drawingmode = self.drawingmode - 1
         if self.drawingmode == 0 and self._list is not None:
             self._list.LSetDrawingMode(1)
             if self._visible:
                 bounds = l, t, r, b = Qd.InsetRect(self._bounds, 1, 1)
                 cl, ct, cr, cb = self._list.LRect((0, len(self.items) - 1))
                 if cb < b:
                     self.SetPort()
                     Qd.EraseRect((l, cb, cr, b))
                 self._list.LUpdate(
                     self._parentwindow.wid.GetWindowPort().visRgn)
                 self.GetWindow().ValidWindowRect(bounds)
     else:
         if self.drawingmode == 0 and self._list is not None:
             self._list.LSetDrawingMode(0)
         self.drawingmode = self.drawingmode + 1
コード例 #11
0
ファイル: Wtext.py プロジェクト: mmrvka/xbmc
 def _getviewrect(self):
     return Qd.InsetRect(self._bounds, self.inset[0], self.inset[1])