Changeset 89 for trunk/Forms/UFormAcronym.pas
- Timestamp:
- Aug 9, 2016, 10:53:36 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAcronym.pas
r85 r89 27 27 Label3: TLabel; 28 28 Label4: TLabel; 29 ListBox1: TListBox; 29 Label5: TLabel; 30 ListBoxCategories: TListBox; 31 ListBoxImportSources: TListBox; 30 32 MemoDescription: TMemo; 31 33 MenuItem1: TMenuItem; … … 36 38 procedure EditMeaningKeyPress(Sender: TObject; var Key: char); 37 39 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 40 procedure FormCreate(Sender: TObject); 38 41 procedure FormShow(Sender: TObject); 39 procedure ListBox 1SelectionChange(Sender: TObject; User: boolean);42 procedure ListBoxCategoriesSelectionChange(Sender: TObject; User: boolean); 40 43 private 41 44 procedure UpdateInterface; … … 63 66 end; 64 67 68 procedure TFormAcronym.FormCreate(Sender: TObject); 69 begin 70 71 end; 72 65 73 procedure TFormAcronym.ACategoryAddExecute(Sender: TObject); 66 74 var 67 75 I: Integer; 68 76 begin 69 FormCategorySelect.Load(ListBox 1.Items);77 FormCategorySelect.Load(ListBoxCategories.Items); 70 78 if FormCategorySelect.ShowModal = mrOk then begin 71 79 for I := 0 to FormCategorySelect.ListBox1.Count - 1 do 72 80 if FormCategorySelect.ListBox1.Selected[I] then begin 73 ListBox 1.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]);81 ListBoxCategories.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]); 74 82 end; 75 83 end; … … 82 90 if MessageDlg(SRemoveCategory, SRemoveCategoryQuery, 83 91 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 84 for I := ListBox 1.Items.Count - 1 downto 0 do85 if ListBox 1.Selected[I] then86 ListBox 1.Items.Delete(I);92 for I := ListBoxCategories.Items.Count - 1 downto 0 do 93 if ListBoxCategories.Selected[I] then 94 ListBoxCategories.Items.Delete(I); 87 95 UpdateInterface; 88 96 end; … … 101 109 end; 102 110 103 procedure TFormAcronym.ListBox 1SelectionChange(Sender: TObject; User: boolean);111 procedure TFormAcronym.ListBoxCategoriesSelectionChange(Sender: TObject; User: boolean); 104 112 begin 105 113 UpdateInterface; … … 108 116 procedure TFormAcronym.UpdateInterface; 109 117 begin 110 ACategoryRemove.Enabled := ListBox 1.ItemIndex <> -1;118 ACategoryRemove.Enabled := ListBoxCategories.ItemIndex <> -1; 111 119 end; 112 120 … … 116 124 EditMeaning.Text := Entry.Meaning; 117 125 MemoDescription.Text := Entry.Description; 118 ListBox1.Items.Assign(Entry.Categories); 126 ListBoxCategories.Items.Assign(Entry.Categories); 127 ListBoxImportSources.Items.Assign(Entry.Sources); 119 128 end; 120 129 … … 124 133 Entry.Meaning := EditMeaning.Text; 125 134 Entry.Description := MemoDescription.Text; 126 Entry.Categories.Assign(ListBox 1.Items);135 Entry.Categories.Assign(ListBoxCategories.Items); 127 136 end; 128 137
Note:
See TracChangeset
for help on using the changeset viewer.