Changeset 22 for trunk/Forms
- Timestamp:
- May 4, 2016, 11:43:42 PM (9 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAbout.lfm
r21 r22 1 1 object FormAbout: TFormAbout 2 2 Left = 866 3 Height = 4884 Top = 5325 Width = 6163 Height = 397 4 Top = 623 5 Width = 473 6 6 Caption = 'About' 7 ClientHeight = 4888 ClientWidth = 6167 ClientHeight = 397 8 ClientWidth = 473 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow … … 14 14 Height = 55 15 15 Top = 20 16 Width = 57616 Width = 433 17 17 Align = alTop 18 18 BorderSpacing.Around = 20 … … 26 26 Height = 48 27 27 Top = 95 28 Width = 57628 Width = 433 29 29 Align = alTop 30 30 BorderSpacing.Around = 20 … … 34 34 end 35 35 object ButtonClose: TButton 36 Left = 52136 Left = 378 37 37 Height = 25 38 Top = 44838 Top = 357 39 39 Width = 75 40 40 Anchors = [akRight, akBottom] … … 47 47 Height = 24 48 48 Top = 163 49 Width = 57649 Width = 433 50 50 Align = alTop 51 51 BorderSpacing.Around = 20 … … 56 56 Left = 16 57 57 Height = 25 58 Top = 44858 Top = 357 59 59 Width = 139 60 60 Anchors = [akLeft, akBottom] -
trunk/Forms/UFormAbout.pas
r21 r22 38 38 resourcestring 39 39 SVersion = 'Version'; 40 SReleaseDate = 'Release date :';40 SReleaseDate = 'Release date'; 41 41 SLicense = 'License'; 42 42 -
trunk/Forms/UFormAcronyms.lfm
r19 r22 26 26 item 27 27 Caption = 'Categories' 28 Width = 30 028 Width = 305 29 29 end> 30 30 MultiSelect = True … … 53 53 OnFilter = ListViewSort1Filter 54 54 Column = 0 55 Order = so Down55 Order = soUp 56 56 left = 248 57 57 top = 168 … … 78 78 object ASelectAll: TAction 79 79 Caption = 'Select all' 80 OnExecute = ASelectAllExecute 80 81 ShortCut = 16449 81 82 end -
trunk/Forms/UFormAcronyms.pas
r19 r22 58 58 59 59 resourcestring 60 SRemoveAllAcronyms = 'Remove all acronyms';61 SRemoveAllAcronymsQuery = 'Do you want to remove all acronyms?';62 60 SRemoveAcronym = 'Remove acronym'; 63 61 SRemoveAcronymQuery = 'Do you want to remove selected acronym?'; … … 256 254 AModify.Enabled := Assigned(FormMain.AcronymDb) and Assigned(ListViewAcronyms.Selected); 257 255 AAdd.Enabled := Assigned(FormMain.AcronymDb); 256 ASelectAll.Enabled := True; 258 257 end; 259 258 -
trunk/Forms/UFormImport.pas
r16 r22 42 42 SImportedNewAcronyms = 'Imported %d new acronyms.'; 43 43 44 45 function DownloadHTTP(URL: string; Stream: TStream): Boolean;46 var47 HTTPGetResult: Boolean;48 HTTPSender: THTTPSend;49 begin50 Result := False;51 HTTPSender := THTTPSend.Create;52 try53 HTTPGetResult := HTTPSender.HTTPMethod('GET', URL);54 if (HTTPSender.ResultCode >= 100) and (HTTPSender.ResultCode <= 299) then begin55 HTTPSender.Document.SaveToStream(Stream);56 Result := True;57 end;58 finally59 HTTPSender.Free;60 end;61 end;62 44 63 45 { TFormImport } -
trunk/Forms/UFormImportSource.lfm
r20 r22 10 10 object EditName: TEdit 11 11 Left = 160 12 Height = 2812 Height = 34 13 13 Top = 10 14 14 Width = 432 … … 18 18 object Label1: TLabel 19 19 Left = 10 20 Height = 2 020 Height = 24 21 21 Top = 9 22 Width = 4322 Width = 56 23 23 Caption = 'Name:' 24 24 ParentColor = False … … 26 26 object Label2: TLabel 27 27 Left = 8 28 Height = 2 028 Height = 24 29 29 Top = 48 30 Width = 7830 Width = 101 31 31 Caption = 'Source URL:' 32 32 ParentColor = False … … 34 34 object EditURL: TEdit 35 35 Left = 160 36 Height = 2836 Height = 34 37 37 Top = 49 38 38 Width = 432 … … 60 60 TabOrder = 3 61 61 end 62 object Label3: TLabel 63 Left = 11 64 Height = 24 65 Top = 96 66 Width = 108 67 Caption = 'Data format:' 68 ParentColor = False 69 end 70 object ComboBox1: TComboBox 71 Left = 160 72 Height = 36 73 Top = 91 74 Width = 432 75 Anchors = [akTop, akLeft, akRight] 76 ItemHeight = 0 77 Style = csDropDownList 78 TabOrder = 4 79 end 62 80 end -
trunk/Forms/UFormImportSource.lrt
r20 r22 4 4 TFORMIMPORTSOURCE.BUTTONOK.CAPTION=Ok 5 5 TFORMIMPORTSOURCE.BUTTONCANCEL.CAPTION=Cancel 6 TFORMIMPORTSOURCE.LABEL3.CAPTION=Data format: -
trunk/Forms/UFormImportSource.pas
r20 r22 16 16 ButtonOk: TButton; 17 17 ButtonCancel: TButton; 18 ComboBox1: TComboBox; 18 19 EditName: TEdit; 19 20 EditURL: TEdit; 20 21 Label1: TLabel; 21 22 Label2: TLabel; 23 Label3: TLabel; 22 24 private 23 25 { private declarations } … … 34 36 {$R *.lfm} 35 37 38 uses 39 UFormMain; 40 36 41 { TFormImportSource } 37 42 38 43 procedure TFormImportSource.Load(ImportSource: TImportSource); 44 var 45 I: Integer; 39 46 begin 40 47 EditName.Text := ImportSource.Name; 41 48 EditURL.Text := ImportSource.URL; 49 while ComboBox1.Items.Count > FormMain.AcronymDb.ImportFormats.Count do 50 ComboBox1.Items.Delete(ComboBox1.Items.Count - 1); 51 while ComboBox1.Items.Count < FormMain.AcronymDb.ImportFormats.Count do 52 ComboBox1.Items.Add(''); 53 for I := 0 to FormMain.AcronymDb.ImportFormats.Count - 1 do begin 54 ComboBox1.Items[I] := TImportFormat(FormMain.AcronymDb.ImportFormats[I]).Name; 55 ComboBox1.Items.Objects[I] := FormMain.AcronymDb.ImportFormats[I]; 56 end; 57 ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format); 58 if (ComboBox1.ItemIndex = -1) and (ComboBox1.Items.Count > 0) then 59 ComboBox1.ItemIndex := 0; 42 60 end; 43 61 … … 46 64 ImportSource.Name := EditName.Text; 47 65 ImportSource.URL := EditURL.Text; 66 ImportSource.Format := TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]); 48 67 end; 49 68 -
trunk/Forms/UFormImportSources.lfm
r20 r22 22 22 item 23 23 Caption = 'URL' 24 Width = 30024 Width = 407 25 25 end> 26 26 MultiSelect = True … … 54 54 ShortCut = 13 55 55 end 56 object AProcess: TAction 57 Caption = 'Process' 58 OnExecute = AProcessExecute 59 end 56 60 end 57 61 object PopupMenuImportSource: TPopupMenu … … 68 72 Action = ARemove 69 73 end 74 object MenuItem4: TMenuItem 75 Action = AProcess 76 end 70 77 end 71 78 end -
trunk/Forms/UFormImportSources.lrt
r20 r22 5 5 TFORMIMPORTSOURCES.AREMOVE.CAPTION=Remove 6 6 TFORMIMPORTSOURCES.AMODIFY.CAPTION=Modify 7 TFORMIMPORTSOURCES.APROCESS.CAPTION=Process -
trunk/Forms/UFormImportSources.pas
r20 r22 15 15 TFormImportSources = class(TForm) 16 16 AAdd: TAction; 17 AProcess: TAction; 17 18 ActionList1: TActionList; 18 19 AModify: TAction; … … 22 23 MenuItem2: TMenuItem; 23 24 MenuItem3: TMenuItem; 25 MenuItem4: TMenuItem; 24 26 PopupMenuImportSource: TPopupMenu; 25 27 procedure AAddExecute(Sender: TObject); 26 28 procedure AModifyExecute(Sender: TObject); 29 procedure AProcessExecute(Sender: TObject); 27 30 procedure ARemoveExecute(Sender: TObject); 28 31 procedure FormShow(Sender: TObject); … … 50 53 51 54 resourcestring 52 SImportSource = 'Import source';53 SImportSourceQuery = 'Enter name of import source';54 55 SRemoveImportSource = 'Remove import sources'; 55 56 SRemoveImportSourceQuery = 'Do you really want to remove selected import sources?'; … … 143 144 end; 144 145 146 procedure TFormImportSources.AProcessExecute(Sender: TObject); 147 begin 148 if Assigned(ListView1.Selected) then 149 TImportSource(ListView1.Selected.Data).Process; 150 end; 151 145 152 procedure TFormImportSources.ARemoveExecute(Sender: TObject); 146 153 var -
trunk/Forms/UFormMain.lfm
r21 r22 13 13 OnDestroy = FormDestroy 14 14 OnShow = FormShow 15 LCLVersion = '1. 7'15 LCLVersion = '1.6.0.4' 16 16 object ListViewAcronyms: TListView 17 17 Left = 8 … … 4371 4371 Images = ImageList1 4372 4372 left = 464 4373 top = 1 444373 top = 160 4374 4374 object AExit: TAction 4375 4375 Caption = 'Exit' … … 4424 4424 OnExecute = AShowAboutExecute 4425 4425 end 4426 object AShowImportFormats: TAction 4427 Caption = 'Import formats' 4428 OnExecute = AShowImportFormatsExecute 4429 end 4430 object AProcessImports: TAction 4431 Caption = 'Process imports' 4432 OnExecute = AProcessImportsExecute 4433 end 4426 4434 end 4427 4435 object PersistentForm1: TPersistentForm … … 4473 4481 Action = AShowImportSources 4474 4482 end 4483 object MenuItem7: TMenuItem 4484 Action = AShowImportFormats 4485 end 4475 4486 end 4476 4487 object MenuItem16: TMenuItem … … 4478 4489 object MenuItem17: TMenuItem 4479 4490 Action = AImport 4491 end 4492 object MenuItem23: TMenuItem 4493 Action = AProcessImports 4480 4494 end 4481 4495 object MenuItem18: TMenuItem … … 4516 4530 Order = soUp 4517 4531 left = 464 4518 top = 2 084532 top = 224 4519 4533 end 4520 4534 object ImageList1: TImageList -
trunk/Forms/UFormMain.lrt
r21 r22 17 17 TFORMMAIN.ASHOWIMPORTSOURCES.CAPTION=Import sources 18 18 TFORMMAIN.ASHOWABOUT.CAPTION=About 19 TFORMMAIN.ASHOWIMPORTFORMATS.CAPTION=Import formats 20 TFORMMAIN.APROCESSIMPORTS.CAPTION=Process imports 19 21 TFORMMAIN.MENUITEM8.CAPTION=File 20 22 TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent -
trunk/Forms/UFormMain.pas
r21 r22 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, UPersistentForm, Contnrs,9 ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, UPersistentForm, 10 10 URegistry, ULastOpenedList, UListViewSort, UCoolTranslator, Registry, 11 11 SpecializedList, LazUTF8; … … 16 16 17 17 TFormMain = class(TForm) 18 AProcessImports: TAction; 19 AShowImportFormats: TAction; 18 20 AShowAbout: TAction; 19 21 AShowImportSources: TAction; … … 52 54 MenuItem21: TMenuItem; 53 55 MenuItem22: TMenuItem; 56 MenuItem23: TMenuItem; 54 57 MenuItem4: TMenuItem; 55 58 MenuItem5: TMenuItem; 56 59 MenuItem6: TMenuItem; 60 MenuItem7: TMenuItem; 57 61 MenuItemOpenRecent: TMenuItem; 58 62 MenuItem2: TMenuItem; … … 72 76 procedure AFileSaveExecute(Sender: TObject); 73 77 procedure AImportExecute(Sender: TObject); 78 procedure AProcessImportsExecute(Sender: TObject); 74 79 procedure ASettingsExecute(Sender: TObject); 75 80 procedure AShowAboutExecute(Sender: TObject); … … 77 82 procedure AShowCategoriesExecute(Sender: TObject); 78 83 procedure AShowExecute(Sender: TObject); 84 procedure AShowImportFormatsExecute(Sender: TObject); 79 85 procedure AShowImportSourcesExecute(Sender: TObject); 80 86 procedure CheckBoxExactMathChange(Sender: TObject); … … 118 124 119 125 uses 120 UFormImport, UForm Acronym, UFormSettings, UFormCategories, UFormAcronyms,121 UFormImportSource , UFormImportSources, UFormAbout;126 UFormImport, UFormSettings, UFormCategories, UFormAcronyms, 127 UFormImportSources, UFormAbout, UFormImportFormats; 122 128 123 129 resourcestring … … 243 249 end; 244 250 251 procedure TFormMain.AProcessImportsExecute(Sender: TObject); 252 var 253 I: Integer; 254 begin 255 for I := 0 to AcronymDb.ImportSources.Count - 1 do 256 TImportSource(AcronymDb.ImportSources[I]).Process; 257 UpdateAcronymsList; 258 UpdateInterface; 259 end; 260 245 261 procedure TFormMain.ASettingsExecute(Sender: TObject); 246 262 begin … … 271 287 begin 272 288 Show; 289 end; 290 291 procedure TFormMain.AShowImportFormatsExecute(Sender: TObject); 292 begin 293 FormImportFormats.ImportFormats := AcronymDb.ImportFormats; 294 FormImportFormats.ShowModal; 295 UpdateInterface; 273 296 end; 274 297
Note:
See TracChangeset
for help on using the changeset viewer.