Changeset 121 for trunk/Forms
- Timestamp:
- Nov 26, 2016, 12:09:42 AM (8 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r112 r121 1 1 object FormMain: TFormMain 2 Left = 4602 Left = 718 3 3 Height = 447 4 Top = 2894 Top = 663 5 5 Width = 782 6 6 Caption = 'Acronym Decoder' 7 ClientHeight = 4 227 ClientHeight = 415 8 8 ClientWidth = 782 9 9 Menu = MainMenu1 … … 15 15 OnShow = FormShow 16 16 LCLVersion = '1.6.0.4' 17 object Panel 1: TPanel17 object PanelMain: TPanel 18 18 Left = 0 19 Height = 3 9620 Top = 2619 Height = 359 20 Top = 56 21 21 Width = 782 22 22 Align = alClient 23 23 BevelOuter = bvNone 24 ClientHeight = 3 9624 ClientHeight = 359 25 25 ClientWidth = 782 26 26 TabOrder = 1 27 object CheckBoxExactMath: TCheckBox28 Left = 829 Height = 2430 Top = 331 Width = 10432 Caption = 'Exact match'33 OnChange = CheckBoxExactMathChange34 TabOrder = 035 end36 27 object ListViewFilter1: TListViewFilter 37 28 Left = 8 38 29 Height = 30 39 Top = 3230 Top = 5 40 31 Width = 767 41 32 OnChange = ListViewFilter1Change … … 44 35 object ListViewAcronyms: TListView 45 36 Left = 8 46 Height = 3 2447 Top = 6437 Height = 318 38 Top = 34 48 39 Width = 767 49 40 Anchors = [akTop, akLeft, akRight, akBottom] … … 64 55 ReadOnly = True 65 56 RowSelect = True 66 TabOrder = 257 TabOrder = 1 67 58 ViewStyle = vsReport 68 59 OnData = ListViewAcronymsData … … 150 141 end 151 142 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 152 172 object ActionList1: TActionList 153 173 Images = Core.ImageList1 … … 298 318 OnClick = MenuItemToolbarClick 299 319 end 320 object MenuItemParam: TMenuItem 321 Caption = 'Filter parameters' 322 OnClick = MenuItemParamClick 323 end 300 324 end 301 325 object MenuItem16: TMenuItem … … 340 364 OnFilter = ListViewSort1Filter 341 365 OnColumnWidthChanged = ListViewSort1ColumnWidthChanged 342 Column = 0343 Order = so Up366 Column = 2 367 Order = soDown 344 368 left = 472 345 369 top = 256 -
trunk/Forms/UFormMain.lrt
r102 r121 1 1 TFORMMAIN.CAPTION=Acronym Decoder 2 TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match3 2 TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[0].CAPTION=Name 4 3 TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Meaning … … 7 6 TFORMMAIN.TOOLBUTTON8.CAPTION=ToolButton8 8 7 TFORMMAIN.TOOLBUTTON10.CAPTION=ToolButton10 8 TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match 9 TFORMMAIN.CHECKBOXCASESENSITIVE.CAPTION=Case sensitive 9 10 TFORMMAIN.AEXIT.CAPTION=Exit 10 11 TFORMMAIN.ASHOW.CAPTION=Show … … 30 31 TFORMMAIN.MENUITEM24.CAPTION=- 31 32 TFORMMAIN.MENUITEMTOOLBAR.CAPTION=Toolbar 33 TFORMMAIN.MENUITEMPARAM.CAPTION=Filter parameters 32 34 TFORMMAIN.MENUITEM16.CAPTION=Tools 33 35 TFORMMAIN.MENUITEM5.CAPTION=Help -
trunk/Forms/UFormMain.pas
r112 r121 34 34 AExit: TAction; 35 35 ActionList1: TActionList; 36 CheckBoxExactMath: TCheckBox; 36 CheckBoxExactMatch: TCheckBox; 37 CheckBoxCaseSensitive: TCheckBox; 37 38 LastOpenedList1: TLastOpenedList; 38 39 ListViewAcronyms: TListView; … … 40 41 ListViewSort1: TListViewSort; 41 42 MainMenu1: TMainMenu; 43 MenuItemParam: TMenuItem; 42 44 MenuItem10: TMenuItem; 43 45 MenuItem11: TMenuItem; … … 64 66 MenuItem9: TMenuItem; 65 67 OpenDialog1: TOpenDialog; 66 Panel1: TPanel; 68 PanelParam: TPanel; 69 PanelMain: TPanel; 67 70 PopupMenuOpenRecent: TPopupMenu; 68 71 SaveDialog1: TSaveDialog; … … 97 100 procedure AShowImportFormatsExecute(Sender: TObject); 98 101 procedure AShowImportSourcesExecute(Sender: TObject); 99 procedure CheckBoxExactMat hChange(Sender: TObject);102 procedure CheckBoxExactMatchChange(Sender: TObject); 100 103 procedure EditSearchChange(Sender: TObject); 101 104 procedure FormHide(Sender: TObject); … … 114 117 function ListViewSort1CompareItem(Item1, Item2: TObject): Integer; 115 118 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 119 procedure MenuItemParamClick(Sender: TObject); 116 120 procedure MenuItemToolbarClick(Sender: TObject); 117 121 private … … 119 123 ProjectClosed: Boolean; 120 124 ImportTotalItemCount: Integer; 125 function GetFilteredCase(Text: string): string; 121 126 procedure ProcessImportsJob(Job: TJob); 122 127 procedure FilterList(List: TListObject); … … 398 403 end; 399 404 400 procedure TFormMain.CheckBoxExactMat hChange(Sender: TObject);405 procedure TFormMain.CheckBoxExactMatchChange(Sender: TObject); 401 406 begin 402 407 UpdateAcronymsList; … … 479 484 end; 480 485 486 procedure TFormMain.MenuItemParamClick(Sender: TObject); 487 begin 488 MenuItemParam.Checked := not MenuItemParam.Checked; 489 UpdateInterface; 490 end; 491 481 492 procedure TFormMain.MenuItemToolbarClick(Sender: TObject); 482 493 begin 483 494 MenuItemToolbar.Checked := not MenuItemToolbar.Checked; 484 495 UpdateInterface; 496 end; 497 498 function TFormMain.GetFilteredCase(Text: string): string; 499 begin 500 if not CheckBoxCaseSensitive.Checked then Result := UTF8LowerCase(Text) 501 else Result := Text; 485 502 end; 486 503 … … 526 543 if Visible and (EnteredCount > 0) then begin 527 544 FoundCount := 0; 528 if CheckBoxExactMat h.Checked then begin529 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); 535 552 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); 542 559 end; 543 560 if FoundCount <> EnteredCount then List.Delete(I); … … 591 608 AShowImportFormats.Enabled := Assigned(Core.AcronymDb); 592 609 ToolBar1.Visible := MenuItemToolbar.Checked; 610 PanelParam.Visible := MenuItemParam.Checked; 593 611 AHide.Enabled := FormMain.Visible; 594 612 … … 622 640 Core.AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False); 623 641 Core.StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False); 624 CheckBoxExactMath.Checked := ReadBoolWithDefault('ExactMatch', False); 642 CheckBoxExactMatch.Checked := ReadBoolWithDefault('ExactMatch', False); 643 CheckBoxCaseSensitive.Checked := ReadBoolWithDefault('CaseSensitive', False); 625 644 MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True); 645 MenuItemParam.Checked := ReadBoolWithDefault('FilterParamVisible', True); 626 646 finally 627 647 Free; … … 652 672 WriteBool('AlwaysOnTop', Core.AlwaysOnTop); 653 673 WriteBool('StartMinimizedToTray', Core.StartMinimizedToTray); 654 WriteBool('ExactMatch', CheckBoxExactMath.Checked); 674 WriteBool('ExactMatch', CheckBoxExactMatch.Checked); 675 WriteBool('CaseSensitive', CheckBoxCaseSensitive.Checked); 655 676 WriteBool('ToolBarVisible', MenuItemToolbar.Checked); 677 WriteBool('FilterParamVisible', MenuItemParam.Checked); 656 678 finally 657 679 Free;
Note:
See TracChangeset
for help on using the changeset viewer.