Changeset 12
- Timestamp:
- Aug 3, 2012, 3:17:28 PM (12 years ago)
- Location:
- trunk/StudioModules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioModules/LDModuleDebug/ULDModuleDebug.pas
r11 r12 47 47 Identification := 'Debug'; 48 48 Title := SDebug; 49 Version := '0.1'; 50 License := 'GNU/LGPLv3'; 49 51 end; 50 52 -
trunk/StudioModules/LDModulePascal/ULDModulePascal.pas
r11 r12 38 38 Title := SPascal; 39 39 Version := '0.1'; 40 License := 'GNU/LGPLv3'; 40 41 end; 41 42 -
trunk/StudioModules/LDModuleProject/ULDModuleProject.lfm
r11 r12 1 1 object DataModuleProject: TDataModuleProject 2 OnDestroy = DataModuleDestroy 2 3 OldCreateOrder = False 3 4 Height = 328 … … 7 8 object ActionList1: TActionList 8 9 left = 208 9 top = 17 610 top = 171 10 11 object ANew: TAction 11 12 Caption = 'New' 13 OnExecute = ANewExecute 12 14 end 13 15 object AOpen: TAction 14 16 Caption = 'Open...' 17 OnExecute = AOpenExecute 15 18 end 16 19 object AOpenRecent: TAction … … 19 22 object ASave: TAction 20 23 Caption = 'Save' 24 OnExecute = ASaveExecute 21 25 end 22 26 object ASaveAs: TAction 23 27 Caption = 'Save as...' 28 OnExecute = ASaveAsExecute 24 29 end 25 30 object AClose: TAction 26 31 Caption = 'Close' 32 OnExecute = ACloseExecute 27 33 end 28 34 object AProjectManager: TAction 29 35 Caption = 'Project manager' 36 OnExecute = AProjectManagerExecute 30 37 end 31 38 end … … 58 65 end 59 66 end 67 object OpenDialog1: TOpenDialog 68 left = 125 69 top = 120 70 end 71 object SaveDialog1: TSaveDialog 72 left = 208 73 top = 120 74 end 60 75 end -
trunk/StudioModules/LDModuleProject/ULDModuleProject.pas
r11 r12 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, ActnList, Menus, UModularSystem; 8 Classes, SysUtils, FileUtil, ActnList, Menus, Dialogs, UModularSystem, 9 UProject; 9 10 10 11 type … … 29 30 MenuItem7: TMenuItem; 30 31 MenuItem8: TMenuItem; 32 OpenDialog1: TOpenDialog; 31 33 PopupMenu1: TPopupMenu; 34 SaveDialog1: TSaveDialog; 35 procedure ACloseExecute(Sender: TObject); 36 procedure ANewExecute(Sender: TObject); 37 procedure AOpenExecute(Sender: TObject); 38 procedure AProjectManagerExecute(Sender: TObject); 39 procedure ASaveAsExecute(Sender: TObject); 40 procedure ASaveExecute(Sender: TObject); 41 procedure DataModuleDestroy(Sender: TObject); 32 42 private 33 43 { private declarations } 34 44 public 35 { public declarations } 45 Project: TProject; 46 procedure UpdateInterface; 36 47 end; 37 48 … … 58 69 SProject = 'Project'; 59 70 71 { TDataModuleProject } 72 73 procedure TDataModuleProject.AProjectManagerExecute(Sender: TObject); 74 begin 75 FormProject.Show; 76 end; 77 78 procedure TDataModuleProject.ASaveAsExecute(Sender: TObject); 79 begin 80 SaveDialog1.FileName := Project.FileName; 81 if SaveDialog1.Execute then begin 82 Project.FileName := SaveDialog1.FileName; 83 Project.Save; 84 UpdateInterface; 85 end; 86 end; 87 88 procedure TDataModuleProject.ASaveExecute(Sender: TObject); 89 begin 90 if Project.Modified then ASaveAs.Execute 91 else Project.Save; 92 UpdateInterface; 93 end; 94 95 procedure TDataModuleProject.DataModuleDestroy(Sender: TObject); 96 begin 97 AClose.Execute; 98 end; 99 100 procedure TDataModuleProject.UpdateInterface; 101 begin 102 ASave.Enabled := Assigned(Project) and Project.Modified; 103 ASaveAs.Enabled := Assigned(Project); 104 AClose.Enabled := Assigned(Project); 105 end; 106 107 procedure TDataModuleProject.ACloseExecute(Sender: TObject); 108 begin 109 if Project.Modified then ASaveAs.Execute; 110 FreeAndNil(Project); 111 UpdateInterface; 112 end; 113 114 procedure TDataModuleProject.ANewExecute(Sender: TObject); 115 begin 116 Project := TProject.Create; 117 UpdateInterface; 118 end; 119 120 procedure TDataModuleProject.AOpenExecute(Sender: TObject); 121 begin 122 OpenDialog1.FileName := Project.FileName; 123 if OpenDialog1.Execute then begin 124 Project.FileName := OpenDialog1.FileName; 125 Project.Load; 126 UpdateInterface; 127 end; 128 end; 129 60 130 { TLDModuleProject } 61 131 … … 74 144 DataModuleProject := TDataModuleProject.Create(nil); 75 145 FormProject := TFormProject.Create(nil); 146 FormProject.API := TLDStudioAPI(API); 76 147 DataModuleProject.PopupMenu1.Items.Caption := SProject; 77 148 RegisterMainMenuItem(DataModuleProject.PopupMenu1.Items, nil, 1);
Note:
See TracChangeset
for help on using the changeset viewer.