Ignore:
Timestamp:
Jan 24, 2017, 4:34:36 PM (7 years ago)
Author:
chronos
Message:
  • Added: A context menu from main acronym filter list to show selected acronym in Acronyms window for its further management.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAcronyms.pas

    r123 r146  
    5454    procedure UpdateAcronymsList;
    5555  public
     56    FocusAcronym: TAcronymMeaning;
    5657    procedure UpdateInterface;
    5758  end;
     
    110111
    111112procedure TFormAcronyms.FormShow(Sender: TObject);
     113var
     114  I: Integer;
    112115begin
    113116  Core.PersistentForm1.Load(Self);
     
    115118  UpdateAcronymsList;
    116119  Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI);
     120
     121  // Focus line with acronym
     122  if Assigned(FocusAcronym) then begin
     123    I := 0;
     124    while (I < ListViewAcronyms.Items.Count) and (ListViewAcronyms.Items[I].Data <> FocusAcronym) do Inc(I);
     125    if I < ListViewAcronyms.Items.Count then begin
     126      ListViewAcronyms.ItemIndex := I;
     127      ListViewAcronyms.Selected.Focused := True;
     128    end;
     129    if ListViewAcronyms.Selected <> nil then
     130      ListViewAcronyms.Selected.MakeVisible(False);
     131  end;
    117132end;
    118133
     
    235250  I: Integer;
    236251begin
     252  FocusAcronym := nil;
     253  MeaningCount := 0;
    237254  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    238255  for I := 0 to ToolBar1.ButtonCount - 1 do
Note: See TracChangeset for help on using the changeset viewer.