Changeset 438

Show
Ignore:
Timestamp:
Mon Jun 9 15:49:05 2008
Author:
Brian
Message:

Add IsUIDeletable to indicate which objects should be directly deletable from the UI

Files:

Legend:

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

    r437 r438  
    1955 1955         pass  
    1956 1956  
      1957     def IsUIDeletable(self):  # overriden in subclasses  
      1958         return False  
    1957 1959     def Delete(self):  # overriden in subclasses  
    1958 1960         self.Follow(remove=True)  
     
    2206 2208                     orm_object.RefMode = char  
    2207 2209  
      2210     def IsUIDeletable(self):  # allow user to delete this graphic object  
      2211         return True  
      2212  
    2208 2213     def Delete(self):  
    2209 2214         if self.InDelete: return  
     
    2485 2490                     self.canvas.SetGraphic(dc, f, newid=True)  # create new one  
    2486 2491  
      2492     def IsUIDeletable(self):  # allow user to delete this graphic object  
      2493         return True  
      2494  
    2487 2495     def Delete(self):  
    2488 2496         fact_object = self.Target  
     
    2759 2767                 orm_object.Text = char  
    2760 2768  
      2769     def IsUIDeletable(self):  # allow user to delete this graphic object  
      2770         return True  
      2771  
    2761 2772     def Delete(self):  
    2762 2773         if self.InDelete: return  
     
    2852 2863 ##            h += line_h  
    2853 2864  
      2865     def IsUIDeletable(self):  # allow user to delete this graphic object  
      2866         return True  
      2867  
    2854 2868     def Delete(self):  
    2855 2869         if self.InDelete: return  
     
    2921 2935 ##            h += line_h  
    2922 2936  
      2937     def IsUIDeletable(self):  # allow user to delete this graphic object  
      2938         return True  
      2939  
    2923 2940     def Delete(self):  
    2924 2941         if self.InDelete: return  
     
    3062 3079         dc.SetIdBounds(self.dcid,r)  
    3063 3080  
      3081 ##    def IsUIDeletable(self):  # allow user to delete this graphic object  
      3082 ##        return True  
      3083 ## or handle via menu command  
      3084  
    3064 3085 class ORMNoteConnectorShape(ORMConnector):  
    3065 3086     def Draw(self, dc):  
     
    3094 3115         dc.SetIdBounds(self.dcid,r)  
    3095 3116  
      3117 ##    def IsUIDeletable(self):  # allow user to delete this graphic object  
      3118 ##        return True  
      3119 ## or handle via menu command  
      3120  
    3096 3121 class ORMConstraintConnectorShape(ORMConnector):  
    3097 3122     '''Connects to Fact Type at one or more Role boxes'''  
     
    3206 3231         dc.SetIdBounds(self.dcid,r)  
    3207 3232  
      3233 ##    def IsUIDeletable(self):  # allow user to delete this graphic object  
      3234 ##        return True  
      3235 ## or handle via menu command  
      3236  
    3208 3237 # Register shapes  
    3209 3238 _subtype = {  
     
    4067 4096 ##            return  
    4068 4097  
    4069   ##        if debug: print 'shape subtype is', shape.Subtype  
    4070   ##  
    4071   ##        # can this logic be moved in to the object factory?  
    4072   ##        if shape.Subtype in ('ORMObjectTypeShape'):  
    4073   ##            shape._SetToSubclass(ORMObjectTypeShape)  
    4074   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4075   ##  
    4076   ##        elif shape.Subtype in ('ORMFactTypeShape'):  
    4077   ##            shape._SetToSubclass(ORMFactTypeShape)  
    4078   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4079   ##  
    4080   ##        elif shape.Subtype in ('ORMFactReadingShape'):  
    4081   ##            shape._SetToSubclass(ORMFactReadingShape)  
    4082   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4083   ##            shape.Follow()  
    4084   ##  
    4085   ##        elif shape.Subtype in ('ORMNoteShape'):  
    4086   ##            shape._SetToSubclass(ORMNoteShape)  
    4087   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4088   ##             
    4089   ##        elif shape.Subtype in ('ORMConstraintShape'):  
    4090   ##            shape._SetToSubclass(ORMConstraintShape)  
    4091   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4092   ##  
    4093   ##        elif shape.Subtype in ('ORMConstraintConnectorShape'):  
    4094   ##            shape._SetToSubclass(ORMConstraintConnectorShape)  
    4095   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4096   ##            shape.Follow()  
    4097   ##             
    4098   ##        elif shape.Subtype in ('ORMRoleConnectorShape'):  
    4099   ##            shape._SetToSubclass(ORMRoleConnectorShape)  
    4100   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4101   ##            shape.Follow()  
    4102   ##             
    4103   ##        elif shape.Subtype in ('ORMRoleNameShape'):  
    4104   ##            shape._SetToSubclass(ORMRoleNameShape)  
    4105   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4106   ##            shape.Follow()  
    4107   ##             
    4108   ##        elif shape.Subtype in ('ORMSubtypeConnectorShape'):  
    4109   ##            shape._SetToSubclass(ORMSubtypeConnectorShape)  
    4110   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4111   ##            shape.Follow()  
    4112   ##             
    4113   ##        elif shape.Subtype in ('ORMNoteConnectorShape'):  
    4114   ##            shape._SetToSubclass(ORMNoteConnectorShape)  
    4115   ##            shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4116   ##            shape.Follow()  
    4117    
    4118 4098         shape.SetTempPos(x,y)  # used to avoid lots of updates while moving  
    4119 4099         shape.Follow()