Changeset 121 for trunk/Forms/UFormMain.pas
- Timestamp:
- Nov 26, 2016, 12:09:42 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.