Changeset 105 for trunk/Packages/ModularSystem/Demo
- Timestamp:
- Oct 9, 2012, 1:58:45 PM (12 years ago)
- Location:
- trunk/Packages/ModularSystem/Demo
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/ModularSystem/Demo
-
Property svn:ignore
set to
lib
Demo.exe
-
Property svn:ignore
set to
-
trunk/Packages/ModularSystem/Demo/Demo.lpi
r89 r105 35 35 <Item1> 36 36 <PackageName Value="ModularSystem"/> 37 <DefaultFilename Value="..\ModularSystem.lpk" Prefer="True"/> 37 38 </Item1> 38 39 <Item2> -
trunk/Packages/ModularSystem/Demo/Demo.lps
r89 r105 2 2 <CONFIG> 3 3 <ProjectSession> 4 <PathDelim Value="\"/> 4 5 <Version Value="9"/> 5 6 <BuildModes Active="Default"/> 6 <Units Count=" 5">7 <Units Count="6"> 7 8 <Unit0> 8 9 <Filename Value="Demo.lpr"/> 9 10 <IsPartOfProject Value="True"/> 10 11 <UnitName Value="Demo"/> 11 <UsageCount Value="2 0"/>12 <UsageCount Value="22"/> 12 13 </Unit0> 13 14 <Unit1> … … 18 19 <ResourceBaseClass Value="Form"/> 19 20 <UnitName Value="UMainForm"/> 20 < IsVisibleTab Value="True"/>21 < EditorIndex Value="1"/>22 < WindowIndex Value="0"/>23 < TopLine Value="87"/>24 < CursorPos X="46" Y="105"/>25 < UsageCount Value="20"/>26 <Loaded Value="True"/>21 <EditorIndex Value="4"/> 22 <WindowIndex Value="0"/> 23 <TopLine Value="61"/> 24 <CursorPos X="37" Y="76"/> 25 <UsageCount Value="22"/> 26 <Loaded Value="True"/> 27 <LoadedDesigner Value="True"/> 27 28 </Unit1> 28 29 <Unit2> … … 30 31 <IsPartOfProject Value="True"/> 31 32 <UnitName Value="UModuleUser"/> 32 <UsageCount Value="20"/> 33 <EditorIndex Value="2"/> 34 <WindowIndex Value="0"/> 35 <TopLine Value="13"/> 36 <CursorPos X="17" Y="26"/> 37 <UsageCount Value="22"/> 38 <Loaded Value="True"/> 33 39 </Unit2> 34 40 <Unit3> … … 36 42 <IsPartOfProject Value="True"/> 37 43 <UnitName Value="UModuleBase"/> 38 <UsageCount Value="20"/> 44 <IsVisibleTab Value="True"/> 45 <EditorIndex Value="1"/> 46 <WindowIndex Value="0"/> 47 <TopLine Value="10"/> 48 <CursorPos X="40" Y="17"/> 49 <UsageCount Value="22"/> 50 <Loaded Value="True"/> 39 51 </Unit3> 40 52 <Unit4> … … 45 57 <WindowIndex Value="0"/> 46 58 <TopLine Value="1"/> 47 <CursorPos X=" 36" Y="4"/>48 <UsageCount Value="2 0"/>59 <CursorPos X="17" Y="14"/> 60 <UsageCount Value="22"/> 49 61 <Loaded Value="True"/> 50 62 </Unit4> 63 <Unit5> 64 <Filename Value="..\UModularSystem.pas"/> 65 <UnitName Value="UModularSystem"/> 66 <EditorIndex Value="3"/> 67 <WindowIndex Value="0"/> 68 <TopLine Value="117"/> 69 <CursorPos X="1" Y="133"/> 70 <UsageCount Value="11"/> 71 <Loaded Value="True"/> 72 </Unit5> 51 73 </Units> 52 74 <General> 53 75 <ActiveWindowIndexAtStart Value="0"/> 54 76 </General> 55 <JumpHistory Count=" 1" HistoryIndex="0">77 <JumpHistory Count="29" HistoryIndex="28"> 56 78 <Position1> 57 <Filename Value="UM ainForm.pas"/>58 <Caret Line="1 " Column="1" TopLine="1"/>79 <Filename Value="UModuleUser.pas"/> 80 <Caret Line="13" Column="51" TopLine="10"/> 59 81 </Position1> 82 <Position2> 83 <Filename Value="UModuleUser.pas"/> 84 <Caret Line="15" Column="23" TopLine="2"/> 85 </Position2> 86 <Position3> 87 <Filename Value="UModuleBase.pas"/> 88 <Caret Line="13" Column="31" TopLine="10"/> 89 </Position3> 90 <Position4> 91 <Filename Value="UModuleBase.pas"/> 92 <Caret Line="12" Column="43" TopLine="1"/> 93 </Position4> 94 <Position5> 95 <Filename Value="UModuleACL.pas"/> 96 <Caret Line="13" Column="29" TopLine="1"/> 97 </Position5> 98 <Position6> 99 <Filename Value="UModuleACL.pas"/> 100 <Caret Line="14" Column="43" TopLine="1"/> 101 </Position6> 102 <Position7> 103 <Filename Value="UMainForm.pas"/> 104 <Caret Line="14" Column="39" TopLine="1"/> 105 </Position7> 106 <Position8> 107 <Filename Value="UMainForm.pas"/> 108 <Caret Line="92" Column="54" TopLine="77"/> 109 </Position8> 110 <Position9> 111 <Filename Value="UMainForm.pas"/> 112 <Caret Line="71" Column="23" TopLine="54"/> 113 </Position9> 114 <Position10> 115 <Filename Value="UMainForm.pas"/> 116 <Caret Line="46" Column="7" TopLine="33"/> 117 </Position10> 118 <Position11> 119 <Filename Value="UMainForm.pas"/> 120 <Caret Line="71" Column="35" TopLine="57"/> 121 </Position11> 122 <Position12> 123 <Filename Value="UMainForm.pas"/> 124 <Caret Line="72" Column="35" TopLine="58"/> 125 </Position12> 126 <Position13> 127 <Filename Value="UMainForm.pas"/> 128 <Caret Line="74" Column="35" TopLine="60"/> 129 </Position13> 130 <Position14> 131 <Filename Value="UMainForm.pas"/> 132 <Caret Line="137" Column="3" TopLine="135"/> 133 </Position14> 134 <Position15> 135 <Filename Value="UMainForm.pas"/> 136 <Caret Line="138" Column="3" TopLine="136"/> 137 </Position15> 138 <Position16> 139 <Filename Value="UMainForm.pas"/> 140 <Caret Line="139" Column="3" TopLine="137"/> 141 </Position16> 142 <Position17> 143 <Filename Value="UMainForm.pas"/> 144 <Caret Line="140" Column="3" TopLine="138"/> 145 </Position17> 146 <Position18> 147 <Filename Value="UMainForm.pas"/> 148 <Caret Line="35" Column="15" TopLine="22"/> 149 </Position18> 150 <Position19> 151 <Filename Value="UMainForm.pas"/> 152 <Caret Line="40" Column="15" TopLine="25"/> 153 </Position19> 154 <Position20> 155 <Filename Value="UMainForm.pas"/> 156 <Caret Line="95" Column="77" TopLine="86"/> 157 </Position20> 158 <Position21> 159 <Filename Value="UMainForm.pas"/> 160 <Caret Line="98" Column="65" TopLine="76"/> 161 </Position21> 162 <Position22> 163 <Filename Value="..\UModularSystem.pas"/> 164 <Caret Line="183" Column="1" TopLine="164"/> 165 </Position22> 166 <Position23> 167 <Filename Value="..\UModularSystem.pas"/> 168 <Caret Line="237" Column="33" TopLine="220"/> 169 </Position23> 170 <Position24> 171 <Filename Value="..\UModularSystem.pas"/> 172 <Caret Line="183" Column="1" TopLine="170"/> 173 </Position24> 174 <Position25> 175 <Filename Value="..\UModularSystem.pas"/> 176 <Caret Line="233" Column="1" TopLine="220"/> 177 </Position25> 178 <Position26> 179 <Filename Value="..\UModularSystem.pas"/> 180 <Caret Line="130" Column="1" TopLine="117"/> 181 </Position26> 182 <Position27> 183 <Filename Value="..\UModularSystem.pas"/> 184 <Caret Line="131" Column="1" TopLine="117"/> 185 </Position27> 186 <Position28> 187 <Filename Value="..\UModularSystem.pas"/> 188 <Caret Line="132" Column="1" TopLine="117"/> 189 </Position28> 190 <Position29> 191 <Filename Value="..\UModularSystem.pas"/> 192 <Caret Line="133" Column="1" TopLine="117"/> 193 </Position29> 60 194 </JumpHistory> 61 195 </ProjectSession> 62 <EditorMacros Count="0"/> 196 <Debugging> 197 <BreakPoints Count="1"> 198 <Item1> 199 <Kind Value="bpkSource"/> 200 <WatchScope Value="wpsLocal"/> 201 <WatchKind Value="wpkWrite"/> 202 <Source Value="..\UModularSystem.pas"/> 203 <Line Value="233"/> 204 </Item1> 205 </BreakPoints> 206 </Debugging> 63 207 </CONFIG> -
trunk/Packages/ModularSystem/Demo/UMainForm.lfm
r89 r105 10 10 OnDestroy = FormDestroy 11 11 OnShow = FormShow 12 LCLVersion = '1. 1'12 LCLVersion = '1.0.1.3' 13 13 object ListViewModules: TListView 14 14 Left = 8 … … 30 30 end 31 31 item 32 Caption = 'State' 32 Caption = 'Installed' 33 Width = 80 34 end 35 item 36 Caption = 'Running' 33 37 Width = 80 34 38 end … … 80 84 TabOrder = 3 81 85 end 86 object ButtonUpdate1: TButton 87 Left = 248 88 Height = 25 89 Top = 281 90 Width = 75 91 Action = AModuleStart 92 Anchors = [akLeft, akBottom] 93 TabOrder = 4 94 end 95 object ButtonUpdate2: TButton 96 Left = 328 97 Height = 25 98 Top = 281 99 Width = 75 100 Action = AModuleStop 101 Anchors = [akLeft, akBottom] 102 TabOrder = 5 103 end 82 104 object PopupMenu1: TPopupMenu 83 105 left = 183 … … 92 114 Action = AModuleUpdate 93 115 end 116 object MenuItem4: TMenuItem 117 Action = AModuleStart 118 end 119 object MenuItem5: TMenuItem 120 Action = AModuleStop 121 end 94 122 end 95 123 object ActionList1: TActionList 96 left = 1 3797 top = 1 65124 left = 184 125 top = 136 98 126 object AModuleInstall: TAction 99 127 Caption = 'Install' … … 108 136 OnExecute = ButtonUpdateClick 109 137 end 138 object AModuleStart: TAction 139 Caption = 'Start' 140 OnExecute = AModuleStartExecute 141 end 142 object AModuleStop: TAction 143 Caption = 'Stop' 144 OnExecute = AModuleStopExecute 145 end 110 146 end 111 147 end -
trunk/Packages/ModularSystem/Demo/UMainForm.pas
r89 r105 15 15 TMainForm = class(TForm) 16 16 published 17 AModuleStart: TAction; 18 AModuleStop: TAction; 17 19 AModuleInstall: TAction; 18 20 AModuleUninstall: TAction; … … 22 24 ButtonUninstall: TButton; 23 25 ButtonInstall: TButton; 26 ButtonUpdate1: TButton; 27 ButtonUpdate2: TButton; 24 28 ListViewModules: TListView; 25 29 MenuItem1: TMenuItem; 26 30 MenuItem2: TMenuItem; 27 31 MenuItem3: TMenuItem; 32 MenuItem4: TMenuItem; 33 MenuItem5: TMenuItem; 28 34 PopupMenu1: TPopupMenu; 35 procedure AModuleStartExecute(Sender: TObject); 36 procedure AModuleStopExecute(Sender: TObject); 29 37 procedure ButtonInstallClick(Sender: TObject); 30 38 procedure ButtonUninstallClick(Sender: TObject); … … 44 52 45 53 const 46 InstalledText: array[Boolean] of string = ('Not installed', 'Installed');54 BoolText: array[Boolean] of string = ('No', 'Yes'); 47 55 48 56 var … … 66 74 Item.Caption := Title; 67 75 Item.Data := ModuleManager.Modules[Item.Index]; 68 Item.SubItems.Add( Name);76 Item.SubItems.Add(Identification); 69 77 Item.SubItems.Add(Version); 70 Item.SubItems.Add(InstalledText[Installed]); 78 Item.SubItems.Add(BoolText[Installed]); 79 Item.SubItems.Add(BoolText[Running]); 71 80 Item.SubItems.Add(License); 72 81 Item.SubItems.Add(StringReplace(Dependencies.Text, LineEnding, ', ', [rfReplaceAll])); … … 79 88 var 80 89 Installed: Boolean; 90 Running: Boolean; 81 91 begin 82 92 if Assigned(ListViewModules.Selected) then Installed := TModule(ListViewModules.Selected.Data).Installed; 93 if Assigned(ListViewModules.Selected) then Running := TModule(ListViewModules.Selected.Data).Running; 83 94 AModuleInstall.Enabled := Assigned(ListViewModules.Selected) and not Installed; 84 95 AModuleUninstall.Enabled := Assigned(ListViewModules.Selected) and Installed; 85 96 AModuleUpdate.Enabled := Assigned(ListViewModules.Selected) and Installed; 97 AModuleStart.Enabled := Assigned(ListViewModules.Selected) and not Running; 98 AModuleStop.Enabled := Assigned(ListViewModules.Selected) and Running; 86 99 end; 87 100 88 101 procedure TMainForm.RegisterModules; 89 102 begin 90 ModuleManager.RegisterModule(TModuleUser.Create );91 ModuleManager.RegisterModule(TModuleBase.Create );92 ModuleManager.RegisterModule(TModuleACL.Create );103 ModuleManager.RegisterModule(TModuleUser.Create(nil)); 104 ModuleManager.RegisterModule(TModuleBase.Create(nil)); 105 ModuleManager.RegisterModule(TModuleACL.Create(nil)); 93 106 end; 94 107 … … 129 142 end; 130 143 144 procedure TMainForm.AModuleStartExecute(Sender: TObject); 145 var 146 ModuleList: TStringList; 147 begin 148 if Assigned(ListViewModules.Selected) then begin 149 try 150 ModuleList := TStringList.Create; 151 TModule(ListViewModules.Selected.Data).EnumModulesStart(ModuleList); 152 if ModuleList.Count > 0 then begin 153 if MessageDlg('These modules will be started in addition to ' + 154 TModule(ListViewModules.Selected.Data).Name + ': ' + 155 StringReplace(ModuleList.Text, LineEnding, ', ', [rfReplaceAll]), 156 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 157 TModule(ListViewModules.Selected.Data).Start; 158 end else TModule(ListViewModules.Selected.Data).Start; 159 finally 160 ModuleList.Free; 161 end; 162 RefreshList; 163 end; 164 end; 165 166 procedure TMainForm.AModuleStopExecute(Sender: TObject); 167 var 168 ModuleList: TStringList; 169 begin 170 if Assigned(ListViewModules.Selected) then begin 171 try 172 ModuleList := TStringList.Create; 173 TModule(ListViewModules.Selected.Data).EnumModulesStop(ModuleList); 174 if ModuleList.Count > 0 then begin 175 if MessageDlg('These modules will be stopped in addition to ' + 176 TModule(ListViewModules.Selected.Data).Name + ': ' + 177 StringReplace(ModuleList.Text, LineEnding, ', ', [rfReplaceAll]), 178 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 179 TModule(ListViewModules.Selected.Data).Stop; 180 end else TModule(ListViewModules.Selected.Data).Stop; 181 finally 182 ModuleList.Free; 183 end; 184 185 RefreshList; 186 end; 187 end; 188 131 189 procedure TMainForm.ButtonUninstallClick(Sender: TObject); 132 190 var … … 155 213 begin 156 214 if Assigned(ListViewModules.Selected) then begin 157 TModule(ListViewModules.Selected.Data).Up date;215 TModule(ListViewModules.Selected.Data).Upgrade; 158 216 RefreshList; 159 217 end; … … 162 220 procedure TMainForm.FormDestroy(Sender: TObject); 163 221 begin 164 ModuleManager.Free;222 FreeAndNil(ModuleManager); 165 223 end; 166 224 -
trunk/Packages/ModularSystem/Demo/UModuleACL.pas
r89 r105 12 12 13 13 TModuleACL = class(TModule) 14 constructor Create ; override;14 constructor Create(AOwner: TComponent); override; 15 15 destructor Destroy; override; 16 16 end; … … 21 21 { TModuleACL } 22 22 23 constructor TModuleACL.Create ;23 constructor TModuleACL.Create(AOwner: TComponent); 24 24 begin 25 25 inherited; 26 Name:= 'UserACL';26 Identification := 'UserACL'; 27 27 Title := 'User ACL'; 28 28 Version := '1.0'; -
trunk/Packages/ModularSystem/Demo/UModuleBase.pas
r89 r105 10 10 type 11 11 TModuleBase = class(TModule) 12 constructor Create ; override;12 constructor Create(AOwner: TComponent); override; 13 13 destructor Destroy; override; 14 14 end; … … 19 19 { TModuleUser } 20 20 21 constructor TModuleBase.Create ;21 constructor TModuleBase.Create(AOwner: TComponent); 22 22 begin 23 23 inherited; 24 Name:= 'Base';24 Identification := 'Base'; 25 25 Title := 'Base'; 26 26 Version := '1.0'; -
trunk/Packages/ModularSystem/Demo/UModuleUser.pas
r89 r105 13 13 14 14 TModuleUser = class(TModule) 15 constructor Create ; override;15 constructor Create(AOwner: TComponent); override; 16 16 destructor Destroy; override; 17 17 end; … … 21 21 { TModuleUser } 22 22 23 constructor TModuleUser.Create ;23 constructor TModuleUser.Create(AOwner: TComponent); 24 24 begin 25 25 inherited; 26 Name:= 'User';26 Identification := 'User'; 27 27 Title := 'User'; 28 28 Version := '1.0';
Note:
See TracChangeset
for help on using the changeset viewer.