Changeset 22 for trunk/Forms/UFormImportSource.pas
- Timestamp:
- May 4, 2016, 11:43:42 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.