Changeset 130 for branches/generator/UGrammer.pas
- Timestamp:
- Dec 24, 2017, 11:13:05 AM (7 years ago)
- Location:
- branches/generator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator
- Property svn:ignore
-
old new 1 generator 1 2 generator.exe 2 3 generator.lps 3 4 lib 4 5 heaptrclog.trc 6 Generated
-
- Property svn:ignore
-
branches/generator/UGrammer.pas
r129 r130 113 113 private 114 114 FModified: Boolean; 115 FOnChange: TNotifyEvent; 116 FOnDestroy: TNotifyEvent; 115 117 procedure SetModified(AValue: Boolean); 118 procedure DoChange; 119 procedure DoDestroy; 116 120 public 117 121 FileName: string; … … 125 129 procedure GetUsedByRule(RefRule: TRule; UsedByRules: TStrings); 126 130 function GetString: string; 131 procedure Change; 127 132 property Modified: Boolean read FModified write SetModified; 133 property OnChange: TNotifyEvent read FOnChange write FOnChange; 134 property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; 128 135 end; 129 136 … … 141 148 if FModified = AValue then Exit; 142 149 FModified := AValue; 150 if AValue then DoChange; 151 end; 152 153 procedure TGrammer.DoChange; 154 begin 155 if Assigned(FOnChange) then FOnChange(Self); 156 end; 157 158 procedure TGrammer.DoDestroy; 159 begin 160 if Assigned(FOnDestroy) then FOnDestroy(Self); 143 161 end; 144 162 … … 165 183 end; 166 184 finally 167 Doc.Free;185 FreeAndNil(Doc); 168 186 end; 169 187 … … 195 213 Modified := False; 196 214 finally 197 Doc.Free;215 FreeAndNil(Doc); 198 216 end; 199 217 end; … … 213 231 destructor TGrammer.Destroy; 214 232 begin 233 DoDestroy; 215 234 FreeAndNil(Rules); 216 235 inherited Destroy; … … 229 248 begin 230 249 Result := Rules.GetString; 250 end; 251 252 procedure TGrammer.Change; 253 begin 254 DoChange; 231 255 end; 232 256
Note:
See TracChangeset
for help on using the changeset viewer.