Changeset 121


Ignore:
Timestamp:
Nov 26, 2016, 12:09:42 AM (8 years ago)
Author:
chronos
Message:
  • Added: Option to filter acronyms by same letters case.
  • Added: Search filter in main window can be hidden from View menu.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r112 r121  
    11object FormMain: TFormMain
    2   Left = 460
     2  Left = 718
    33  Height = 447
    4   Top = 289
     4  Top = 663
    55  Width = 782
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 422
     7  ClientHeight = 415
    88  ClientWidth = 782
    99  Menu = MainMenu1
     
    1515  OnShow = FormShow
    1616  LCLVersion = '1.6.0.4'
    17   object Panel1: TPanel
     17  object PanelMain: TPanel
    1818    Left = 0
    19     Height = 396
    20     Top = 26
     19    Height = 359
     20    Top = 56
    2121    Width = 782
    2222    Align = alClient
    2323    BevelOuter = bvNone
    24     ClientHeight = 396
     24    ClientHeight = 359
    2525    ClientWidth = 782
    2626    TabOrder = 1
    27     object CheckBoxExactMath: TCheckBox
    28       Left = 8
    29       Height = 24
    30       Top = 3
    31       Width = 104
    32       Caption = 'Exact match'
    33       OnChange = CheckBoxExactMathChange
    34       TabOrder = 0
    35     end
    3627    object ListViewFilter1: TListViewFilter
    3728      Left = 8
    3829      Height = 30
    39       Top = 32
     30      Top = 5
    4031      Width = 767
    4132      OnChange = ListViewFilter1Change
     
    4435    object ListViewAcronyms: TListView
    4536      Left = 8
    46       Height = 324
    47       Top = 64
     37      Height = 318
     38      Top = 34
    4839      Width = 767
    4940      Anchors = [akTop, akLeft, akRight, akBottom]
     
    6455      ReadOnly = True
    6556      RowSelect = True
    66       TabOrder = 2
     57      TabOrder = 1
    6758      ViewStyle = vsReport
    6859      OnData = ListViewAcronymsData
     
    150141    end
    151142  end
     143  object PanelParam: TPanel
     144    Left = 0
     145    Height = 30
     146    Top = 26
     147    Width = 782
     148    Align = alTop
     149    BevelOuter = bvNone
     150    ClientHeight = 30
     151    ClientWidth = 782
     152    TabOrder = 2
     153    object CheckBoxExactMatch: TCheckBox
     154      Left = 8
     155      Height = 28
     156      Top = 3
     157      Width = 129
     158      Caption = 'Exact match'
     159      OnChange = CheckBoxExactMatchChange
     160      TabOrder = 0
     161    end
     162    object CheckBoxCaseSensitive: TCheckBox
     163      Left = 216
     164      Height = 28
     165      Top = 3
     166      Width = 144
     167      Caption = 'Case sensitive'
     168      OnChange = CheckBoxExactMatchChange
     169      TabOrder = 1
     170    end
     171  end
    152172  object ActionList1: TActionList
    153173    Images = Core.ImageList1
     
    298318        OnClick = MenuItemToolbarClick
    299319      end
     320      object MenuItemParam: TMenuItem
     321        Caption = 'Filter parameters'
     322        OnClick = MenuItemParamClick
     323      end
    300324    end
    301325    object MenuItem16: TMenuItem
     
    340364    OnFilter = ListViewSort1Filter
    341365    OnColumnWidthChanged = ListViewSort1ColumnWidthChanged
    342     Column = 0
    343     Order = soUp
     366    Column = 2
     367    Order = soDown
    344368    left = 472
    345369    top = 256
  • trunk/Forms/UFormMain.lrt

    r102 r121  
    11TFORMMAIN.CAPTION=Acronym Decoder
    2 TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match
    32TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[0].CAPTION=Name
    43TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Meaning
     
    76TFORMMAIN.TOOLBUTTON8.CAPTION=ToolButton8
    87TFORMMAIN.TOOLBUTTON10.CAPTION=ToolButton10
     8TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match
     9TFORMMAIN.CHECKBOXCASESENSITIVE.CAPTION=Case sensitive
    910TFORMMAIN.AEXIT.CAPTION=Exit
    1011TFORMMAIN.ASHOW.CAPTION=Show
     
    3031TFORMMAIN.MENUITEM24.CAPTION=-
    3132TFORMMAIN.MENUITEMTOOLBAR.CAPTION=Toolbar
     33TFORMMAIN.MENUITEMPARAM.CAPTION=Filter parameters
    3234TFORMMAIN.MENUITEM16.CAPTION=Tools
    3335TFORMMAIN.MENUITEM5.CAPTION=Help
  • trunk/Forms/UFormMain.pas

    r112 r121  
    3434    AExit: TAction;
    3535    ActionList1: TActionList;
    36     CheckBoxExactMath: TCheckBox;
     36    CheckBoxExactMatch: TCheckBox;
     37    CheckBoxCaseSensitive: TCheckBox;
    3738    LastOpenedList1: TLastOpenedList;
    3839    ListViewAcronyms: TListView;
     
    4041    ListViewSort1: TListViewSort;
    4142    MainMenu1: TMainMenu;
     43    MenuItemParam: TMenuItem;
    4244    MenuItem10: TMenuItem;
    4345    MenuItem11: TMenuItem;
     
    6466    MenuItem9: TMenuItem;
    6567    OpenDialog1: TOpenDialog;
    66     Panel1: TPanel;
     68    PanelParam: TPanel;
     69    PanelMain: TPanel;
    6770    PopupMenuOpenRecent: TPopupMenu;
    6871    SaveDialog1: TSaveDialog;
     
    97100    procedure AShowImportFormatsExecute(Sender: TObject);
    98101    procedure AShowImportSourcesExecute(Sender: TObject);
    99     procedure CheckBoxExactMathChange(Sender: TObject);
     102    procedure CheckBoxExactMatchChange(Sender: TObject);
    100103    procedure EditSearchChange(Sender: TObject);
    101104    procedure FormHide(Sender: TObject);
     
    114117    function ListViewSort1CompareItem(Item1, Item2: TObject): Integer;
    115118    procedure ListViewSort1Filter(ListViewSort: TListViewSort);
     119    procedure MenuItemParamClick(Sender: TObject);
    116120    procedure MenuItemToolbarClick(Sender: TObject);
    117121  private
     
    119123    ProjectClosed: Boolean;
    120124    ImportTotalItemCount: Integer;
     125    function GetFilteredCase(Text: string): string;
    121126    procedure ProcessImportsJob(Job: TJob);
    122127    procedure FilterList(List: TListObject);
     
    398403end;
    399404
    400 procedure TFormMain.CheckBoxExactMathChange(Sender: TObject);
     405procedure TFormMain.CheckBoxExactMatchChange(Sender: TObject);
    401406begin
    402407  UpdateAcronymsList;
     
    479484end;
    480485
     486procedure TFormMain.MenuItemParamClick(Sender: TObject);
     487begin
     488  MenuItemParam.Checked := not MenuItemParam.Checked;
     489  UpdateInterface;
     490end;
     491
    481492procedure TFormMain.MenuItemToolbarClick(Sender: TObject);
    482493begin
    483494  MenuItemToolbar.Checked := not MenuItemToolbar.Checked;
    484495  UpdateInterface;
     496end;
     497
     498function TFormMain.GetFilteredCase(Text: string): string;
     499begin
     500  if not CheckBoxCaseSensitive.Checked then Result := UTF8LowerCase(Text)
     501    else Result := Text;
    485502end;
    486503
     
    526543         if Visible and (EnteredCount > 0) then begin
    527544           FoundCount := 0;
    528            if CheckBoxExactMath.Checked then begin
    529              if TextEnteredColumn(0) and (StringGrid.Cells[0, 0] =
    530                TAcronymMeaning(List.Items[I]).Acronym.Name) then Inc(FoundCount);
    531              if TextEnteredColumn(1) and (StringGrid.Cells[1, 0] =
    532                TAcronymMeaning(List.Items[I]).Name) then Inc(FoundCount);
    533              if TextEnteredColumn(2) and (StringGrid.Cells[2, 0] =
    534                TAcronymMeaning(List.Items[I]).Categories.GetString) then Inc(FoundCount);
     545           if CheckBoxExactMatch.Checked then begin
     546             if TextEnteredColumn(0) and (GetFilteredCase(StringGrid.Cells[0, 0]) =
     547               GetFilteredCase(TAcronymMeaning(List.Items[I]).Acronym.Name)) then Inc(FoundCount);
     548             if TextEnteredColumn(1) and (GetFilteredCase(StringGrid.Cells[1, 0]) =
     549               GetFilteredCase(TAcronymMeaning(List.Items[I]).Name)) then Inc(FoundCount);
     550             if TextEnteredColumn(2) and (GetFilteredCase(StringGrid.Cells[2, 0]) =
     551               GetFilteredCase(TAcronymMeaning(List.Items[I]).Categories.GetString)) then Inc(FoundCount);
    535552           end else begin
    536              if Pos(UTF8LowerCase(StringGrid.Cells[0, 0]),
    537                UTF8LowerCase(TAcronymMeaning(List.Items[I]).Acronym.Name)) > 0 then Inc(FoundCount);
    538              if Pos(UTF8LowerCase(StringGrid.Cells[1, 0]),
    539                UTF8LowerCase(TAcronymMeaning(List.Items[I]).Name)) > 0 then Inc(FoundCount);
    540              if Pos(UTF8LowerCase(StringGrid.Cells[2, 0]),
    541                UTF8LowerCase(TAcronymMeaning(List.Items[I]).Categories.GetString)) > 0 then Inc(FoundCount);
     553             if Pos(GetFilteredCase(StringGrid.Cells[0, 0]),
     554               GetFilteredCase(TAcronymMeaning(List.Items[I]).Acronym.Name)) > 0 then Inc(FoundCount);
     555             if Pos(GetFilteredCase(StringGrid.Cells[1, 0]),
     556               GetFilteredCase(TAcronymMeaning(List.Items[I]).Name)) > 0 then Inc(FoundCount);
     557             if Pos(GetFilteredCase(StringGrid.Cells[2, 0]),
     558               GetFilteredCase(TAcronymMeaning(List.Items[I]).Categories.GetString)) > 0 then Inc(FoundCount);
    542559           end;
    543560           if FoundCount <> EnteredCount then List.Delete(I);
     
    591608  AShowImportFormats.Enabled := Assigned(Core.AcronymDb);
    592609  ToolBar1.Visible := MenuItemToolbar.Checked;
     610  PanelParam.Visible := MenuItemParam.Checked;
    593611  AHide.Enabled := FormMain.Visible;
    594612
     
    622640    Core.AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False);
    623641    Core.StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False);
    624     CheckBoxExactMath.Checked := ReadBoolWithDefault('ExactMatch', False);
     642    CheckBoxExactMatch.Checked := ReadBoolWithDefault('ExactMatch', False);
     643    CheckBoxCaseSensitive.Checked := ReadBoolWithDefault('CaseSensitive', False);
    625644    MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True);
     645    MenuItemParam.Checked := ReadBoolWithDefault('FilterParamVisible', True);
    626646  finally
    627647    Free;
     
    652672    WriteBool('AlwaysOnTop', Core.AlwaysOnTop);
    653673    WriteBool('StartMinimizedToTray', Core.StartMinimizedToTray);
    654     WriteBool('ExactMatch', CheckBoxExactMath.Checked);
     674    WriteBool('ExactMatch', CheckBoxExactMatch.Checked);
     675    WriteBool('CaseSensitive', CheckBoxCaseSensitive.Checked);
    655676    WriteBool('ToolBarVisible', MenuItemToolbar.Checked);
     677    WriteBool('FilterParamVisible', MenuItemParam.Checked);
    656678  finally
    657679    Free;
  • trunk/Languages/AcronymDecoder.cs.po

    r107 r121  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111"Language: cs\n"
    12 "X-Generator: Poedit 1.8.8\n"
     12"X-Generator: Poedit 1.8.9\n"
    1313
    1414#: tformabout.buttonclose.caption
     
    579579msgstr "Acronym Decoder"
    580580
     581#: tformmain.checkboxcasesensitive.caption
     582msgid "Case sensitive"
     583msgstr "Velikosti písmen"
     584
    581585#: tformmain.checkboxexactmath.caption
    582586msgid "Exact match"
     
    628632msgstr "Otevřít nedávné"
    629633
     634#: tformmain.menuitemparam.caption
     635msgid "Filter parameters"
     636msgstr "Parametry filtru"
     637
    630638#: tformmain.menuitemtoolbar.caption
    631639msgid "Toolbar"
     
    898906msgid "Process import sources"
    899907msgstr "Zpracovat zdroje importu"
    900 
  • trunk/Languages/AcronymDecoder.po

    r105 r121  
    569569msgstr ""
    570570
     571#: tformmain.checkboxcasesensitive.caption
     572msgid "Case sensitive"
     573msgstr ""
     574
    571575#: tformmain.checkboxexactmath.caption
    572576msgid "Exact match"
     
    618622msgstr ""
    619623
     624#: tformmain.menuitemparam.caption
     625msgid "Filter parameters"
     626msgstr ""
     627
    620628#: tformmain.menuitemtoolbar.caption
    621629msgid "Toolbar"
Note: See TracChangeset for help on using the changeset viewer.