Changeset 409

Show
Ignore:
Timestamp:
Thu May 22 13:50:34 2008
Author:
Brian
Message:

Prevent duplicate pseudo dc graphics when diagram is first opened

Files:

Legend:

Unmodified
Added
Removed
Modified
  • ganttpv/trunk/ORM.py

    r407 r409  
    3119 3119  
    3120 3120     def SetGraphic(self, dc, shape):  
    3121           id = wx.NewId()  
    3122           # need to remember which dc id belongs to which shape  
    3123           # can't store in object, must be in the graphics window -- WRONG!  
    3124   #        self.shapeid_to_dcid_xref[shape.ID] = id  # convert to 'shape.dcid' instead  
    3125           shape._SetInShell('dcid', id)  
    3126           shape._SetInShell('canvas', self)  
    3127           self.dcid_to_shape_xref[id] = shape  
    3128           shape.Draw(dc)  
    3129           self.objids.append(id)  
      3121         if self != shape.canvas or not shape.dcid:  
      3122             id = wx.NewId()  
      3123             # need to remember which dc id belongs to which shape  
      3124             # can't store in object, must be in the graphics window -- WRONG!  
      3125     #        self.shapeid_to_dcid_xref[shape.ID] = id  # convert to 'shape.dcid' instead  
      3126             shape._SetInShell('dcid', id)  
      3127             shape._SetInShell('canvas', self)  
      3128             self.dcid_to_shape_xref[id] = shape  
      3129             shape.Draw(dc)  
      3130             self.objids.append(id)  
    3130 3131  
    3131 3132     def CreateNode(self, dc, shape):  # create graphics node for existing model object  
     
    3135 3136         '''  
    3136 3137         if debug: print '--> creating node for ', shape  
      3138         shape._SetInShell('canvas', self)  # needed for followers  
    3137 3139  
    3138 3140 ##        # add methods to shape object  
     
    4071 4073         # report_object = db.GetObject('Report', self.ReportID)  
    4072 4074         # report_object = self.Report  
    4073           db = self.Report.db  
    4074           shapes = [ db.GetObject('GraphicObject', x) for x in Data.SearchByColumn(db.Database['GraphicObject'], {'ReportID': self.ReportID}) ]  
      4075 ##        db = self.Report.db  
      4076 ##        shapes = [ db.GetObject('GraphicObject', x) for x in Data.SearchByColumn(db.Database['GraphicObject'], {'ReportID': self.ReportID}) ]  
    4075 4077         #shapes = [ report_object.db.GetObject('ReportRow', x) for x in Data.GetRowList(self.ReportID) ]  
      4078         shapes = self.Report.GetList('GraphicObject')  
    4076 4079         if debug:  
    4077 4080             print "-- these are all of the shapes -- len=%s" % len(shapes)  
     
    5579 5582 ###Data.orm = FlatNotebookDemo(None, sys.stdout)  
    5580 5583 ###Data.orm.Show(True)  
    5581   ##  
      5584 ##