Changeset 146


Ignore:
Timestamp:
Jan 24, 2017, 4:34:36 PM (8 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.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAcronyms.lfm

    r123 r146  
    1111  OnShow = FormShow
    1212  Position = poScreenCenter
    13   LCLVersion = '1.6.0.4'
     13  LCLVersion = '1.6.2.0'
    1414  object ListViewAcronyms: TListView
    1515    Left = 4
  • 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
  • trunk/Forms/UFormMain.lfm

    r144 r146  
    5353        end>
    5454      OwnerData = True
     55      PopupMenu = PopupMenuFilter
    5556      ReadOnly = True
    5657      RowSelect = True
     
    377378      OnExecute = AFilterSameLetterCaseExecute
    378379    end
     380    object AManageAcronym: TAction
     381      Caption = 'Manage acronym'
     382      OnExecute = AManageAcronymExecute
     383    end
    379384  end
    380385  object MainMenu1: TMainMenu
     
    954959    top = 280
    955960  end
     961  object PopupMenuFilter: TPopupMenu
     962    left = 276
     963    top = 145
     964    object MenuItem1: TMenuItem
     965      Action = AManageAcronym
     966    end
     967  end
    956968end
  • trunk/Forms/UFormMain.lrt

    r144 r146  
    2222TFORMMAIN.AFILTERSAMELENGTH.CAPTION=Same length
    2323TFORMMAIN.AFILTERSAMELETTERCASE.CAPTION=Same letter case
     24TFORMMAIN.AMANAGEACRONYM.CAPTION=Manage acronym
    2425TFORMMAIN.MENUITEM8.CAPTION=File
    2526TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
  • trunk/Forms/UFormMain.pas

    r145 r146  
    1616
    1717  TFormMain = class(TForm)
     18    AManageAcronym: TAction;
    1819    AFilterSameLetterCase: TAction;
    1920    AFilterSameLength: TAction;
     
    4445    ListViewSort1: TListViewSort;
    4546    MainMenu1: TMainMenu;
     47    MenuItem1: TMenuItem;
    4648    MenuItemParam: TMenuItem;
    4749    MenuItem10: TMenuItem;
     
    7173    PanelParam: TPanel;
    7274    PanelMain: TPanel;
     75    PopupMenuFilter: TPopupMenu;
    7376    PopupMenuOpenRecent: TPopupMenu;
    7477    SaveDialog1: TSaveDialog;
     
    100103    procedure AHideExecute(Sender: TObject);
    101104    procedure AImportExecute(Sender: TObject);
     105    procedure AManageAcronymExecute(Sender: TObject);
    102106    procedure AProcessImportsExecute(Sender: TObject);
    103107    procedure ASettingsExecute(Sender: TObject);
     
    320324end;
    321325
     326procedure TFormMain.AManageAcronymExecute(Sender: TObject);
     327begin
     328  FormAcronyms := TFormAcronyms.Create(Self);
     329  try
     330    if Assigned(ListViewAcronyms.Selected) then
     331      FormAcronyms.FocusAcronym := ListViewAcronyms.Selected.Data;
     332    FormAcronyms.ShowModal;
     333    UpdateAcronymsList;
     334    UpdateInterface;
     335  finally
     336    FreeAndNil(FormAcronyms);
     337  end;
     338end;
     339
    322340procedure TFormMain.AProcessImportsExecute(Sender: TObject);
    323341begin
  • trunk/Languages/AcronymDecoder.cs.po

    r145 r146  
    566566msgstr "Import"
    567567
     568#: tformmain.amanageacronym.caption
     569msgid "Manage acronym"
     570msgstr "Spravovat zkratku"
     571
    568572#: tformmain.aprocessimports.caption
    569573msgid "Process imports"
  • trunk/Languages/AcronymDecoder.po

    r145 r146  
    556556msgstr ""
    557557
     558#: tformmain.amanageacronym.caption
     559msgid "Manage acronym"
     560msgstr ""
     561
    558562#: tformmain.aprocessimports.caption
    559563msgid "Process imports"
Note: See TracChangeset for help on using the changeset viewer.