Changeset 2
- Timestamp:
- Feb 2, 2011, 11:31:12 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FreePascalManager.lpi
r1 r2 35 35 </Item1> 36 36 </RequiredPackages> 37 <Units Count=" 5">37 <Units Count="7"> 38 38 <Unit0> 39 39 <Filename Value="FreePascalManager.lpr"/> 40 40 <IsPartOfProject Value="True"/> 41 41 <UnitName Value="FreePascalManager"/> 42 <UsageCount Value="2 0"/>42 <UsageCount Value="22"/> 43 43 </Unit0> 44 44 <Unit1> … … 48 48 <ResourceBaseClass Value="Form"/> 49 49 <UnitName Value="UMainForm"/> 50 <IsVisibleTab Value="True"/> 50 51 <EditorIndex Value="0"/> 51 52 <WindowIndex Value="0"/> 52 <TopLine Value="1 "/>53 <CursorPos X=" 86" Y="14"/>54 <UsageCount Value="2 0"/>53 <TopLine Value="117"/> 54 <CursorPos X="45" Y="122"/> 55 <UsageCount Value="22"/> 55 56 <Loaded Value="True"/> 56 57 <LoadedDesigner Value="True"/> … … 59 60 <Filename Value="UOptions.pas"/> 60 61 <IsPartOfProject Value="True"/> 61 <ComponentName Value=" Form2"/>62 <ComponentName Value="OptionsForm"/> 62 63 <ResourceBaseClass Value="Form"/> 63 64 <UnitName Value="UOptions"/> … … 65 66 <WindowIndex Value="0"/> 66 67 <TopLine Value="1"/> 67 <CursorPos X=" 1" Y="1"/>68 <UsageCount Value="2 0"/>68 <CursorPos X="3" Y="9"/> 69 <UsageCount Value="22"/> 69 70 <Loaded Value="True"/> 70 71 <LoadedDesigner Value="True"/> … … 74 75 <IsPartOfProject Value="True"/> 75 76 <UnitName Value="UInstance"/> 76 <IsVisibleTab Value="True"/>77 77 <EditorIndex Value="2"/> 78 78 <WindowIndex Value="0"/> 79 <TopLine Value=" 1"/>80 <CursorPos X=" 29" Y="8"/>81 <UsageCount Value="2 0"/>79 <TopLine Value="23"/> 80 <CursorPos X="3" Y="44"/> 81 <UsageCount Value="22"/> 82 82 <Loaded Value="True"/> 83 83 </Unit3> … … 88 88 <EditorIndex Value="3"/> 89 89 <WindowIndex Value="0"/> 90 <TopLine Value="1 "/>91 <CursorPos X=" 23" Y="17"/>92 <UsageCount Value="2 0"/>90 <TopLine Value="16"/> 91 <CursorPos X="1" Y="40"/> 92 <UsageCount Value="22"/> 93 93 <Loaded Value="True"/> 94 94 </Unit4> 95 <Unit5> 96 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\fpc\2.5.1\source\rtl\objpas\classes\classesh.inc"/> 97 <WindowIndex Value="0"/> 98 <TopLine Value="1670"/> 99 <CursorPos X="14" Y="1683"/> 100 <UsageCount Value="11"/> 101 </Unit5> 102 <Unit6> 103 <Filename Value="E:\Programy\Lazarus\0.9.31_2.5.1\lcl\lclclasses.pp"/> 104 <UnitName Value="LCLClasses"/> 105 <WindowIndex Value="0"/> 106 <TopLine Value="5"/> 107 <CursorPos X="20" Y="47"/> 108 <UsageCount Value="10"/> 109 </Unit6> 95 110 </Units> 96 <JumpHistory Count="3 " HistoryIndex="2">111 <JumpHistory Count="30" HistoryIndex="28"> 97 112 <Position1> 98 113 <Filename Value="UMainForm.pas"/> 99 <Caret Line="1 " Column="1" TopLine="1"/>114 <Caret Line="165" Column="36" TopLine="144"/> 100 115 </Position1> 101 116 <Position2> 102 117 <Filename Value="UMainForm.pas"/> 103 <Caret Line="1 4" Column="86" TopLine="1"/>118 <Caret Line="102" Column="9" TopLine="87"/> 104 119 </Position2> 105 120 <Position3> 106 <Filename Value="U Instance.pas"/>107 <Caret Line=" 20" Column="8" TopLine="1"/>121 <Filename Value="UMainForm.pas"/> 122 <Caret Line="127" Column="33" TopLine="106"/> 108 123 </Position3> 124 <Position4> 125 <Filename Value="UMainForm.pas"/> 126 <Caret Line="96" Column="1" TopLine="83"/> 127 </Position4> 128 <Position5> 129 <Filename Value="UMainForm.pas"/> 130 <Caret Line="97" Column="19" TopLine="89"/> 131 </Position5> 132 <Position6> 133 <Filename Value="UMainForm.pas"/> 134 <Caret Line="106" Column="17" TopLine="93"/> 135 </Position6> 136 <Position7> 137 <Filename Value="UMainForm.pas"/> 138 <Caret Line="127" Column="54" TopLine="114"/> 139 </Position7> 140 <Position8> 141 <Filename Value="UMainForm.pas"/> 142 <Caret Line="159" Column="16" TopLine="137"/> 143 </Position8> 144 <Position9> 145 <Filename Value="UMainForm.pas"/> 146 <Caret Line="97" Column="8" TopLine="84"/> 147 </Position9> 148 <Position10> 149 <Filename Value="UMainForm.pas"/> 150 <Caret Line="3" Column="14" TopLine="1"/> 151 </Position10> 152 <Position11> 153 <Filename Value="UMainForm.pas"/> 154 <Caret Line="152" Column="17" TopLine="130"/> 155 </Position11> 156 <Position12> 157 <Filename Value="UMainForm.pas"/> 158 <Caret Line="161" Column="30" TopLine="138"/> 159 </Position12> 160 <Position13> 161 <Filename Value="USource.pas"/> 162 <Caret Line="25" Column="45" TopLine="1"/> 163 </Position13> 164 <Position14> 165 <Filename Value="USource.pas"/> 166 <Caret Line="35" Column="13" TopLine="13"/> 167 </Position14> 168 <Position15> 169 <Filename Value="USource.pas"/> 170 <Caret Line="24" Column="23" TopLine="11"/> 171 </Position15> 172 <Position16> 173 <Filename Value="USource.pas"/> 174 <Caret Line="8" Column="29" TopLine="1"/> 175 </Position16> 176 <Position17> 177 <Filename Value="UMainForm.pas"/> 178 <Caret Line="45" Column="25" TopLine="11"/> 179 </Position17> 180 <Position18> 181 <Filename Value="UMainForm.pas"/> 182 <Caret Line="61" Column="21" TopLine="48"/> 183 </Position18> 184 <Position19> 185 <Filename Value="UMainForm.pas"/> 186 <Caret Line="73" Column="49" TopLine="69"/> 187 </Position19> 188 <Position20> 189 <Filename Value="UMainForm.pas"/> 190 <Caret Line="89" Column="35" TopLine="75"/> 191 </Position20> 192 <Position21> 193 <Filename Value="UInstance.pas"/> 194 <Caret Line="23" Column="21" TopLine="1"/> 195 </Position21> 196 <Position22> 197 <Filename Value="UMainForm.pas"/> 198 <Caret Line="77" Column="1" TopLine="65"/> 199 </Position22> 200 <Position23> 201 <Filename Value="UMainForm.pas"/> 202 <Caret Line="78" Column="1" TopLine="71"/> 203 </Position23> 204 <Position24> 205 <Filename Value="UInstance.pas"/> 206 <Caret Line="24" Column="20" TopLine="11"/> 207 </Position24> 208 <Position25> 209 <Filename Value="UMainForm.pas"/> 210 <Caret Line="94" Column="56" TopLine="81"/> 211 </Position25> 212 <Position26> 213 <Filename Value="UInstance.pas"/> 214 <Caret Line="25" Column="22" TopLine="11"/> 215 </Position26> 216 <Position27> 217 <Filename Value="UMainForm.pas"/> 218 <Caret Line="96" Column="56" TopLine="83"/> 219 </Position27> 220 <Position28> 221 <Filename Value="UMainForm.pas"/> 222 <Caret Line="44" Column="15" TopLine="30"/> 223 </Position28> 224 <Position29> 225 <Filename Value="UMainForm.pas"/> 226 <Caret Line="119" Column="19" TopLine="117"/> 227 </Position29> 228 <Position30> 229 <Filename Value="UMainForm.pas"/> 230 <Caret Line="44" Column="15" TopLine="31"/> 231 </Position30> 109 232 </JumpHistory> 110 233 </ProjectOptions> -
trunk/FreePascalManager.lpr
r1 r2 16 16 Application.Initialize; 17 17 Application.CreateForm(TForm1, Form1); 18 Application.CreateForm(T Form2, Form2);18 Application.CreateForm(TOptionsForm, OptionsForm); 19 19 Application.Run; 20 20 end. -
trunk/UInstance.pas
r1 r2 9 9 10 10 type 11 12 { TInstance } 13 11 14 TInstance = class 15 Id: Integer; 12 16 Name: string; 13 IDEVersion: string;14 17 IDESource: TSource; 15 18 IDERevision: string; 16 //IDEDate: TDateTime; 17 FPCVersion: string; 19 IDEDate: TDateTime; 18 20 FPCSource: TSource; 19 21 FPCRevision: string; 20 //FPCDate: TDateTime; 22 FPCDate: TDateTime; 23 procedure Build; 24 procedure Start; 25 procedure Update; 21 26 end; 22 27 23 28 implementation 24 29 30 { TInstance } 31 32 procedure TInstance.Build; 33 begin 34 35 end; 36 37 procedure TInstance.Start; 38 begin 39 40 end; 41 42 procedure TInstance.Update; 43 begin 44 45 end; 46 25 47 end. 26 48 -
trunk/UMainForm.lfm
r1 r2 7 7 ClientHeight = 363 8 8 ClientWidth = 567 9 OnCreate = FormCreate 10 OnDestroy = FormDestroy 11 OnShow = FormShow 9 12 LCLVersion = '0.9.31' 10 13 object ListView1: TListView … … 17 20 item 18 21 Caption = 'Name' 22 Width = 100 19 23 end 20 24 item 21 25 Caption = 'FPC version' 22 Width = 1 0026 Width = 150 23 27 end 24 28 item 25 29 Caption = 'IDE version' 26 Width = 1 0030 Width = 150 27 31 end> 28 32 OwnerData = True … … 31 35 TabOrder = 0 32 36 ViewStyle = vsReport 37 OnData = ListView1Data 38 OnSelectItem = ListView1SelectItem 33 39 end 34 40 object Label1: TLabel … … 65 71 Action = AStart 66 72 Anchors = [akLeft, akBottom] 73 Default = True 67 74 TabOrder = 3 68 75 end … … 77 84 end 78 85 object Button5: TButton 79 Left = 36086 Left = 440 80 87 Height = 25 81 88 Top = 333 … … 85 92 TabOrder = 5 86 93 end 94 object Button6: TButton 95 Left = 355 96 Height = 25 97 Top = 333 98 Width = 75 99 Action = ACompile 100 Anchors = [akLeft, akBottom] 101 TabOrder = 6 102 end 87 103 object ActionList1: TActionList 88 104 left = 453 … … 90 106 object AAdd: TAction 91 107 Caption = 'Add' 108 OnExecute = AAddExecute 92 109 end 93 110 object ARemove: TAction 94 111 Caption = 'Remove' 112 OnExecute = ARemoveExecute 95 113 end 96 114 object AStart: TAction 97 115 Caption = 'Start' 116 OnExecute = AStartExecute 98 117 end 99 118 object AUpdate: TAction 100 119 Caption = 'Update' 120 OnExecute = AUpdateExecute 101 121 end 102 122 object AOptions: TAction 103 123 Caption = 'Options' 104 124 end 125 object ACompile: TAction 126 Caption = 'Compile' 127 OnExecute = ACompileExecute 128 end 105 129 end 106 130 end -
trunk/UMainForm.pas
r1 r2 1 1 unit UMainForm; 2 2 3 {$mode objfpc}{$H+}3 {$mode Delphi}{$H+} 4 4 5 5 interface … … 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 StdCtrls, ActnList; 9 StdCtrls, ActnList, Contnrs, USource, UInstance, UOptions, 10 DOM, XMLWrite, XMLRead; 11 12 const 13 ConfigFileName = 'Config.xml'; 10 14 11 15 type … … 15 19 TForm1 = class(TForm) 16 20 AAdd: TAction; 21 ACompile: TAction; 17 22 AOptions: TAction; 18 23 ARemove: TAction; … … 25 30 Button4: TButton; 26 31 Button5: TButton; 32 Button6: TButton; 27 33 Label1: TLabel; 28 34 ListView1: TListView; 35 procedure AAddExecute(Sender: TObject); 36 procedure ACompileExecute(Sender: TObject); 37 procedure ARemoveExecute(Sender: TObject); 38 procedure AStartExecute(Sender: TObject); 39 procedure AUpdateExecute(Sender: TObject); 40 procedure FormCreate(Sender: TObject); 41 procedure FormDestroy(Sender: TObject); 42 procedure FormShow(Sender: TObject); 43 procedure ListView1Data(Sender: TObject; Item: TListItem); 44 procedure ListView1SelectItem(Sender: TObject; Item: TListItem; 45 Selected: Boolean); 29 46 private 30 { private declarations } 47 procedure ReloadList; 48 procedure LoadInstanceList; 49 procedure SaveInstanceList; 31 50 public 32 { public declarations } 51 Instances: TObjectList; 52 Sources: TSourceList; 33 53 end; 34 54 … … 40 60 {$R *.lfm} 41 61 62 { TForm1 } 63 64 procedure TForm1.FormCreate(Sender: TObject); 65 begin 66 Instances := TObjectList.Create; 67 Sources := TSourceList.Create; 68 end; 69 70 procedure TForm1.AAddExecute(Sender: TObject); 71 begin 72 OptionsForm.ShowModal; 73 end; 74 75 procedure TForm1.ACompileExecute(Sender: TObject); 76 begin 77 if Assigned(ListView1.Selected) then 78 if ListView1.Selected.Index < Instances.Count then begin 79 TInstance(Instances[ListView1.Selected.Index]).Build; 80 ReloadList; 81 end; 82 end; 83 84 procedure TForm1.ARemoveExecute(Sender: TObject); 85 begin 86 if Assigned(ListView1.Selected) then 87 if ListView1.Selected.Index < Instances.Count then begin 88 Instances.Remove(ListView1.Selected.Data); 89 ReloadList; 90 end; 91 end; 92 93 procedure TForm1.AStartExecute(Sender: TObject); 94 begin 95 if Assigned(ListView1.Selected) then 96 if ListView1.Selected.Index < Instances.Count then begin 97 TInstance(Instances[ListView1.Selected.Index]).Start; 98 ReloadList; 99 end; 100 end; 101 102 procedure TForm1.AUpdateExecute(Sender: TObject); 103 begin 104 if Assigned(ListView1.Selected) then 105 if ListView1.Selected.Index < Instances.Count then begin 106 TInstance(Instances[ListView1.Selected.Index]).Update; 107 ReloadList; 108 end; 109 end; 110 111 procedure TForm1.FormDestroy(Sender: TObject); 112 begin 113 Instances.Free; 114 Sources.Free; 115 end; 116 117 procedure TForm1.FormShow(Sender: TObject); 118 begin 119 ListView1SelectItem(nil, nil, False); 120 end; 121 122 procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem); 123 begin 124 if Item.Index < Instances.Count then 125 with TInstance(Instances[Item.Index]) do begin 126 Item.Caption := Name; 127 Item.Data := Instances[Item.Index]; 128 Item.SubItems.Add(FPCRevision); 129 Item.SubItems.Add(IDERevision); 130 end; 131 end; 132 133 procedure TForm1.ListView1SelectItem(Sender: TObject; Item: TListItem; 134 Selected: Boolean); 135 begin 136 ACompile.Enabled := Assigned(ListView1.Selected); 137 AUpdate.Enabled := Assigned(ListView1.Selected); 138 AStart.Enabled := Assigned(ListView1.Selected); 139 ARemove.Enabled := Assigned(ListView1.Selected); 140 AOptions.Enabled := Assigned(ListView1.Selected); 141 end; 142 143 procedure TForm1.ReloadList; 144 begin 145 ListView1.Items.Count := Instances.Count; 146 ListView1.Refresh; 147 end; 148 149 procedure TForm1.LoadInstanceList; 150 var 151 Doc: TXMLDocument; 152 NewNode: TDOMNode; 153 NewSubNode: TDOMNode; 154 I: Integer; 155 NewSource: TSource; 156 NewInstance: TInstance; 157 Child: TDOMNode; 158 begin 159 try 160 ReadXMLFile(Doc, UTF8Decode(ConfigFileName)); 161 162 Instances.Free; 163 Sources.Free; 164 165 NewNode := Doc.DocumentElement.FindNode('Sources'); 166 Child := NewNode.FirstChild; 167 while Assigned(Child) do begin 168 NewSource := TSource.Create; 169 with NewSource do begin 170 NewNode := Doc.DocumentElement.FindNode('Id'); 171 if Assigned(NewNode) then 172 Id := StrToInt(NewNode.TextContent); 173 NewNode := Doc.DocumentElement.FindNode('Name'); 174 if Assigned(NewNode) then 175 Name := UTF8Encode(string(NewNode.TextContent)); 176 NewNode := Doc.DocumentElement.FindNode('SubversionURL'); 177 if Assigned(NewNode) then 178 SubversionURL := UTF8Encode(string(NewNode.TextContent)); 179 NewNode := Doc.DocumentElement.FindNode('Version'); 180 if Assigned(NewNode) then 181 Version := UTF8Encode(string(NewNode.TextContent)); 182 NewNode := Doc.DocumentElement.FindNode('Variation'); 183 if Assigned(NewNode) then 184 Variation := UTF8Encode(string(NewNode.TextContent)); 185 NewNode := Doc.DocumentElement.FindNode('SourceType'); 186 if Assigned(NewNode) then 187 SourceType := TSourceType(StrToInt(NewNode.TextContent)); 188 end; 189 Child := Child.NextSibling; 190 end; 191 192 NewNode := Doc.DocumentElement.FindNode('Instances'); 193 Child := NewNode.FirstChild; 194 while Assigned(Child) do begin 195 NewInstance := TInstance.Create; 196 with NewInstance do begin 197 NewNode := Doc.DocumentElement.FindNode('Id'); 198 if Assigned(NewNode) then 199 Id := StrToInt(NewNode.TextContent); 200 NewNode := Doc.DocumentElement.FindNode('Name'); 201 if Assigned(NewNode) then 202 Name := UTF8Encode(string(NewNode.TextContent)); 203 NewNode := Doc.DocumentElement.FindNode('IDEDate'); 204 if Assigned(NewNode) then 205 IDEDate := StrToDateTime(string(NewNode.TextContent)); 206 NewNode := Doc.DocumentElement.FindNode('IDERevision'); 207 if Assigned(NewNode) then 208 IDERevision := UTF8Encode(string(NewNode.TextContent)); 209 NewNode := Doc.DocumentElement.FindNode('IDESource'); 210 if Assigned(NewNode) then 211 IDESource := Sources.FindById(StrToInt(NewNode.TextContent)); 212 NewNode := Doc.DocumentElement.FindNode('FPCDate'); 213 if Assigned(NewNode) then 214 FPCDate := StrToDateTime(string(NewNode.TextContent)); 215 NewNode := Doc.DocumentElement.FindNode('FPCRevision'); 216 if Assigned(NewNode) then 217 FPCRevision := UTF8Encode(string(NewNode.TextContent)); 218 NewNode := Doc.DocumentElement.FindNode('FPCSource'); 219 if Assigned(NewNode) then 220 FPCSource := Sources.FindById(StrToInt(NewNode.TextContent)); 221 end; 222 Child := Child.NextSibling; 223 end; 224 finally 225 Doc.Free; 226 end; 227 end; 228 229 procedure TForm1.SaveInstanceList; 230 var 231 I: Integer; 232 Doc: TXMLDocument; 233 RootNode: TDOMNode; 234 NewNode: TDOMNode; 235 NewNode2: TDOMNode; 236 begin 237 Doc := TXMLDocument.Create; 238 with Doc do 239 try 240 RootNode := CreateElement('InstanceList'); 241 AppendChild(RootNode); 242 with RootNode do begin 243 NewNode := OwnerDocument.CreateElement('Instances'); 244 with NewNode do 245 for I := 0 to Instances.Count - 1 do 246 with TInstance(Instances[I]) do begin 247 NewNode2 := OwnerDocument.CreateElement('Id'); 248 NewNode2.TextContent := IntToStr(Id); 249 AppendChild(NewNode); 250 NewNode2 := OwnerDocument.CreateElement('Name'); 251 NewNode2.TextContent := UTF8Decode(Name); 252 AppendChild(NewNode); 253 NewNode2 := OwnerDocument.CreateElement('IDEDate'); 254 NewNode2.TextContent := DateTimeToStr(IDEDate); 255 AppendChild(NewNode); 256 NewNode2 := OwnerDocument.CreateElement('IDERevision'); 257 NewNode2.TextContent := UTF8Decode(IDERevision); 258 AppendChild(NewNode); 259 NewNode2 := OwnerDocument.CreateElement('IDESource'); 260 NewNode2.TextContent := IntToStr(IDESource.Id); 261 AppendChild(NewNode); 262 NewNode2 := OwnerDocument.CreateElement('FPCDate'); 263 NewNode2.TextContent := DateTimeToStr(FPCDate); 264 AppendChild(NewNode); 265 NewNode2 := OwnerDocument.CreateElement('FPCRevision'); 266 NewNode2.TextContent := UTF8Decode(FPCRevision); 267 AppendChild(NewNode); 268 NewNode2 := OwnerDocument.CreateElement('FPCSource'); 269 NewNode2.TextContent := IntToStr(FPCSource.Id); 270 AppendChild(NewNode); 271 end; 272 AppendChild(RootNode); 273 274 NewNode := OwnerDocument.CreateElement('Sources'); 275 with NewNode do 276 for I := 0 to Sources.Count - 1 do 277 with TSource(Sources[I]) do begin 278 NewNode2 := OwnerDocument.CreateElement('Id'); 279 NewNode2.TextContent := IntToStr(Id); 280 AppendChild(NewNode); 281 NewNode2 := OwnerDocument.CreateElement('Name'); 282 NewNode2.TextContent := UTF8Decode(Name); 283 AppendChild(NewNode); 284 NewNode2 := OwnerDocument.CreateElement('SubversionURL'); 285 NewNode2.TextContent := UTF8Decode(SubversionURL); 286 AppendChild(NewNode); 287 NewNode2 := OwnerDocument.CreateElement('Version'); 288 NewNode2.TextContent := UTF8Decode(Version); 289 AppendChild(NewNode); 290 NewNode2 := OwnerDocument.CreateElement('Variation'); 291 NewNode2.TextContent := UTF8Decode(Variation); 292 AppendChild(NewNode); 293 NewNode2 := OwnerDocument.CreateElement('SourceType'); 294 NewNode2.TextContent := IntToStr(Byte(SourceType)); 295 AppendChild(NewNode); 296 end; 297 AppendChild(RootNode); 298 end; 299 WriteXMLFile(Doc, UTF8Decode(ConfigFileName)); 300 finally 301 Free; 302 end; 303 end; 304 42 305 end. 43 306 -
trunk/UOptions.lfm
r1 r2 1 object Form2: TForm22 Left = 2923 Height = 4 094 Top = 1 131 object OptionsForm: TOptionsForm 2 Left = 338 3 Height = 410 4 Top = 161 5 5 Width = 573 6 6 Caption = 'Options' 7 ClientHeight = 410 8 ClientWidth = 573 7 9 LCLVersion = '0.9.31' 10 object Label1: TLabel 11 Left = 9 12 Height = 14 13 Top = 8 14 Width = 112 15 Caption = 'Available FPC variants:' 16 ParentColor = False 17 end 18 object ListView1: TListView 19 Left = 7 20 Height = 173 21 Top = 27 22 Width = 561 23 Anchors = [akTop, akLeft, akRight] 24 Columns = < 25 item 26 Caption = 'Name' 27 Width = 70 28 end 29 item 30 Caption = 'Version' 31 end 32 item 33 Caption = 'Revision' 34 end 35 item 36 Caption = 'Date' 37 Width = 60 38 end 39 item 40 Caption = 'Source URL' 41 Width = 300 42 end> 43 OwnerData = True 44 ReadOnly = True 45 RowSelect = True 46 TabOrder = 0 47 ViewStyle = vsReport 48 end 49 object Label2: TLabel 50 Left = 9 51 Height = 14 52 Top = 208 53 Width = 110 54 Caption = 'Available IDE variants:' 55 ParentColor = False 56 end 57 object ListView2: TListView 58 Left = 9 59 Height = 150 60 Top = 226 61 Width = 559 62 Anchors = [akTop, akLeft, akRight] 63 Columns = < 64 item 65 Caption = 'Name' 66 Width = 70 67 end 68 item 69 Caption = 'Version' 70 end 71 item 72 Caption = 'Revision' 73 end 74 item 75 Caption = 'Date' 76 Width = 60 77 end 78 item 79 Caption = 'Source URL' 80 Width = 300 81 end> 82 OwnerData = True 83 ReadOnly = True 84 RowSelect = True 85 TabOrder = 1 86 ViewStyle = vsReport 87 end 88 object ButtonCancel: TButton 89 Left = 408 90 Height = 25 91 Top = 380 92 Width = 75 93 Caption = 'Cancel' 94 TabOrder = 2 95 end 96 object ButtonOk: TButton 97 Left = 493 98 Height = 25 99 Top = 380 100 Width = 75 101 Caption = 'Ok' 102 TabOrder = 3 103 end 8 104 end -
trunk/UOptions.pas
r1 r2 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs; 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls; 9 10 10 11 type 11 TForm2 = class(TForm) 12 13 { TOptionsForm } 14 15 TOptionsForm = class(TForm) 16 ButtonCancel: TButton; 17 ButtonOk: TButton; 18 Label1: TLabel; 19 Label2: TLabel; 20 ListView1: TListView; 21 ListView2: TListView; 12 22 private 13 23 { private declarations } … … 17 27 18 28 var 19 Form2: TForm2;29 OptionsForm: TOptionsForm; 20 30 21 31 implementation -
trunk/USource.pas
r1 r2 6 6 7 7 uses 8 Classes, SysUtils ;8 Classes, SysUtils, Contnrs; 9 9 10 10 type … … 12 12 13 13 TSource = class 14 Id: Integer; 14 15 Name: string; 15 16 SubversionURL: string; … … 19 20 end; 20 21 22 { TSourceList } 23 24 TSourceList = class(TObjectList) 25 function FindById(Id: Integer): TSource; 26 end; 27 21 28 implementation 29 30 { TSourceList } 31 32 function TSourceList.FindById(Id: Integer): TSource; 33 var 34 I: Integer; 35 begin 36 I := 0; 37 while (I < Count) and (TSource(Items[I]).Id <> Id) do Inc(I); 38 if I < Count then Result := TSource(Items[I]) 39 else Result := nil; 40 end; 22 41 23 42 end.
Note:
See TracChangeset
for help on using the changeset viewer.