Changeset 6 for trunk/Forms
- Timestamp:
- Feb 4, 2011, 9:45:01 AM (14 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UInstanceOptions.lfm
r5 r6 1 1 object InstanceOptionsForm: TInstanceOptionsForm 2 Left = 2743 Height = 4244 Top = 1 065 Width = 5732 Left = 307 3 Height = 225 4 Top = 132 5 Width = 454 6 6 Caption = 'Options' 7 ClientHeight = 4248 ClientWidth = 5737 ClientHeight = 225 8 ClientWidth = 454 9 9 OnCreate = FormCreate 10 10 OnDestroy = FormDestroy … … 12 12 LCLVersion = '0.9.31' 13 13 object ButtonCancel: TButton 14 Left = 40814 Left = 289 15 15 Height = 25 16 Top = 39416 Top = 195 17 17 Width = 75 18 18 Anchors = [akRight, akBottom] … … 23 23 end 24 24 object ButtonOk: TButton 25 Left = 49325 Left = 374 26 26 Height = 25 27 Top = 39427 Top = 195 28 28 Width = 75 29 29 Anchors = [akRight, akBottom] … … 33 33 TabOrder = 1 34 34 end 35 object ButtonUpdateSource: TButton 36 Left = 10 37 Height = 25 38 Top = 395 39 Width = 75 40 Anchors = [akLeft, akBottom] 41 Caption = 'Update list' 42 OnClick = ButtonUpdateSourceClick 35 object Label2: TLabel 36 Left = 8 37 Height = 14 38 Top = 72 39 Width = 67 40 Caption = 'IDE selection:' 41 ParentColor = False 42 end 43 object Label1: TLabel 44 Left = 8 45 Height = 14 46 Top = 40 47 Width = 69 48 Caption = 'FPC selection:' 49 ParentColor = False 50 end 51 object Edit1: TEdit 52 Left = 128 53 Height = 21 54 Top = 8 55 Width = 320 56 Anchors = [akTop, akLeft, akRight] 43 57 TabOrder = 2 44 58 end 45 object Panel1: TPanel 46 Left = 0 47 Height = 26 48 Top = 0 49 Width = 573 50 Align = alTop 51 BevelOuter = bvNone 52 ClientHeight = 26 53 ClientWidth = 573 59 object Label3: TLabel 60 Left = 8 61 Height = 14 62 Top = 8 63 Width = 32 64 Caption = 'Name:' 65 ParentColor = False 66 end 67 object Edit2: TEdit 68 Left = 128 69 Height = 21 70 Top = 39 71 Width = 233 72 Anchors = [akTop, akLeft, akRight] 73 ReadOnly = True 54 74 TabOrder = 3 55 object Edit1: TEdit56 Left = 5657 Height = 2158 Top = 359 Width = 51260 Anchors = [akTop, akLeft, akRight]61 TabOrder = 062 end63 object Label3: TLabel64 Left = 765 Height = 1466 Top = 567 Width = 3268 Caption = 'Name:'69 ParentColor = False70 end71 75 end 72 object Panel2: TPanel 73 Left = 0 74 Height = 178 75 Top = 26 76 Width = 573 77 Align = alTop 78 BevelOuter = bvNone 79 ClientHeight = 178 80 ClientWidth = 573 76 object Button1: TButton 77 Left = 374 78 Height = 25 79 Top = 39 80 Width = 75 81 Anchors = [akTop, akRight] 82 Caption = 'Select' 83 OnClick = Button1Click 81 84 TabOrder = 4 82 object ListView1: TListView83 Left = 784 Height = 15685 Top = 2286 Width = 56187 Anchors = [akTop, akLeft, akRight, akBottom]88 Columns = <89 item90 Caption = 'Name'91 Width = 7092 end93 item94 Caption = 'Type'95 Width = 8096 end97 item98 Caption = 'Version'99 Width = 60100 end101 item102 Caption = 'Revision'103 end104 item105 Caption = 'Date'106 Width = 60107 end108 item109 Caption = 'Source URL'110 Width = 300111 end>112 OwnerData = True113 ReadOnly = True114 RowSelect = True115 TabOrder = 0116 ViewStyle = vsReport117 OnData = ListView1Data118 end119 object Label1: TLabel120 Left = 9121 Height = 14122 Top = 8123 Width = 69124 Caption = 'FPC selection:'125 ParentColor = False126 end127 85 end 128 object Panel3: TPanel 129 Left = 0 130 Height = 186 131 Top = 204 132 Width = 573 133 Align = alTop 134 Anchors = [akTop, akLeft, akRight, akBottom] 135 BevelOuter = bvNone 136 ClientHeight = 186 137 ClientWidth = 573 86 object Edit3: TEdit 87 Left = 128 88 Height = 21 89 Top = 72 90 Width = 233 91 Anchors = [akTop, akLeft, akRight] 92 ReadOnly = True 138 93 TabOrder = 5 139 object Label2: TLabel 140 Left = 11 141 Height = 14 142 Top = 12 143 Width = 67 144 Caption = 'IDE selection:' 145 ParentColor = False 146 end 147 object ListView2: TListView 148 Left = 9 149 Height = 158 150 Top = 28 151 Width = 559 152 Anchors = [akTop, akLeft, akRight, akBottom] 153 Columns = < 154 item 155 Caption = 'Name' 156 Width = 70 157 end 158 item 159 Caption = 'Type' 160 Width = 80 161 end 162 item 163 Caption = 'Version' 164 Width = 60 165 end 166 item 167 Caption = 'Revision' 168 end 169 item 170 Caption = 'Date' 171 Width = 60 172 end 173 item 174 Caption = 'Source URL' 175 Width = 300 176 end> 177 OwnerData = True 178 ReadOnly = True 179 RowSelect = True 180 TabOrder = 0 181 ViewStyle = vsReport 182 OnData = ListView2Data 183 end 94 end 95 object Button2: TButton 96 Left = 374 97 Height = 25 98 Top = 70 99 Width = 75 100 Anchors = [akTop, akRight] 101 Caption = 'Select' 102 OnClick = Button2Click 103 TabOrder = 6 184 104 end 185 105 end -
trunk/Forms/UInstanceOptions.pas
r5 r6 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ExtCtrls, DOM, XMLWrite, XMLRead, HTTPSend, USource, UInstance; 9 ComCtrls, ExtCtrls, DOM, XMLWrite, XMLRead, HTTPSend, USource, UInstance, 10 USourceSelection; 10 11 11 12 type … … 14 15 15 16 TInstanceOptionsForm = class(TForm) 16 ButtonUpdateSource: TButton; 17 Button1: TButton; 18 Button2: TButton; 17 19 ButtonCancel: TButton; 18 20 ButtonOk: TButton; 19 21 Edit1: TEdit; 22 Edit2: TEdit; 23 Edit3: TEdit; 20 24 Label1: TLabel; 21 25 Label2: TLabel; 22 26 Label3: TLabel; 23 ListView1: TListView; 24 ListView2: TListView; 25 Panel1: TPanel; 26 Panel2: TPanel; 27 Panel3: TPanel; 27 procedure Button1Click(Sender: TObject); 28 procedure Button2Click(Sender: TObject); 28 29 procedure ButtonCancelClick(Sender: TObject); 29 30 procedure ButtonOkClick(Sender: TObject); 30 procedure ButtonUpdateSourceClick(Sender: TObject);31 31 procedure FormCreate(Sender: TObject); 32 32 procedure FormDestroy(Sender: TObject); 33 33 procedure FormShow(Sender: TObject); 34 procedure ListView1Data(Sender: TObject; Item: TListItem);35 procedure ListView2Data(Sender: TObject; Item: TListItem);36 34 private 37 procedure ReloadList;35 IsNew: Boolean; 38 36 public 39 37 Instance: TInstance; 40 FPCSource s: TSourceList;41 IDESource s: TSourceList;38 FPCSource: TSource; 39 IDESource: TSource; 42 40 end; 43 41 … … 54 52 { TInstanceOptionsForm } 55 53 56 procedure TInstanceOptionsForm.ButtonUpdateSourceClick(Sender: TObject);57 var58 fs: TFileStream;59 begin60 fs := TFileStream.Create(ExtractFileName(MainForm.SourceURL), fmOpenWrite or fmCreate);61 try62 HttpGetBinary(MainForm.SourceURL, fs);63 finally64 fs.Free;65 end;66 MainForm.Sources.UpdateFormFile(ExtractFileName(MainForm.SourceURL));67 ReloadList;68 end;69 70 54 procedure TInstanceOptionsForm.ButtonOkClick(Sender: TObject); 71 55 begin 72 56 Instance.Name := Edit1.Text; 73 if Assigned(ListView1.Selected) then 74 Instance.FPCSource := TSource(ListView1.Selected.Data) 75 else Instance.FPCSource := nil; 76 if Assigned(ListView2.Selected) then 77 Instance.IDESource := TSource(ListView2.Selected.Data) 78 else Instance.IDESource := nil; 57 Instance.FPCSource := FPCSource; 58 Instance.IDESource := IDESource; 79 59 end; 80 60 81 61 procedure TInstanceOptionsForm.ButtonCancelClick(Sender: TObject); 82 62 begin 83 Instance.Free; 63 if IsNew then Instance.Free; 64 end; 65 66 procedure TInstanceOptionsForm.Button1Click(Sender: TObject); 67 begin 68 SourceSelectionForm.ProjectType := 'Compiler'; 69 if SourceSelectionForm.ShowModal = mrOk then begin 70 if Assigned(SourceSelectionForm.ListView1.Selected) then 71 FPCSource := TSource(SourceSelectionForm.ListView1.Selected.Data) 72 else FPCSource := nil; 73 if Assigned(FPCSource) then 74 Edit2.Text := FPCSource.GetName 75 else Edit2.Text := ''; 76 end; 77 end; 78 79 procedure TInstanceOptionsForm.Button2Click(Sender: TObject); 80 begin 81 SourceSelectionForm.ProjectType := 'IDE'; 82 if SourceSelectionForm.ShowModal = mrOk then begin 83 if Assigned(SourceSelectionForm.ListView1.Selected) then 84 IDESource := TSource(SourceSelectionForm.ListView1.Selected.Data) 85 else IDESource := nil; 86 if Assigned(IDESource) then 87 Edit3.Text := IDESource.GetName 88 else Edit3.Text := ''; 89 end; 84 90 end; 85 91 86 92 procedure TInstanceOptionsForm.FormCreate(Sender: TObject); 87 93 begin 88 FPCSources := TSourceList.Create;89 FPCSources.OwnsObjects := False;90 IDESources := TSourceList.Create;91 IDESources.OwnsObjects := False;92 94 end; 93 95 94 96 procedure TInstanceOptionsForm.FormDestroy(Sender: TObject); 95 97 begin 96 FPCSources.Free;97 IDESources.Free;98 98 end; 99 99 100 100 procedure TInstanceOptionsForm.FormShow(Sender: TObject); 101 101 begin 102 ReloadList;103 102 if not Assigned(Instance) then begin 104 103 Instance := TInstance.Create; 105 104 Instance.Id := MainForm.Instances.GetNewId; 106 105 Instance.Name := 'Instance ' + IntToStr(Instance.Id); 107 end; 108 // ListView1.Items[; 106 IsNew := True; 107 end else IsNew := False; 108 109 109 Edit1.Text := Instance.Name; 110 end; 111 112 procedure TInstanceOptionsForm.ListView1Data(Sender: TObject; Item: TListItem); 113 begin 114 if Item.Index < FPCSources.Count then 115 with TSource(FPCSources[Item.Index]) do begin 116 Item.Caption := ProjectName; 117 Item.Data := FPCSources[Item.Index]; 118 Item.SubItems.Add(VersionType); 119 Item.SubItems.Add(VersionNumber); 120 Item.SubItems.Add(''); 121 Item.SubItems.Add(''); 122 Item.SubItems.Add(SubversionURL); 123 end; 124 end; 125 126 procedure TInstanceOptionsForm.ListView2Data(Sender: TObject; Item: TListItem); 127 begin 128 if Item.Index < IDESources.Count then 129 with TSource(IDESources[Item.Index]) do begin 130 Item.Caption := ProjectName; 131 Item.Data := IDESources[Item.Index]; 132 Item.SubItems.Add(VersionType); 133 Item.SubItems.Add(VersionNumber); 134 Item.SubItems.Add(''); 135 Item.SubItems.Add(''); 136 Item.SubItems.Add(SubversionURL); 137 end; 138 end; 139 140 procedure TInstanceOptionsForm.ReloadList; 141 var 142 I: Integer; 143 begin 144 FPCSources.Clear; 145 for I := 0 to MainForm.Sources.Count - 1 do 146 if TSource(MainForm.Sources[I]).ProjectType = 'Compiler' then 147 FPCSources.Add(MainForm.Sources[I]); 148 if ListView1.Items.Count <> FPCSources.Count then 149 ListView1.Items.Count := FPCSources.Count; 150 ListView1.Items[-1]; // workaround 151 ListView1.Refresh; 152 IDESources.Clear; 153 for I := 0 to MainForm.Sources.Count - 1 do 154 if TSource(MainForm.Sources[I]).ProjectType = 'IDE' then 155 IDESources.Add(MainForm.Sources[I]); 156 if ListView2.Items.Count <> IDESources.Count then 157 ListView2.Items.Count := IDESources.Count; 158 ListView2.Items[-1]; // workaround 159 ListView2.Refresh; 110 if Assigned(Instance.FPCSource) then 111 Edit2.Text := Instance.FPCSource.GetName 112 else Edit2.Text := ''; 113 if Assigned(Instance.IDESource) then 114 Edit3.Text := Instance.IDESource.GetName 115 else Edit3.Text := ''; 160 116 end; 161 117 -
trunk/Forms/UMainForm.lfm
r5 r6 23 23 end 24 24 item 25 Caption = ' FPC version'26 Width = 15025 Caption = 'Compiler' 26 Width = 200 27 27 end 28 28 item 29 Caption = 'IDE version'30 Width = 15029 Caption = 'IDE' 30 Width = 200 31 31 end 32 32 item -
trunk/Forms/UMainForm.pas
r5 r6 67 67 public 68 68 Platform: string; 69 TemplateDir: string; 69 70 BinUtilsDir: string; 70 71 InstanceDir: string; 72 SubversionDir: string; 71 73 SourceDir: string; 72 74 SourceURL: string; … … 90 92 Instances := TInstanceList.Create; 91 93 Sources := TSourceList.Create; 92 Platform := 'i386-win32';93 94 BinUtilsDir := 'BinUtils'; 94 95 InstanceDir := 'Instance'; 96 TemplateDir := 'Template'; 95 97 SourceDir := 'Source'; 96 98 SourceURL := 'http://tv.zdechov.net/fpc/SourceList.xml'; 99 {$IFDEF Windows} 100 Platform := 'i386-win32'; 101 SubversionDir := 'C:\Program Files\Subversion\bin'; 102 {$ENDIF} 103 {$IFDEF Linux} 104 Platform := 'i386-linux'; 105 SubversionDir := ''; 106 {$ENDIF} 97 107 LoadInstanceList; 98 108 end; … … 154 164 if ListView1.Selected.Index < Instances.Count then 155 165 with TInstance(Instances[ListView1.Selected.Index]) do begin 166 ForceDirectoriesUTF8(GetPath); 156 167 if Assigned(FPCSource) then begin 157 168 FPCSource.Download; … … 203 214 Item.Data := Instances[Item.Index]; 204 215 if Assigned(FPCSource) then 205 Item.SubItems.Add(FPCSource. ProjectName + ' ' + FPCSource.VersionNumber)216 Item.SubItems.Add(FPCSource.GetName) 206 217 else Item.SubItems.Add(''); 207 218 if Assigned(IDESource) then 208 Item.SubItems.Add(IDESource. ProjectName + ' ' + IDESource.VersionNumber)219 Item.SubItems.Add(IDESource.GetName) 209 220 else Item.SubItems.Add(''); 210 221 Item.SubItems.Add(BooleanText[Downloaded]); -
trunk/Forms/UMainOptions.lfm
r5 r6 43 43 Anchors = [akTop, akLeft, akRight] 44 44 TabOrder = 2 45 Text = 'Edit1'46 45 end 47 46 object Label2: TLabel … … 60 59 Anchors = [akTop, akLeft, akRight] 61 60 TabOrder = 3 62 Text = 'Edit1'63 61 end 64 62 object Label3: TLabel … … 77 75 Anchors = [akTop, akLeft, akRight] 78 76 TabOrder = 4 79 Text = 'Edit1' 77 end 78 object Label4: TLabel 79 Left = 9 80 Height = 14 81 Top = 128 82 Width = 98 83 Caption = 'Subversion location:' 84 ParentColor = False 85 end 86 object Edit4: TEdit 87 Left = 9 88 Height = 21 89 Top = 144 90 Width = 621 91 Anchors = [akTop, akLeft, akRight] 92 TabOrder = 5 80 93 end 81 94 end -
trunk/Forms/UMainOptions.pas
r5 r6 18 18 Edit2: TEdit; 19 19 Edit3: TEdit; 20 Edit4: TEdit; 20 21 Label1: TLabel; 21 22 Label2: TLabel; 22 23 Label3: TLabel; 24 Label4: TLabel; 23 25 procedure Button2Click(Sender: TObject); 24 26 procedure FormShow(Sender: TObject); … … 46 48 Edit2.Text := MainForm.Platform; 47 49 Edit3.Text := MainForm.SourceURL; 50 Edit4.Text := MainForm.SubversionDir; 48 51 end; 49 52 … … 53 56 MainForm.Platform := Edit2.Text; 54 57 MainForm.SourceURL := Edit3.Text; 58 MainForm.SubversionDir := Edit4.Text; 55 59 end; 56 60 -
trunk/Forms/UOperationProgress.lfm
r5 r6 7 7 ClientHeight = 440 8 8 ClientWidth = 562 9 OnClose = FormClose 9 10 OnShow = FormShow 10 11 LCLVersion = '0.9.31' … … 37 38 Caption = 'Close' 38 39 ModalResult = 6 40 OnClick = ButtonCloseClick 39 41 TabOrder = 2 40 42 end -
trunk/Forms/UOperationProgress.pas
r5 r6 20 20 Timer1: TTimer; 21 21 procedure ButtonAbortClick(Sender: TObject); 22 procedure ButtonCloseClick(Sender: TObject); 23 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 22 24 procedure FormShow(Sender: TObject); 23 25 procedure Timer1Timer(Sender: TObject); … … 44 46 if Assigned(Process) then 45 47 Process.Terminate(0); 48 end; 49 50 procedure TOperationProgressForm.ButtonCloseClick(Sender: TObject); 51 begin 52 53 end; 54 55 procedure TOperationProgressForm.FormClose(Sender: TObject; 56 var CloseAction: TCloseAction); 57 begin 58 Memo1.Clear; 46 59 end; 47 60
Note:
See TracChangeset
for help on using the changeset viewer.