cody: dictionary: filter contains

git-svn-id: trunk@34397 -
This commit is contained in:
mattias 2011-12-25 00:05:24 +00:00
parent 8fe3090356
commit b8da5fdca9
2 changed files with 37 additions and 32 deletions

View File

@ -13,8 +13,8 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
LCLVersion = '0.9.31' LCLVersion = '0.9.31'
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
Height = 40 Height = 30
Top = 278 Top = 288
Width = 540 Width = 540
OKButton.Name = 'OKButton' OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True OKButton.DefaultCaption = True
@ -29,9 +29,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
end end
object InfoLabel: TLabel object InfoLabel: TLabel
Left = 8 Left = 8
Height = 18 Height = 17
Top = 8 Top = 8
Width = 61 Width = 59
Caption = 'InfoLabel' Caption = 'InfoLabel'
ParentColor = False ParentColor = False
WordWrap = True WordWrap = True
@ -42,9 +42,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = StartsSpeedButton AnchorSideRight.Control = StartsSpeedButton
Left = 6 Left = 6
Height = 27 Height = 22
Top = 64 Top = 59
Width = 466 Width = 409
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 10 BorderSpacing.Top = 10
@ -62,8 +62,8 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = UnitLabel AnchorSideBottom.Control = UnitLabel
Left = 6 Left = 6
Height = 118 Height = 144
Top = 91 Top = 81
Width = 540 Width = 540
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
@ -72,17 +72,15 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
ItemHeight = 0 ItemHeight = 0
OnClick = ItemsListBoxClick OnClick = ItemsListBoxClick
OnSelectionChange = ItemsListBoxSelectionChange OnSelectionChange = ItemsListBoxSelectionChange
ScrollWidth = 538
TabOrder = 2 TabOrder = 2
TopIndex = -1
end end
object UnitLabel: TLabel object UnitLabel: TLabel
AnchorSideLeft.Control = InfoLabel AnchorSideLeft.Control = InfoLabel
AnchorSideBottom.Control = PackageLabel AnchorSideBottom.Control = PackageLabel
Left = 8 Left = 8
Height = 18 Height = 17
Top = 210 Top = 226
Width = 63 Width = 60
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 1 BorderSpacing.Bottom = 1
Caption = 'UnitLabel' Caption = 'UnitLabel'
@ -92,9 +90,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideLeft.Control = InfoLabel AnchorSideLeft.Control = InfoLabel
AnchorSideBottom.Control = AddToImplementationUsesCheckBox AnchorSideBottom.Control = AddToImplementationUsesCheckBox
Left = 8 Left = 8
Height = 18 Height = 17
Top = 229 Top = 244
Width = 90 Width = 85
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 1 BorderSpacing.Bottom = 1
Caption = 'PackageLabel' Caption = 'PackageLabel'
@ -105,9 +103,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideTop.Control = InfoLabel AnchorSideTop.Control = InfoLabel
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 8 Left = 8
Height = 22 Height = 18
Top = 32 Top = 31
Width = 207 Width = 197
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'HideOtherProjectsCheckBox' Caption = 'HideOtherProjectsCheckBox'
OnChange = HideOtherProjectsCheckBoxChange OnChange = HideOtherProjectsCheckBoxChange
@ -117,9 +115,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideLeft.Control = PackageLabel AnchorSideLeft.Control = PackageLabel
AnchorSideBottom.Control = ButtonPanel1 AnchorSideBottom.Control = ButtonPanel1
Left = 8 Left = 8
Height = 22 Height = 18
Top = 250 Top = 264
Width = 264 Width = 253
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Top = 3 BorderSpacing.Top = 3
BorderSpacing.Bottom = 3 BorderSpacing.Bottom = 3
@ -133,10 +131,10 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideRight.Control = ContainsSpeedButton AnchorSideRight.Control = ContainsSpeedButton
AnchorSideBottom.Control = FilterEdit AnchorSideBottom.Control = FilterEdit
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 472 Left = 415
Height = 27 Height = 22
Top = 64 Top = 59
Width = 51 Width = 71
Anchors = [akTop, akRight, akBottom] Anchors = [akTop, akRight, akBottom]
AutoSize = True AutoSize = True
Caption = 'Starts with' Caption = 'Starts with'
@ -152,16 +150,17 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = FilterEdit AnchorSideBottom.Control = FilterEdit
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 523 Left = 486
Height = 27 Height = 22
Top = 64 Top = 59
Width = 23 Width = 60
Anchors = [akTop, akRight, akBottom] Anchors = [akTop, akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Right = 6 BorderSpacing.Right = 6
Caption = 'Contains' Caption = 'Contains'
GroupIndex = 1 GroupIndex = 1
NumGlyphs = 0 NumGlyphs = 0
OnClick = ContainsSpeedButtonClick
ShowHint = True ShowHint = True
ParentShowHint = False ParentShowHint = False
end end

View File

@ -130,6 +130,7 @@ type
StartsSpeedButton: TSpeedButton; StartsSpeedButton: TSpeedButton;
UnitLabel: TLabel; UnitLabel: TLabel;
procedure ButtonPanel1OKButtonClick(Sender: TObject); procedure ButtonPanel1OKButtonClick(Sender: TObject);
procedure ContainsSpeedButtonClick(Sender: TObject);
procedure FilterEditChange(Sender: TObject); procedure FilterEditChange(Sender: TObject);
procedure FilterEditExit(Sender: TObject); procedure FilterEditExit(Sender: TObject);
procedure FilterEditKeyDown(Sender: TObject; var Key: Word; procedure FilterEditKeyDown(Sender: TObject; var Key: Word;
@ -619,6 +620,11 @@ begin
SetDlgAction(cidaUseIdentifier); SetDlgAction(cidaUseIdentifier);
end; end;
procedure TCodyIdentifiersDlg.ContainsSpeedButtonClick(Sender: TObject);
begin
UpdateItemsList;
end;
procedure TCodyIdentifiersDlg.FilterEditExit(Sender: TObject); procedure TCodyIdentifiersDlg.FilterEditExit(Sender: TObject);
begin begin
if FItems=nil then exit; if FItems=nil then exit;
@ -787,7 +793,7 @@ var
cifStartsWith: cifStartsWith:
if not ComparePrefixIdent(FilterP,PChar(Pointer(Item.Name))) then continue; if not ComparePrefixIdent(FilterP,PChar(Pointer(Item.Name))) then continue;
cifContains: cifContains:
if System.Pos(FLastFilter,Item.Name)<1 then continue; if IdentifierPos(FilterP,PChar(Pointer(Item.Name)))<0 then continue;
end; end;
end; end;
if Found>MaxItems then begin if Found>MaxItems then begin