Changeset 152


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.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r151 r152  
    11object FormMain: TFormMain
    22  Left = 495
    3   Height = 447
    4   Top = 424
    5   Width = 782
     3  Height = 482
     4  Top = 389
     5  Width = 798
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 422
    8   ClientWidth = 782
     7  ClientHeight = 457
     8  ClientWidth = 798
    99  Menu = MainMenu1
    1010  OnClose = FormClose
     
    1717  object PanelMain: TPanel
    1818    Left = 0
    19     Height = 360
     19    Height = 395
    2020    Top = 62
    21     Width = 782
     21    Width = 798
    2222    Align = alClient
    2323    BevelOuter = bvNone
    24     ClientHeight = 360
    25     ClientWidth = 782
     24    ClientHeight = 395
     25    ClientWidth = 798
    2626    TabOrder = 0
    27     object ListViewFilter1: TListViewFilter
    28       Left = 8
    29       Height = 30
    30       Top = 5
    31       Width = 767
    32       OnChange = ListViewFilter1Change
    33       Anchors = [akTop, akLeft, akRight]
    34     end
    35     object ListViewAcronyms: TListView
    36       Left = 8
    37       Height = 318
    38       Top = 35
    39       Width = 767
    40       Anchors = [akTop, akLeft, akRight, akBottom]
    41       Columns = <     
     27    object StatusBar1: TStatusBar
     28      Left = 0
     29      Height = 28
     30      Top = 367
     31      Width = 798
     32      Panels = <     
    4233        item
    43           Caption = 'Name'
    44           Width = 100
     34          Width = 200
    4535        end     
    4636        item
    47           Caption = 'Meaning'
    48           Width = 300
    49         end     
    50         item
    51           Caption = 'Categories'
    52           Width = 347
     37          Width = 200
    5338        end>
    54       OwnerData = True
    55       PopupMenu = PopupMenuFilter
    56       ReadOnly = True
    57       RowSelect = True
    58       TabOrder = 1
    59       ViewStyle = vsReport
    60       OnData = ListViewAcronymsData
    61       OnResize = ListViewAcronymsResize
    62       OnSelectItem = ListViewAcronymsSelectItem
     39      SimplePanel = False
     40    end
     41    object Panel1: TPanel
     42      Left = 0
     43      Height = 367
     44      Top = 0
     45      Width = 798
     46      Align = alClient
     47      BevelOuter = bvNone
     48      TabOrder = 3
     49      object ListViewFilter1: TListViewFilter
     50        Left = 8
     51        Height = 30
     52        Top = 5
     53        Width = 783
     54        OnChange = ListViewFilter1Change
     55        Anchors = [akTop, akLeft, akRight]
     56      end
     57      object ListViewAcronyms: TListView
     58        Left = 8
     59        Height = 326
     60        Top = 35
     61        Width = 784
     62        Anchors = [akTop, akLeft, akRight, akBottom]
     63        Columns = <     
     64          item
     65            Caption = 'Name'
     66            Width = 100
     67          end     
     68          item
     69            Caption = 'Meaning'
     70            Width = 300
     71          end     
     72          item
     73            Caption = 'Categories'
     74            Width = 347
     75          end>
     76        OwnerData = True
     77        PopupMenu = PopupMenuFilter
     78        ReadOnly = True
     79        RowSelect = True
     80        TabOrder = 1
     81        ViewStyle = vsReport
     82        OnData = ListViewAcronymsData
     83        OnResize = ListViewAcronymsResize
     84        OnSelectItem = ListViewAcronymsSelectItem
     85      end
    6386    end
    6487  end
     
    6790    Height = 30
    6891    Top = 32
    69     Width = 782
     92    Width = 798
    7093    Align = alTop
    7194    BevelOuter = bvNone
    7295    ClientHeight = 30
    73     ClientWidth = 782
     96    ClientWidth = 798
    7497    TabOrder = 1
    7598    object CheckBoxExactLength: TCheckBox
     
    102125    Height = 32
    103126    Top = 0
    104     Width = 782
     127    Width = 798
    105128    AutoSize = True
    106129    Bands = <   
     
    819842        OnClick = MenuItemParamClick
    820843      end
     844      object MenuItemStatusBar: TMenuItem
     845        Caption = 'Status bar'
     846        OnClick = MenuItemStatusBarClick
     847      end
    821848    end
    822849    object MenuItem16: TMenuItem
  • trunk/Forms/UFormMain.lrt

    r149 r152  
    3131TFORMMAIN.MENUITEMTOOLBAR.CAPTION=Toolbar
    3232TFORMMAIN.MENUITEMPARAM.CAPTION=Filter parameters
     33TFORMMAIN.MENUITEMSTATUSBAR.CAPTION=Status bar
    3334TFORMMAIN.MENUITEM16.CAPTION=Tools
    3435TFORMMAIN.MENUITEM5.CAPTION=Help
  • 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
  • trunk/Languages/AcronymDecoder.cs.po

    r151 r152  
    666666msgstr "Parametry filtru"
    667667
     668#: tformmain.menuitemstatusbar.caption
     669msgid "Status bar"
     670msgstr "Stavová lišta"
     671
    668672#: tformmain.menuitemtoolbar.caption
    669673msgid "Toolbar"
  • trunk/Languages/AcronymDecoder.po

    r151 r152  
    656656msgstr ""
    657657
     658#: tformmain.menuitemstatusbar.caption
     659msgid "Status bar"
     660msgstr ""
     661
    658662#: tformmain.menuitemtoolbar.caption
    659663msgid "Toolbar"
  • trunk/UAcronym.pas

    r148 r152  
    235235    procedure SaveToFileCSV(FileName: string);
    236236    procedure FilterList(AName: string; Items: TAcronymMeanings);
     237    function GetMeaningsCount: Integer;
    237238    function AddAcronym(AcronymName, MeaningName: string): TAcronymMeaning;
    238239    procedure RemoveMeaning(Meaning: TAcronymMeaning);
     
    16501651end;
    16511652
     1653function TAcronymDb.GetMeaningsCount: Integer;
     1654var
     1655  I: Integer;
     1656begin
     1657  Result := 0;
     1658  for I := 0 to Acronyms.Count - 1 do
     1659    Result := Result + TAcronym(Acronyms[I]).Meanings.Count;
     1660end;
     1661
    16521662function TAcronymDb.AddAcronym(AcronymName, MeaningName: string): TAcronymMeaning;
    16531663var
Note: See TracChangeset for help on using the changeset viewer.