Ignore:
Timestamp:
Oct 16, 2017, 3:05:22 PM (7 years ago)
Author:
chronos
Message:
  • Added: Status bar to show total number of acronyms and their meanings. Status bar can be hidden.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r151 r152  
    4848    MainMenu1: TMainMenu;
    4949    MenuItem1: TMenuItem;
     50    MenuItemStatusBar: TMenuItem;
    5051    MenuItemParam: TMenuItem;
    5152    MenuItem10: TMenuItem;
     
    7374    MenuItem9: TMenuItem;
    7475    OpenDialog1: TOpenDialog;
     76    Panel1: TPanel;
    7577    PanelParam: TPanel;
    7678    PanelMain: TPanel;
     
    7880    PopupMenuOpenRecent: TPopupMenu;
    7981    SaveDialog1: TSaveDialog;
     82    StatusBar1: TStatusBar;
    8083    ToolBar1: TToolBar;
    8184    ToolBar2: TToolBar;
     
    133136    procedure ListViewSort1Filter(ListViewSort: TListViewSort);
    134137    procedure MenuItemParamClick(Sender: TObject);
     138    procedure MenuItemStatusBarClick(Sender: TObject);
    135139    procedure MenuItemToolbarClick(Sender: TObject);
    136140  private
     
    535539begin
    536540  MenuItemParam.Checked := not MenuItemParam.Checked;
     541  UpdateInterface;
     542end;
     543
     544procedure TFormMain.MenuItemStatusBarClick(Sender: TObject);
     545begin
     546  MenuItemStatusBar.Checked := not MenuItemStatusBar.Checked;
    537547  UpdateInterface;
    538548end;
     
    660670  AHide.Enabled := FormMain.Visible;
    661671  AManageAcronym.Enabled := Assigned(ListViewAcronyms.Selected);
     672  StatusBar1.Visible := MenuItemStatusBar.Checked;
    662673
    663674  Title := '';
     
    670681  Application.Title := Title;
    671682  Caption := Title;
     683  if Assigned(Core.AcronymDb) then begin
     684    StatusBar1.Panels[0].Text := 'Acronyms count: ' +
     685      IntToStr(Core.AcronymDb.Acronyms.Count);
     686    StatusBar1.Panels[1].Text := 'Meanings count: ' +
     687      IntToStr(Core.AcronymDb.GetMeaningsCount);
     688  end else begin
     689    StatusBar1.Panels[0].Text := '';
     690    StatusBar1.Panels[1].Text := '';
     691  end;
    672692end;
    673693
     
    693713    AFilterEnabledCategories.Checked := ReadBoolWithDefault('EnabledCategories', False);
    694714    MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True);
     715    MenuItemStatusBar.Checked := ReadBoolWithDefault('StatuslBarVisible', True);
    695716    MenuItemParam.Checked := ReadBoolWithDefault('FilterParamVisible', True);
    696717  finally
     
    721742    WriteBool('EnabledCategories', AFilterEnabledCategories.Checked);
    722743    WriteBool('ToolBarVisible', MenuItemToolbar.Checked);
     744    WriteBool('StatusBarVisible', MenuItemStatusBar.Checked);
    723745    WriteBool('FilterParamVisible', MenuItemParam.Checked);
    724746  finally
Note: See TracChangeset for help on using the changeset viewer.