Changeset 394 for ModularSystem/Demo/UMainForm.pas
- Timestamp:
- Jul 31, 2012, 8:53:58 AM (12 years ago)
- Location:
- ModularSystem
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ModularSystem
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
ModularSystem/Demo
- Property svn:ignore
-
old new 2 2 project1.exe 3 3 project1 4 Demo.exe 5 Demo.lps
-
- Property svn:ignore
-
ModularSystem/Demo/UMainForm.pas
r316 r394 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 StdCtrls, Menus, ActnList, UModularSystem , UModuleUser, UModuleBase;9 StdCtrls, Menus, ActnList, UModularSystem; 10 10 11 11 type … … 37 37 Selected: Boolean); 38 38 private 39 { private declarations }39 procedure RegisterModules; 40 40 public 41 41 ModuleManager: TModuleManager; … … 49 49 MainForm: TMainForm; 50 50 51 51 52 implementation 52 53 53 54 {$R *.lfm} 55 56 uses 57 UModuleUser, UModuleBase, UModuleACL; 58 54 59 55 60 { TMainForm } … … 59 64 if (Item.Index >= 0) and (Item.Index < ModuleManager.Modules.Count) then 60 65 with TModule(ModuleManager.Modules[Item.Index]) do begin 61 Item.Caption := Name;66 Item.Caption := Title; 62 67 Item.Data := ModuleManager.Modules[Item.Index]; 68 Item.SubItems.Add(Name); 63 69 Item.SubItems.Add(Version); 64 70 Item.SubItems.Add(InstalledText[Installed]); 65 Item.SubItems.Add(Dependencies.Text); 71 Item.SubItems.Add(License); 72 Item.SubItems.Add(StringReplace(Dependencies.Text, LineEnding, ', ', [rfReplaceAll])); 73 Item.SubItems.Add(StringReplace(Description.Text, LineEnding, ', ', [rfReplaceAll])); 66 74 end; 67 75 end; … … 78 86 end; 79 87 88 procedure TMainForm.RegisterModules; 89 begin 90 ModuleManager.RegisterModule(TModuleUser.Create); 91 ModuleManager.RegisterModule(TModuleBase.Create); 92 ModuleManager.RegisterModule(TModuleACL.Create); 93 end; 94 80 95 procedure TMainForm.RefreshList; 81 96 begin … … 87 102 88 103 procedure TMainForm.FormCreate(Sender: TObject); 89 var90 UserModule: TModuleUser;91 BaseModule: TModuleBase;92 104 begin 93 UserModule := TModuleUser.Create;94 BaseModule := TModuleBase.Create;95 96 105 ModuleManager := TModuleManager.Create; 97 ModuleManager.RegisterModule(UserModule); 98 ModuleManager.RegisterModule(BaseModule); 106 RegisterModules; 99 107 end; 100 108 … … 109 117 if ModuleList.Count > 0 then begin 110 118 if MessageDlg('These modules will be installed in addition to ' + 111 TModule(ListViewModules.Selected.Data).Name + ': ' + ModuleList.Text, 119 TModule(ListViewModules.Selected.Data).Name + ': ' + 120 StringReplace(ModuleList.Text, LineEnding, ', ', [rfReplaceAll]), 112 121 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 113 122 TModule(ListViewModules.Selected.Data).Install; … … 130 139 if ModuleList.Count > 0 then begin 131 140 if MessageDlg('These modules will be uninstalled in addition to ' + 132 TModule(ListViewModules.Selected.Data).Name + ': ' + ModuleList.Text, 141 TModule(ListViewModules.Selected.Data).Name + ': ' + 142 StringReplace(ModuleList.Text, LineEnding, ', ', [rfReplaceAll]), 133 143 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 134 144 TModule(ListViewModules.Selected.Data).Uninstall;
Note:
See TracChangeset
for help on using the changeset viewer.