Exemplo n.º 1
0
 def do_update(self, wid, event):
     region = wid.GetWindowPort().visRgn
     if Qd.EmptyRgn(region):
         return
     Qd.EraseRgn(region)
     self.ted.WEUpdate(region)
     self.updatescrollbars()
Exemplo n.º 2
0
 def _render_overlaprgn(self, rect):
     """Return true if there is an overlap between the current rendering region and the rect"""
     if not self._render_cliprgn:
         # Always draw if we have no clipping region (probably just-cloned displaylist)
         return 1
     r2 = self._tmprgn
     Qd.RectRgn(r2, rect)
     Qd.SectRgn(self._render_cliprgn, r2, r2)
     empty = Qd.EmptyRgn(r2)
     return not empty
Exemplo n.º 3
0
 def _can_render_now(self):
     """Return true if we can do the render now, in stead of
     scheduling the update event"""
     # First check that no update events are pending.
     window = self._window
     if window._transition:
         return 0
     rgn = Qd.NewRgn()
     window._onscreen_wid.GetWindowUpdateRgn(rgn)
     ok = Qd.EmptyRgn(rgn)
     # Next check that we're topmost
     if ok:
         ok = window._is_on_top()
     Qd.DisposeRgn(rgn)
     return ok
Exemplo n.º 4
0
 def do_update(self):
     if self.must_clear:
         self._clear_html()
     visregion = self.wid.GetWindowPort().visRgn
     myregion = Qd.NewRgn()
     Qd.RectRgn(myregion, self.rect)  # or is it self.ted.WEGetViewRect() ?
     Qd.SectRgn(myregion, visregion, myregion)
     # Waste doesn't honour the clipping region, do it ourselves
     clipregion = Qd.NewRgn()
     Qd.GetClip(clipregion)
     Qd.SectRgn(myregion, clipregion, myregion)
     if Qd.EmptyRgn(myregion):
         return
     Qd.RGBBackColor(self.bg_color)
     Qd.RGBForeColor((0, 0xffff, 0))  # DBG
     Qd.EraseRgn(visregion)
     self.ted.WEUpdate(myregion)
Exemplo n.º 5
0
# A minimal text editor.
Exemplo n.º 6
0
# A minimal text editor.