/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/view.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/view.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1284 by jonathan, Fri Jun 20 17:46:45 2003 UTC revision 1285 by jonathan, Mon Jun 23 10:30:53 2003 UTC
# Line 19  import os.path Line 19  import os.path
19    
20  from math import hypot  from math import hypot
21    
22  from wxPython.wx import wxWindow, wxYield,\  from wxPython.wx import wxWindow, \
23       wxPaintDC, wxColour, wxClientDC, wxINVERT, wxTRANSPARENT_BRUSH, wxFont,\       wxPaintDC, wxColour, wxClientDC, wxINVERT, wxTRANSPARENT_BRUSH, wxFont,\
24       EVT_PAINT, EVT_LEFT_DOWN, EVT_LEFT_UP, EVT_MOTION, EVT_LEAVE_WINDOW, \       EVT_PAINT, EVT_LEFT_DOWN, EVT_LEFT_UP, EVT_MOTION, EVT_LEAVE_WINDOW, \
25       wxBITMAP_TYPE_XPM, wxCursor, wxImageFromBitmap, wxPlatform       wxBITMAP_TYPE_XPM, wxCursor, wxImageFromBitmap, wxPlatform, \
26         wxBeginBusyCursor, wxEndBusyCursor
27    
28    
29  # Export related stuff  # Export related stuff
30  if wxPlatform == '__WXMSW__':  if wxPlatform == '__WXMSW__':
# Line 43  from Thuban.Model.label import ALIGN_CEN Line 45  from Thuban.Model.label import ALIGN_CEN
45  from Thuban.Lib.connector import Publisher  from Thuban.Lib.connector import Publisher
46  from Thuban.Model.color import Color  from Thuban.Model.color import Color
47    
 from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor  
   
48  import resource  import resource
49    
50  from selection import Selection  from selection import Selection
# Line 381  class MapCanvas(wxWindow, Publisher): Line 381  class MapCanvas(wxWindow, Publisher):
381    
382      def OnPaint(self, event):      def OnPaint(self, event):
383          dc = wxPaintDC(self)          dc = wxPaintDC(self)
384    
385          clear = self.map is None or not self.map.HasLayers()          clear = self.map is None or not self.map.HasLayers()
386    
387          ThubanBeginBusyCursor()          wxBeginBusyCursor()
388          try:          try:
389              if not clear:              if not clear:
390                  self.do_redraw()                  self.do_redraw()
391                  try:              else:
                     pass  
                 except:  
                     print "Error during drawing:", sys.exc_info()[0]  
                     clear = True  
   
             if clear:  
392                  # If we've got no map or if the map is empty, simply clear                  # If we've got no map or if the map is empty, simply clear
393                  # the screen.                  # the screen.
394    
# Line 405  class MapCanvas(wxWindow, Publisher): Line 400  class MapCanvas(wxWindow, Publisher):
400                  dc.Clear()                  dc.Clear()
401                  dc.EndDrawing()                  dc.EndDrawing()
402          finally:          finally:
403              ThubanEndBusyCursor()              wxEndBusyCursor()
404    
405      def do_redraw(self):      def do_redraw(self):
406          # This should only be called if we have a non-empty map.          # This should only be called if we have a non-empty map.

Legend:
Removed from v.1284  
changed lines
  Added in v.1285

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26