Changeset 122


Ignore:
Timestamp:
Nov 26, 2016, 12:35:41 AM (8 years ago)
Author:
chronos
Message:
  • Added: Acronym search filter options also availabel as toolbar buttons.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r121 r122  
    11object FormMain: TFormMain
    2   Left = 718
     2  Left = 675
    33  Height = 447
    4   Top = 663
     4  Top = 668
    55  Width = 782
    66  Caption = 'Acronym Decoder'
     
    140140      Action = AFileClose
    141141    end
     142    object ToolButton14: TToolButton
     143      Left = 253
     144      Height = 22
     145      Top = 2
     146      Width = 5
     147      Style = tbsDivider
     148    end
     149    object ToolButton16: TToolButton
     150      Left = 258
     151      Top = 2
     152      Action = AFilterExactMatch
     153      Style = tbsCheck
     154    end
     155    object ToolButton13: TToolButton
     156      Left = 281
     157      Top = 2
     158      Action = AFilterCaseSensitive
     159      Style = tbsCheck
     160    end
    142161  end
    143162  object PanelParam: TPanel
     
    156175      Top = 3
    157176      Width = 129
    158       Caption = 'Exact match'
    159       OnChange = CheckBoxExactMatchChange
     177      Action = AFilterExactMatch
    160178      TabOrder = 0
    161179    end
     
    165183      Top = 3
    166184      Width = 144
    167       Caption = 'Case sensitive'
    168       OnChange = CheckBoxExactMatchChange
     185      Action = AFilterCaseSensitive
    169186      TabOrder = 1
    170187    end
     
    264281      Caption = 'Export'
    265282      OnExecute = AExportExecute
     283    end
     284    object AFilterExactMatch: TAction
     285      AutoCheck = True
     286      Caption = 'Exact match'
     287      ImageIndex = 18
     288      OnExecute = AFilterExactMatchExecute
     289    end
     290    object AFilterCaseSensitive: TAction
     291      AutoCheck = True
     292      Caption = 'Case sensitive'
     293      ImageIndex = 17
     294      OnExecute = AFilterCaseSensitiveExecute
    266295    end
    267296  end
  • trunk/Forms/UFormMain.lrt

    r121 r122  
    66TFORMMAIN.TOOLBUTTON8.CAPTION=ToolButton8
    77TFORMMAIN.TOOLBUTTON10.CAPTION=ToolButton10
    8 TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match
    9 TFORMMAIN.CHECKBOXCASESENSITIVE.CAPTION=Case sensitive
    108TFORMMAIN.AEXIT.CAPTION=Exit
    119TFORMMAIN.ASHOW.CAPTION=Show
     
    2523TFORMMAIN.APROCESSIMPORTS.CAPTION=Process imports
    2624TFORMMAIN.AEXPORT.CAPTION=Export
     25TFORMMAIN.AFILTEREXACTMATCH.CAPTION=Exact match
     26TFORMMAIN.AFILTERCASESENSITIVE.CAPTION=Case sensitive
    2727TFORMMAIN.MENUITEM8.CAPTION=File
    2828TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
  • trunk/Forms/UFormMain.pas

    r121 r122  
    1616
    1717  TFormMain = class(TForm)
     18    AFilterCaseSensitive: TAction;
     19    AFilterExactMatch: TAction;
    1820    AHide: TAction;
    1921    AExport: TAction;
     
    7577    ToolButton11: TToolButton;
    7678    ToolButton12: TToolButton;
     79    ToolButton13: TToolButton;
     80    ToolButton14: TToolButton;
     81    ToolButton16: TToolButton;
    7782    ToolButton2: TToolButton;
    7883    ToolButton3: TToolButton;
     
    9095    procedure AFileSaveAsExecute(Sender: TObject);
    9196    procedure AFileSaveExecute(Sender: TObject);
     97    procedure AFilterCaseSensitiveExecute(Sender: TObject);
     98    procedure AFilterExactMatchExecute(Sender: TObject);
    9299    procedure AHideExecute(Sender: TObject);
    93100    procedure AImportExecute(Sender: TObject);
     
    100107    procedure AShowImportFormatsExecute(Sender: TObject);
    101108    procedure AShowImportSourcesExecute(Sender: TObject);
    102     procedure CheckBoxExactMatchChange(Sender: TObject);
    103109    procedure EditSearchChange(Sender: TObject);
    104110    procedure FormHide(Sender: TObject);
     
    123129    ProjectClosed: Boolean;
    124130    ImportTotalItemCount: Integer;
    125     function GetFilteredCase(Text: string): string;
     131    function FilterCell(Text1, Text2: string): Boolean;
    126132    procedure ProcessImportsJob(Job: TJob);
    127133    procedure FilterList(List: TListObject);
     
    280286end;
    281287
     288procedure TFormMain.AFilterCaseSensitiveExecute(Sender: TObject);
     289begin
     290  UpdateAcronymsList;
     291end;
     292
     293procedure TFormMain.AFilterExactMatchExecute(Sender: TObject);
     294begin
     295  UpdateAcronymsList;
     296end;
     297
    282298procedure TFormMain.AHideExecute(Sender: TObject);
    283299begin
     
    401417    FreeAndNil(FormImportSources);
    402418  end;
    403 end;
    404 
    405 procedure TFormMain.CheckBoxExactMatchChange(Sender: TObject);
    406 begin
    407   UpdateAcronymsList;
    408419end;
    409420
     
    496507end;
    497508
    498 function TFormMain.GetFilteredCase(Text: string): string;
    499 begin
    500   if not CheckBoxCaseSensitive.Checked then Result := UTF8LowerCase(Text)
    501     else Result := Text;
     509function TFormMain.FilterCell(Text1, Text2: string): Boolean;
     510begin
     511  if not AFilterCaseSensitive.Checked then begin
     512    Text1 := UTF8LowerCase(Text1);
     513    Text2 := UTF8LowerCase(Text2);
     514  end;
     515  if AFilterExactMatch.Checked then
     516    Result := Text1 = Text2
     517    else Result := Pos(Text1, Text2) > 0;
    502518end;
    503519
     
    543559         if Visible and (EnteredCount > 0) then begin
    544560           FoundCount := 0;
    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);
    552            end else begin
    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);
    559            end;
     561           if TextEnteredColumn(0) and (FilterCell(StringGrid.Cells[0, 0],
     562             TAcronymMeaning(List.Items[I]).Acronym.Name)) then Inc(FoundCount);
     563           if TextEnteredColumn(1) and (FilterCell(StringGrid.Cells[1, 0],
     564             TAcronymMeaning(List.Items[I]).Name)) then Inc(FoundCount);
     565           if TextEnteredColumn(2) and (FilterCell(StringGrid.Cells[2, 0],
     566             TAcronymMeaning(List.Items[I]).Categories.GetString)) then Inc(FoundCount);
    560567           if FoundCount <> EnteredCount then List.Delete(I);
    561568         end else List.Delete(I);
     
    640647    Core.AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False);
    641648    Core.StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False);
    642     CheckBoxExactMatch.Checked := ReadBoolWithDefault('ExactMatch', False);
    643     CheckBoxCaseSensitive.Checked := ReadBoolWithDefault('CaseSensitive', False);
     649    AFilterExactMatch.Checked := ReadBoolWithDefault('ExactMatch', False);
     650    AFilterCaseSensitive.Checked := ReadBoolWithDefault('CaseSensitive', False);
    644651    MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True);
    645652    MenuItemParam.Checked := ReadBoolWithDefault('FilterParamVisible', True);
     
    672679    WriteBool('AlwaysOnTop', Core.AlwaysOnTop);
    673680    WriteBool('StartMinimizedToTray', Core.StartMinimizedToTray);
    674     WriteBool('ExactMatch', CheckBoxExactMatch.Checked);
    675     WriteBool('CaseSensitive', CheckBoxCaseSensitive.Checked);
     681    WriteBool('ExactMatch', AFilterExactMatch.Checked);
     682    WriteBool('CaseSensitive', AFilterCaseSensitive.Checked);
    676683    WriteBool('ToolBarVisible', MenuItemToolbar.Checked);
    677684    WriteBool('FilterParamVisible', MenuItemParam.Checked);
  • trunk/Languages/AcronymDecoder.cs.po

    r121 r122  
    527527msgstr "Uložit jako..."
    528528
     529#: tformmain.afiltercasesensitive.caption
     530msgctxt "tformmain.afiltercasesensitive.caption"
     531msgid "Case sensitive"
     532msgstr "Velikosti písmen"
     533
     534#: tformmain.afilterexactmatch.caption
     535msgctxt "tformmain.afilterexactmatch.caption"
     536msgid "Exact match"
     537msgstr "Odpovídá přesně"
     538
    529539#: tformmain.ahide.caption
    530540msgid "Hide"
     
    579589msgstr "Acronym Decoder"
    580590
    581 #: tformmain.checkboxcasesensitive.caption
    582 msgid "Case sensitive"
    583 msgstr "Velikosti písmen"
    584 
    585 #: tformmain.checkboxexactmath.caption
    586 msgid "Exact match"
    587 msgstr "Odpovídá přesně"
    588 
    589591#: tformmain.listviewacronyms.columns[0].caption
    590592msgctxt "tformmain.listviewacronyms.columns[0].caption"
  • trunk/Languages/AcronymDecoder.po

    r121 r122  
    517517msgstr ""
    518518
     519#: tformmain.afiltercasesensitive.caption
     520msgctxt "TFORMMAIN.AFILTERCASESENSITIVE.CAPTION"
     521msgid "Case sensitive"
     522msgstr ""
     523
     524#: tformmain.afilterexactmatch.caption
     525msgctxt "TFORMMAIN.AFILTEREXACTMATCH.CAPTION"
     526msgid "Exact match"
     527msgstr ""
     528
    519529#: tformmain.ahide.caption
    520530msgid "Hide"
     
    569579msgstr ""
    570580
    571 #: tformmain.checkboxcasesensitive.caption
    572 msgid "Case sensitive"
    573 msgstr ""
    574 
    575 #: tformmain.checkboxexactmath.caption
    576 msgid "Exact match"
    577 msgstr ""
    578 
    579581#: tformmain.listviewacronyms.columns[0].caption
    580582msgctxt "tformmain.listviewacronyms.columns[0].caption"
  • trunk/UCore.lfm

    r112 r122  
    3535    top = 336
    3636    Bitmap = {
    37       4C69110000001000000010000000000000000000000000000000000000000000
     37      4C69130000001000000010000000000000000000000000000000000000000000
    3838      000070A970FF006400FF006200FF70A670FF0000000000000000000000000000
    3939      0000000000000000000000000000000000000000000000000000000000000000
     
    579579      5FFFE6BC93FFD9D9D9FF00000000000000000000000000000000EBEBEBFFD9D9
    580580      D9FFD9D9D9FFD9D9D9FFD9D9D9FFD9D9D9FFD9D9D9FFD9D9D9FFD9D9D9FFD9D9
    581       D9FFD9D9D9FFEBEBEBFF00000000
     581      D9FFD9D9D9FFEBEBEBFF00000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     582      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     583      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     584      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     585      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000101012C010101AC0101
     586      01AC010101AC0101015701010100010101000101010001010100010101000101
     587      01000101010001010100FFFFFF00FFFFFF00FFFFFF0001010185010101850101
     588      010001010184010101B001010100010101000101010001010100010101000101
     589      01000101010001010100FFFFFF00FFFFFF00FFFFFF0001010100010101000101
     590      014501010189010101B601010100010101000101010001010100010101000101
     591      01000101010001010100FFFFFF00FFFFFF00FFFFFF0001010118010101A50101
     592      01A40101018D010101BC01010100010101000101010001010100010101000101
     593      01000101010001010100FFFFFF00FFFFFF00FFFFFF00010101AA010101790101
     594      010001010161010101C201010100010101000101010001010197010101970101
     595      01000101010001010100FFFFFF00FFFFFF00FFFFFF00010101CA0101017F0000
     596      000001010198010101CA0101011A010101000101011F01010191010101AF0101
     597      011F0101010001010100FFFFFF00FFFFFF00FFFFFF000000006E000000DE0000
     598      00DE0000004D000000B1000000A701010100010101630101015A010101B40101
     599      01630101010001010100FFFFFF00FFFFFF00FFFFFF00E983614A693625002C12
     600      09008C381E0035160D000000000001010100010101A2010101210101017D0101
     601      01A20101010001010100FFFFFF00FFFFFF00FFFFFF00E98361AFC8644235AF49
     602      2700B84927FFDA5B394072312000010101220101019D01010130010101600101
     603      01BF0101012201010100FFFFFF00FFFFFF00FFFFFF00E9836127C86442CDAD48
     604      26FCB84927E0DA5B39FF723120000101016D010101C5010101C5010101C50101
     605      01C50101016D01010100FFFFFF00FFFFFF00FFFFFF00E9836100C8644200AF49
     606      2700B84927FFDA5B394039191000010101B30101012401010100010101000101
     607      018A010101B301010100FFFFFF00FFFFFF00FFFFFF00E9836100C8644200B049
     608      2700B849270035160D00000000AA000000E1000000AA000000000000003A0000
     609      00E1000000E1000000AAFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     610      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     611      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     612      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     613      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     614      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     615      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     616      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     617      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     618      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     619      FF00FFFFFF00FFFFFF00FFFFFF00CC996600CC996600CC996600CC996600CC99
     620      66FFCC996680CC996600CC996600CC996600CC996600CC996680CC9966FFCC99
     621      6600CC996600CC996600CC996600C8956200FFCC9900FFCC9900C89562FFFFCC
     622      99FFC89562FFC8956280FFCC9900FFCC9900C8956280C89562FFFFCC99FFC895
     623      62FFFFCC9900FFCC9900C8956200C3905D00FFCC9900C3905DFFFFCC99FFFFCC
     624      99FFFFCC99FFC3905DFFFFCC9900FFCC9900C3905DFFFFCC99FFFFCC99FFFFCC
     625      99FFC3905DFFFFCC9900C3905D00BD8A5700BD8A57FFFFCC99FFF7C491FFE8B5
     626      82FFBD8A57FFFFCC9900FFCC9900FFCC9900FFCC9900BD8A57FFE8B582FFF7C4
     627      91FFFFCC99FFBD8A57FFBD8A5700B68350FFFFCC99FFECB986FFDEAB78FFB683
     628      50FFFFCC9900FFCC9900FFCC9900FFCC9900FFCC9900FFCC9900B68350FFDEAB
     629      78FFECB986FFFFCC99FFB68350FFAF7C49FFD3A06DFFDFAC79FFE9B683FFAF7C
     630      49FFFFCC9900FFCC9900FFCC9900FFCC9900FFCC9900FFCC9900AF7C49FFE9B6
     631      83FFDFAC79FFD3A06DFFAF7C49FFA8754200A87542FFC99663FFD4A16EFFFFCC
     632      99FFA87542FFFFCC9900FFCC9900FFCC9900FFCC9900A87542FFFFCC99FFD4A1
     633      6EFFC99663FFA87542FFA8754200A26F3C00FFCC9900A26F3CFFC18E5BFFCC99
     634      66FFFFCC99FFA26F3CFFFFCC9900FFCC9900A26F3CFFFFCC99FFCC9966FFC18E
     635      5BFFA26F3CFFFFCC9900A26F3C009D6A3700CC996600CC9966009D6A37FFC08D
     636      5AFF9D6A37FF9D6A3780CC996600CC9966009D6A37809D6A37FFC08D5AFF9D6A
     637      37FFCC996600CC9966009D6A3700996633009966330099663300996633009966
     638      33FF996633809966330099663300996633009966330099663380996633FF9966
     639      3300996633009966330099663300FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     640      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     641      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     642      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     643      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     644      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     645      FF00FFFFFF00FFFFFF00FFFFFF00
    582646    }
    583647  end
Note: See TracChangeset for help on using the changeset viewer.