Changeset 9
- Timestamp:
- Apr 1, 2016, 8:25:11 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UFormMain.lfm
r8 r9 285 285 OnExecute = AFileOpenExecute 286 286 end 287 object AFileSave: TAction 288 Caption = 'Save' 289 OnExecute = AFileSaveExecute 290 end 287 291 end 288 292 object OpenDialog1: TOpenDialog … … 302 306 Action = AFileOpen 303 307 end 308 object MenuItem9: TMenuItem 309 Action = AFileSave 310 end 304 311 object MenuItem3: TMenuItem 305 312 Action = AFileSaveAs -
trunk/UFormMain.pas
r8 r9 15 15 TFormMain = class(TForm) 16 16 ABrowseDisk: TAction; 17 AFileSave: TAction; 17 18 AFileOpen: TAction; 18 19 AFileSaveAs: TAction; … … 59 60 MenuItem7: TMenuItem; 60 61 MenuItem8: TMenuItem; 62 MenuItem9: TMenuItem; 61 63 OpenDialog1: TOpenDialog; 62 64 SaveDialog1: TSaveDialog; … … 67 69 procedure AFileOpenExecute(Sender: TObject); 68 70 procedure AFileSaveAsExecute(Sender: TObject); 71 procedure AFileSaveExecute(Sender: TObject); 69 72 procedure AScanOptionsExecute(Sender: TObject); 70 73 procedure AScanStartExecute(Sender: TObject); … … 106 109 UFormProject; 107 110 111 resourcestring 112 SProjectModified = '(modified)'; 113 108 114 { TFormMain } 109 115 … … 112 118 LoadConfig; 113 119 if FileExists(LastProjectFileName) then 114 ProjectOpen(LastProjectFileName); 115 Redraw; 116 UpdateInterface; 120 ProjectOpen(LastProjectFileName) 121 else begin 122 Redraw; 123 UpdateInterface; 124 end; 117 125 end; 118 126 … … 148 156 DriveScan.WritePattern := StrToInt(EditPattern.Text); 149 157 DriveScan.Start; 158 Project.Modified := True; 150 159 UpdateInterface; 151 160 end; … … 189 198 Project.SaveToFile(SaveDialog1.FileName); 190 199 end; 200 end; 201 202 procedure TFormMain.AFileSaveExecute(Sender: TObject); 203 begin 204 if not FileExists(Project.FileName) then 205 AFileSaveAs.Execute 206 else Project.SaveToFile(Project.FileName); 191 207 end; 192 208 … … 255 271 256 272 procedure TFormMain.UpdateInterface; 273 var 274 Title: string; 257 275 begin 258 276 if Assigned(DriveScan) then begin … … 260 278 AScanStop.Enabled := DriveScan.Terminated = False; 261 279 end; 280 AFileSave.Enabled := Assigned(Project) and Project.Modified; 281 AFileSaveAs.Enabled := Assigned(Project); 282 283 Title := ''; 284 if Assigned(Project) then 285 Title := Title + Project.FileName + ' - '; 286 Title := Title + Application.Title; 287 if Assigned(Project) and Project.Modified then 288 Title := Title + ' ' + SProjectModified; 289 Caption := Title; 262 290 end; 263 291 … … 283 311 Project.LoadFromFile(FileName); 284 312 LastProjectFileName := FileName; 313 UpdateInterface; 314 Redraw; 285 315 end; 286 316 -
trunk/UProject.pas
r7 r9 71 71 Doc.Free; 72 72 end; 73 Modified := False; 73 74 end; 74 75 … … 79 80 NewNode: TDOMNode; 80 81 begin 82 Modified := False; 81 83 Self.FileName := FileName; 82 84 ReadXMLFile(Doc, FileName);
Note:
See TracChangeset
for help on using the changeset viewer.