Ignore:
Timestamp:
Aug 9, 2016, 10:53:36 PM (8 years ago)
Author:
chronos
Message:
  • Added: Show from which imports acronym meanings comes from.

This would easy correcting wrong acronyms directly in source.

  • Modified: References to categories stored more efficiently in XML project file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAcronym.pas

    r85 r89  
    2727    Label3: TLabel;
    2828    Label4: TLabel;
    29     ListBox1: TListBox;
     29    Label5: TLabel;
     30    ListBoxCategories: TListBox;
     31    ListBoxImportSources: TListBox;
    3032    MemoDescription: TMemo;
    3133    MenuItem1: TMenuItem;
     
    3638    procedure EditMeaningKeyPress(Sender: TObject; var Key: char);
    3739    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     40    procedure FormCreate(Sender: TObject);
    3841    procedure FormShow(Sender: TObject);
    39     procedure ListBox1SelectionChange(Sender: TObject; User: boolean);
     42    procedure ListBoxCategoriesSelectionChange(Sender: TObject; User: boolean);
    4043  private
    4144    procedure UpdateInterface;
     
    6366end;
    6467
     68procedure TFormAcronym.FormCreate(Sender: TObject);
     69begin
     70
     71end;
     72
    6573procedure TFormAcronym.ACategoryAddExecute(Sender: TObject);
    6674var
    6775  I: Integer;
    6876begin
    69   FormCategorySelect.Load(ListBox1.Items);
     77  FormCategorySelect.Load(ListBoxCategories.Items);
    7078  if FormCategorySelect.ShowModal = mrOk then begin
    7179    for I := 0 to FormCategorySelect.ListBox1.Count - 1 do
    7280      if FormCategorySelect.ListBox1.Selected[I] then begin
    73         ListBox1.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]);
     81        ListBoxCategories.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]);
    7482      end;
    7583  end;
     
    8290  if MessageDlg(SRemoveCategory, SRemoveCategoryQuery,
    8391  TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin
    84     for I := ListBox1.Items.Count - 1 downto 0 do
    85     if ListBox1.Selected[I] then
    86       ListBox1.Items.Delete(I);
     92    for I := ListBoxCategories.Items.Count - 1 downto 0 do
     93    if ListBoxCategories.Selected[I] then
     94      ListBoxCategories.Items.Delete(I);
    8795    UpdateInterface;
    8896  end;
     
    101109end;
    102110
    103 procedure TFormAcronym.ListBox1SelectionChange(Sender: TObject; User: boolean);
     111procedure TFormAcronym.ListBoxCategoriesSelectionChange(Sender: TObject; User: boolean);
    104112begin
    105113  UpdateInterface;
     
    108116procedure TFormAcronym.UpdateInterface;
    109117begin
    110   ACategoryRemove.Enabled := ListBox1.ItemIndex <> -1;
     118  ACategoryRemove.Enabled := ListBoxCategories.ItemIndex <> -1;
    111119end;
    112120
     
    116124  EditMeaning.Text := Entry.Meaning;
    117125  MemoDescription.Text := Entry.Description;
    118   ListBox1.Items.Assign(Entry.Categories);
     126  ListBoxCategories.Items.Assign(Entry.Categories);
     127  ListBoxImportSources.Items.Assign(Entry.Sources);
    119128end;
    120129
     
    124133  Entry.Meaning := EditMeaning.Text;
    125134  Entry.Description := MemoDescription.Text;
    126   Entry.Categories.Assign(ListBox1.Items);
     135  Entry.Categories.Assign(ListBoxCategories.Items);
    127136end;
    128137
Note: See TracChangeset for help on using the changeset viewer.