Changeset 15 for trunk/StudioModules/LDModuleProject
- Timestamp:
- Aug 6, 2012, 2:35:22 PM (12 years ago)
- Location:
- trunk/StudioModules/LDModuleProject
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioModules/LDModuleProject/LDModuleProject.lpk
r11 r15 31 31 </Item3> 32 32 </Files> 33 <i18n> 34 <EnableI18N Value="True"/> 35 <OutDir Value="Languages"/> 36 <EnableI18NForLFM Value="True"/> 37 </i18n> 33 38 <Type Value="RunAndDesignTime"/> 34 <RequiredPkgs Count=" 2">39 <RequiredPkgs Count="3"> 35 40 <Item1> 36 <PackageName Value=" LDStudioCommon"/>41 <PackageName Value="Common"/> 37 42 </Item1> 38 43 <Item2> 44 <PackageName Value="LDStudioCommon"/> 45 </Item2> 46 <Item3> 39 47 <PackageName Value="FCL"/> 40 </Item 2>48 </Item3> 41 49 </RequiredPkgs> 42 50 <UsageOptions> -
trunk/StudioModules/LDModuleProject/ULDModuleProject.lfm
r12 r15 1 1 object DataModuleProject: TDataModuleProject 2 OnCreate = DataModuleCreate 2 3 OnDestroy = DataModuleDestroy 3 4 OldCreateOrder = False 4 5 Height = 328 5 HorizontalOffset = 2556 VerticalOffset = 756 HorizontalOffset = 390 7 VerticalOffset = 142 7 8 Width = 409 8 9 object ActionList1: TActionList … … 19 20 object AOpenRecent: TAction 20 21 Caption = 'Open recent' 22 OnExecute = AOpenRecentExecute 21 23 end 22 24 object ASave: TAction … … 46 48 Action = AOpen 47 49 end 48 object MenuItem 3: TMenuItem50 object MenuItemOpenRecent: TMenuItem 49 51 Action = AOpenRecent 50 52 end … … 73 75 top = 120 74 76 end 77 object LastOpenedList1: TLastOpenedList 78 MaxCount = 10 79 OnChange = LastOpenedList1Change 80 left = 125 81 top = 64 82 end 75 83 end -
trunk/StudioModules/LDModuleProject/ULDModuleProject.pas
r14 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, ActnList, Menus, Dialogs, UModularSystem, 9 U Project;9 ULastOpenedList, UProject, URegistry, USource; 10 10 11 11 type … … 22 22 ANew: TAction; 23 23 ActionList1: TActionList; 24 LastOpenedList1: TLastOpenedList; 24 25 MenuItem1: TMenuItem; 25 26 MenuItem2: TMenuItem; 26 MenuItem 3: TMenuItem;27 MenuItemOpenRecent: TMenuItem; 27 28 MenuItem4: TMenuItem; 28 29 MenuItem5: TMenuItem; … … 36 37 procedure ANewExecute(Sender: TObject); 37 38 procedure AOpenExecute(Sender: TObject); 39 procedure AOpenRecentExecute(Sender: TObject); 38 40 procedure AProjectManagerExecute(Sender: TObject); 39 41 procedure ASaveAsExecute(Sender: TObject); 40 42 procedure ASaveExecute(Sender: TObject); 43 procedure DataModuleCreate(Sender: TObject); 41 44 procedure DataModuleDestroy(Sender: TObject); 45 procedure LastOpenedList1Change(Sender: TObject); 42 46 private 43 47 { private declarations } … … 45 49 Project: TProject; 46 50 procedure UpdateInterface; 51 procedure LoadFromRegistry(Context: TRegistryContext); 52 procedure SaveToRegistry(Context: TRegistryContext); 47 53 end; 48 54 … … 51 57 TLDModuleProject = class(TModule) 52 58 private 59 ProjectFileType: TSourceType; 53 60 public 54 61 constructor Create; override; … … 93 100 end; 94 101 102 procedure TDataModuleProject.DataModuleCreate(Sender: TObject); 103 begin 104 105 end; 106 95 107 procedure TDataModuleProject.DataModuleDestroy(Sender: TObject); 96 108 begin 97 109 AClose.Execute; 110 end; 111 112 procedure TDataModuleProject.LastOpenedList1Change(Sender: TObject); 113 begin 114 LastOpenedList1.LoadToMenuItem(MenuItemOpenRecent, AOpenRecentExecute); 98 115 end; 99 116 … … 103 120 ASaveAs.Enabled := Assigned(Project); 104 121 AClose.Enabled := Assigned(Project); 122 end; 123 124 procedure TDataModuleProject.LoadFromRegistry(Context: TRegistryContext); 125 begin 126 LastOpenedList1.LoadFromRegistry(Context.RootKey, Context.Key + '\RecentFile'); 127 end; 128 129 procedure TDataModuleProject.SaveToRegistry(Context: TRegistryContext); 130 begin 131 LastOpenedList1.SaveToRegistry(Context.RootKey, Context.Key + '\RecentFile'); 105 132 end; 106 133 … … 122 149 procedure TDataModuleProject.AOpenExecute(Sender: TObject); 123 150 begin 124 OpenDialog1.FileName := Project.FileName; 151 if Assigned(Project) then 152 OpenDialog1.FileName := Project.FileName; 125 153 if OpenDialog1.Execute then begin 126 154 Project.FileName := OpenDialog1.FileName; … … 128 156 UpdateInterface; 129 157 end; 158 end; 159 160 procedure TDataModuleProject.AOpenRecentExecute(Sender: TObject); 161 begin 162 130 163 end; 131 164 … … 150 183 DataModuleProject.PopupMenu1.Items.Caption := SProject; 151 184 RegisterMainMenuItem(DataModuleProject.PopupMenu1.Items, nil, 1); 185 DataModuleProject.LoadFromRegistry(RegContext(GetRegistryContext.RootKey, 186 GetRegistryContext.Key + '\Project')); 187 DataModuleProject.UpdateInterface; 188 ProjectFileType := TSourceType.Create; 189 ProjectFileType.Extension := '.ldp'; 190 ProjectFileType.Title := 'LibreDevelop project'; 191 RegisterFileType(ProjectFileType); 152 192 end; 153 193 inherited; … … 158 198 inherited; 159 199 with TLDStudioAPI(API) do begin 200 UnregisterFileType(ProjectFileType); 201 DataModuleProject.SaveToRegistry(RegContext(GetRegistryContext.RootKey, 202 GetRegistryContext.Key + '\Project')); 160 203 UnregisterMainMenuItem(DataModuleProject.PopupMenu1.Items); 161 204 FreeAndNil(DataModuleProject); -
trunk/StudioModules/LDModuleProject/UProject.pas
r11 r15 7 7 uses 8 8 Classes, SysUtils, Dialogs, DOM, XMLWrite, XMLRead, FileUtil, 9 SpecializedList ;9 SpecializedList, USource; 10 10 11 11 const … … 71 71 end; 72 72 73 TProject = class 73 TProject = class(TSource) 74 74 private 75 75 FModified: Boolean;
Note:
See TracChangeset
for help on using the changeset viewer.