IDE: return in search results listbox jump to the source location

git-svn-id: trunk@15311 -
This commit is contained in:
vincents 2008-06-04 22:27:51 +00:00
parent 561fbf548c
commit 96d3012446
3 changed files with 96 additions and 42 deletions

View File

@ -13,6 +13,7 @@ object SearchResultsView: TSearchResultsView
OnDestroy = SearchResultsViewDestroy
OnKeyDown = ListBoxKeyDown
Position = poScreenCenter
LCLVersion = '0.9.25'
object ResultsNoteBook: TNotebook
AnchorSideTop.Control = gbSearchPhraseInList
AnchorSideTop.Side = asrBottom

View File

@ -6,45 +6,91 @@ LazarusResources.Add('TSearchResultsView','FORMDATA',[
+'ScrollBar.Page'#3#228#0#13'ActiveControl'#7#14'btnSearchAgain'#7'Caption'#6
+#17'SearchResultsView'#12'ClientHeight'#3#229#0#11'ClientWidth'#3#31#3#8'OnC'
+'reate'#7#11'Form1Create'#9'OnDestroy'#7#24'SearchResultsViewDestroy'#9'OnKe'
+'yDown'#7#14'ListBoxKeyDown'#8'Position'#7#14'poScreenCenter'#0#9'TNotebook'
+#15'ResultsNoteBook'#21'AnchorSideTop.Control'#7#20'gbSearchPhraseInList'#18
+'AnchorSideTop.Side'#7#9'asrBottom'#6'Height'#3#164#0#3'Top'#2'A'#5'Width'#3
+#31#3#5'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLeft'#0#17'OnCloseTa'
+'bClicked'#7#30'ResultsNoteBookClosetabclicked'#13'OnPageChanged'#7#26'Resul'
+'tsNoteBookPageChanged'#7'Options'#11#19'nboShowCloseButtons'#12'nboMultiLin'
+'e'#0#8'TabOrder'#2#0#0#0#7'TButton'#14'btnSearchAgain'#22'AnchorSideLeft.Co'
+'ntrol'#7#5'Owner'#21'AnchorSideTop.Control'#7#15'ClosePageButton'#18'Anchor'
+'SideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6'Height'#2#23#3'Top'#2#21#5'Width'
+#2'Z'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Search Agai'
+'n'#7'OnClick'#7#19'btnSearchAgainClick'#9'OnKeyDown'#7#14'ListBoxKeyDown'#8
+'TabOrder'#2#1#0#0#9'TGroupBox'#20'gbSearchPhraseInList'#22'AnchorSideLeft.C'
+'ontrol'#7#15'ClosePageButton'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'Anc'
+'horSideTop.Control'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'An'
+'chorSideRight.Side'#7#9'asrBottom'#4'Left'#3#216#0#6'Height'#2'5'#3'Top'#2#6
+#5'Width'#3'A'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#9
+#20'BorderSpacing.Around'#2#6#7'Caption'#6' Search or Filter Phrases In List'
+#12'ClientHeight'#2'#'#11'ClientWidth'#3'='#2#8'TabOrder'#2#2#0#5'TEdit'#14
+'edSearchInList'#22'AnchorSideLeft.Control'#7#20'gbSearchPhraseInList'#21'An'
+'chorSideTop.Control'#7#20'gbSearchPhraseInList'#23'AnchorSideRight.Control'
+#7#8'bnFilter'#4'Left'#2#6#6'Height'#2#23#4'Hint'#6'sEnter one or more phras'
+'es that you want'#10'to Search or Filter in the list,'#10'seperated by spac'
+'e ( '' '' ), or comma ( , )'#3'Top'#2#6#5'Width'#3#16#1#7'Anchors'#11#5'akT'
+'op'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#6#8'OnChange'#7#20'ed'
+'SearchInListChange'#9'OnKeyDown'#7#21'edSearchInListKeyDown'#14'ParentShowH'
+'int'#8#8'ShowHint'#9#8'TabOrder'#2#0#0#0#7'TButton'#15'bnForwardSearch'#4'L'
+'eft'#3'^'#1#6'Height'#2#23#3'Top'#2#6#5'Width'#2'n'#5'Align'#7#7'alRight'#8
+'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'bnForwardSearch'#7
+'OnClick'#7#20'bnForwardSearchClick'#8'TabOrder'#2#1#0#0#7'TButton'#14'bnRes'
+'etResults'#4'Left'#3#210#1#6'Height'#2#23#3'Top'#2#6#5'Width'#2'e'#5'Align'
+#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#14'bnR'
+'esetResults'#7'OnClick'#7#19'bnResetResultsClick'#8'TabOrder'#2#2#0#0#7'TBu'
+'tton'#8'bnFilter'#4'Left'#3#28#1#6'Height'#2#23#3'Top'#2#6#5'Width'#2'<'#5
+'yDown'#7#14'ListBoxKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'
+#6#6'0.9.25'#0#9'TNotebook'#15'ResultsNoteBook'#21'AnchorSideTop.Control'#7
+#20'gbSearchPhraseInList'#18'AnchorSideTop.Side'#7#9'asrBottom'#6'Height'#3
+#164#0#3'Top'#2'A'#5'Width'#3#31#3#5'Align'#7#8'alBottom'#7'Anchors'#11#5'ak'
+'Top'#6'akLeft'#0#17'OnCloseTabClicked'#7#30'ResultsNoteBookClosetabclicked'
+#13'OnPageChanged'#7#26'ResultsNoteBookPageChanged'#7'Options'#11#19'nboShow'
+'CloseButtons'#12'nboMultiLine'#0#8'TabOrder'#2#0#0#0#7'TButton'#14'btnSearc'
+'hAgain'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#15
+'ClosePageButton'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6'Height'
+#2#23#3'Top'#2#21#5'Width'#2'Z'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7
+'Caption'#6#12'Search Again'#7'OnClick'#7#19'btnSearchAgainClick'#9'OnKeyDow'
+'n'#7#14'ListBoxKeyDown'#8'TabOrder'#2#1#0#0#9'TGroupBox'#20'gbSearchPhraseI'
+'nList'#22'AnchorSideLeft.Control'#7#15'ClosePageButton'#19'AnchorSideLeft.S'
+'ide'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#5'Owner'#23'AnchorSideRight'
+'.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#216#0
+#6'Height'#2'5'#3'Top'#2#6#5'Width'#3'A'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7
+'akRight'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6' Search '
+'or Filter Phrases In List'#12'ClientHeight'#2'#'#11'ClientWidth'#3'='#2#8'T'
+'abOrder'#2#2#0#5'TEdit'#14'edSearchInList'#22'AnchorSideLeft.Control'#7#20
+'gbSearchPhraseInList'#21'AnchorSideTop.Control'#7#20'gbSearchPhraseInList'
+#23'AnchorSideRight.Control'#7#8'bnFilter'#4'Left'#2#6#6'Height'#2#23#4'Hint'
+#6'sEnter one or more phrases that you want'#10'to Search or Filter in the l'
+'ist,'#10'seperated by space ( '' '' ), or comma ( , )'#3'Top'#2#6#5'Width'#3
+#16#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'
+#2#6#8'OnChange'#7#20'edSearchInListChange'#9'OnKeyDown'#7#21'edSearchInList'
+'KeyDown'#14'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#0#0#0#7'TButton'
+#15'bnForwardSearch'#4'Left'#3'^'#1#6'Height'#2#23#3'Top'#2#6#5'Width'#2'n'#5
+'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6
+#8'bnFilter'#7'OnClick'#7#13'bnFilterClick'#8'TabOrder'#2#3#0#0#0#7'TButton'
+#15'ClosePageButton'#22'AnchorSideLeft.Control'#7#14'btnSearchAgain'#19'Anch'
+'orSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#20'gbSearchPhra'
+'seInList'#18'AnchorSideTop.Side'#7#9'asrCenter'#21'AnchorSideBottom.Side'#7
+#9'asrBottom'#4'Left'#2'f'#6'Height'#2#23#3'Top'#2#21#5'Width'#2'l'#8'AutoSi'
+'ze'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'ClosePageButton'#7'OnCli'
+'ck'#7#20'ClosePageButtonClick'#8'TabOrder'#2#3#0#0#0
+#15'bnForwardSearch'#7'OnClick'#7#20'bnForwardSearchClick'#8'TabOrder'#2#1#0
+#0#7'TButton'#14'bnResetResults'#4'Left'#3#210#1#6'Height'#2#23#3'Top'#2#6#5
+'Width'#2'e'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6
+#7'Caption'#6#14'bnResetResults'#7'OnClick'#7#19'bnResetResultsClick'#8'TabO'
+'rder'#2#2#0#0#7'TButton'#8'bnFilter'#4'Left'#3#28#1#6'Height'#2#23#3'Top'#2
+#6#5'Width'#2'<'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'
+#2#6#7'Caption'#6#8'bnFilter'#7'OnClick'#7#13'bnFilterClick'#8'TabOrder'#2#3
+#0#0#0#7'TButton'#15'ClosePageButton'#22'AnchorSideLeft.Control'#7#14'btnSea'
+'rchAgain'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7
+#20'gbSearchPhraseInList'#18'AnchorSideTop.Side'#7#9'asrCenter'#21'AnchorSid'
+'eBottom.Side'#7#9'asrBottom'#4'Left'#2'f'#6'Height'#2#23#3'Top'#2#21#5'Widt'
+'h'#2'l'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'ClosePag'
+'eButton'#7'OnClick'#7#20'ClosePageButtonClick'#8'TabOrder'#2#3#0#0#0#18'TSe'
+'archResultsView'#17'SearchResultsView'#4'Left'#3#247#0#6'Height'#3#229#0#3
+'Top'#3'a'#1#5'Width'#3#31#3#18'HorzScrollBar.Page'#3#30#3#18'VertScrollBar.'
+'Page'#3#228#0#13'ActiveControl'#7#14'btnSearchAgain'#7'Caption'#6#17'Search'
+'ResultsView'#12'ClientHeight'#3#229#0#11'ClientWidth'#3#31#3#8'OnCreate'#7
+#11'Form1Create'#9'OnDestroy'#7#24'SearchResultsViewDestroy'#9'OnKeyDown'#7
+#14'ListBoxKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.'
+'25'#0#9'TNotebook'#15'ResultsNoteBook'#21'AnchorSideTop.Control'#7#20'gbSea'
+'rchPhraseInList'#18'AnchorSideTop.Side'#7#9'asrBottom'#6'Height'#3#164#0#3
+'Top'#2'A'#5'Width'#3#31#3#5'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'a'
+'kLeft'#0#17'OnCloseTabClicked'#7#30'ResultsNoteBookClosetabclicked'#13'OnPa'
+'geChanged'#7#26'ResultsNoteBookPageChanged'#7'Options'#11#19'nboShowCloseBu'
+'ttons'#12'nboMultiLine'#0#8'TabOrder'#2#0#0#0#7'TButton'#14'btnSearchAgain'
+#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#15'CloseP'
+'ageButton'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6'Height'#2#23
+#3'Top'#2#21#5'Width'#2'Z'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Capt'
+'ion'#6#12'Search Again'#7'OnClick'#7#19'btnSearchAgainClick'#9'OnKeyDown'#7
+#14'ListBoxKeyDown'#8'TabOrder'#2#1#0#0#9'TGroupBox'#20'gbSearchPhraseInList'
+#22'AnchorSideLeft.Control'#7#15'ClosePageButton'#19'AnchorSideLeft.Side'#7#9
,'asrBottom'#21'AnchorSideTop.Control'#7#5'Owner'#23'AnchorSideRight.Control'
+#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#216#0#6'Height'
+#2'5'#3'Top'#2#6#5'Width'#3'A'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
+#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6' Search or Filter'
+' Phrases In List'#12'ClientHeight'#2'#'#11'ClientWidth'#3'='#2#8'TabOrder'#2
+#2#0#5'TEdit'#14'edSearchInList'#22'AnchorSideLeft.Control'#7#20'gbSearchPhr'
+'aseInList'#21'AnchorSideTop.Control'#7#20'gbSearchPhraseInList'#23'AnchorSi'
+'deRight.Control'#7#8'bnFilter'#4'Left'#2#6#6'Height'#2#23#4'Hint'#6'sEnter '
+'one or more phrases that you want'#10'to Search or Filter in the list,'#10
+'seperated by space ( '' '' ), or comma ( , )'#3'Top'#2#6#5'Width'#3#16#1#7
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#6#8
+'OnChange'#7#20'edSearchInListChange'#9'OnKeyDown'#7#21'edSearchInListKeyDow'
+'n'#14'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#0#0#0#7'TButton'#15'bnF'
+'orwardSearch'#4'Left'#3'^'#1#6'Height'#2#23#3'Top'#2#6#5'Width'#2'n'#5'Alig'
+'n'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15
+'bnForwardSearch'#7'OnClick'#7#20'bnForwardSearchClick'#8'TabOrder'#2#1#0#0#7
+'TButton'#14'bnResetResults'#4'Left'#3#210#1#6'Height'#2#23#3'Top'#2#6#5'Wid'
+'th'#2'e'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7
+'Caption'#6#14'bnResetResults'#7'OnClick'#7#19'bnResetResultsClick'#8'TabOrd'
+'er'#2#2#0#0#7'TButton'#8'bnFilter'#4'Left'#3#28#1#6'Height'#2#23#3'Top'#2#6
+#5'Width'#2'<'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2
+#6#7'Caption'#6#8'bnFilter'#7'OnClick'#7#13'bnFilterClick'#8'TabOrder'#2#3#0
+#0#0#7'TButton'#15'ClosePageButton'#22'AnchorSideLeft.Control'#7#14'btnSearc'
+'hAgain'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7
+#20'gbSearchPhraseInList'#18'AnchorSideTop.Side'#7#9'asrCenter'#21'AnchorSid'
+'eBottom.Side'#7#9'asrBottom'#4'Left'#2'f'#6'Height'#2#23#3'Top'#2#21#5'Widt'
+'h'#2'l'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'ClosePag'
+'eButton'#7'OnClick'#7#20'ClosePageButtonClick'#8'TabOrder'#2#3#0#0#0
]);

View File

@ -152,7 +152,8 @@ type
procedure bnFilterClick (Sender: TObject );
private
FMaxItems: integer;
FOnSelectionChanged: TNotifyEvent; fListBoxFont: TFont;
FOnSelectionChanged: TNotifyEvent;
FListBoxFont: TFont;
FMouseOverIndex: integer;
function BeautifyPageName(const APageName: string): string;
function PageExists(const APageName: string): boolean;
@ -679,9 +680,15 @@ end;//PageExists
procedure TSearchResultsView.ListBoxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then begin
if Key = VK_ESCAPE then
begin
Key:=VK_UNKNOWN;
Close;
end
else if (Key = VK_RETURN) and (Shift = []) then
begin
Key:=VK_UNKNOWN;
FOnSelectionChanged(Self);
end;
end;