improved layout of ide search results window

git-svn-id: trunk@9102 -
This commit is contained in:
mattias 2006-04-09 20:37:38 +00:00
parent 1598547c3c
commit 49f04efd16
3 changed files with 70 additions and 45 deletions

View File

@ -1,33 +1,42 @@
object SearchResultsView: TSearchResultsView object SearchResultsView: TSearchResultsView
CAPTION = 'SearchResultsView' ActiveControl = btnSearchAgain
CLIENTHEIGHT = 229 Caption = 'SearchResultsView'
CLIENTWIDTH = 799 ClientHeight = 229
ONCREATE = Form1Create ClientWidth = 799
ONDESTROY = SearchResultsViewDestroy OnCreate = Form1Create
HORZSCROLLBAR.PAGE = 800 OnDestroy = SearchResultsViewDestroy
VERTSCROLLBAR.PAGE = 230 OnKeyDown = ListBoxKeyDown
LEFT = 151 PixelsPerInch = 96
HEIGHT = 229 Position = poScreenCenter
TOP = 481 HorzScrollBar.Page = 798
WIDTH = 799 VertScrollBar.Page = 228
object ResultsNoteBook: TNOTEBOOK Left = 267
ALIGN = albottom Height = 229
ANCHORS = [aktop, akleft] Top = 482
ONCLOSETABCLICKED = ResultsNoteBookClosetabclicked Width = 799
OPTIONS = [nboshowclosebuttons, nbomultiline] object ResultsNoteBook: TNotebook
HEIGHT = 189 Align = alBottom
TOP = 40 Anchors = [akTop, akLeft]
WIDTH = 799 OnCloseTabClicked = ResultsNoteBookClosetabclicked
Options = [nboShowCloseButtons, nboMultiLine]
AnchorSideTop.Control = btnSearchAgain
AnchorSideTop.Side = asrBottom
Height = 192
Top = 37
Width = 799
end end
object btnSearchAgain: TBUTTON object btnSearchAgain: TButton
ANCHORS = [aktop, akleft] BorderSpacing.Around = 6
CAPTION = 'Search Again' BorderSpacing.InnerBorder = 2
TABSTOP = True Caption = 'Search Again'
TABORDER = 1 OnClick = btnSearchAgainClick
ONCLICK = btnSearchAgainClick OnKeyDown = ListBoxKeyDown
LEFT = 8 TabOrder = 1
HEIGHT = 25 AnchorSideLeft.Control = Owner
TOP = 8 AnchorSideTop.Control = Owner
WIDTH = 115 Left = 6
Height = 25
Top = 6
Width = 115
end end
end end

View File

@ -1,15 +1,20 @@
{ This is an automatically generated lazarus resource file } { This is an automatically generated lazarus resource file }
LazarusResources.Add('TSearchResultsView','FORMDATA',[ LazarusResources.Add('TSearchResultsView','FORMDATA',[
'TPF0'#18'TSearchResultsView'#17'SearchResultsView'#7'CAPTION'#6#17'SearchRes' 'TPF0'#18'TSearchResultsView'#17'SearchResultsView'#13'ActiveControl'#7#14'bt'
+'ultsView'#12'CLIENTHEIGHT'#3#229#0#11'CLIENTWIDTH'#3#31#3#8'ONCREATE'#7#11 +'nSearchAgain'#7'Caption'#6#17'SearchResultsView'#12'ClientHeight'#3#229#0#11
+'Form1Create'#9'ONDESTROY'#7#24'SearchResultsViewDestroy'#18'HORZSCROLLBAR.P' +'ClientWidth'#3#31#3#8'OnCreate'#7#11'Form1Create'#9'OnDestroy'#7#24'SearchR'
+'AGE'#3' '#3#18'VERTSCROLLBAR.PAGE'#3#230#0#4'LEFT'#3#151#0#6'HEIGHT'#3#229#0 +'esultsViewDestroy'#9'OnKeyDown'#7#14'ListBoxKeyDown'#13'PixelsPerInch'#2'`'
+#3'TOP'#3#225#1#5'WIDTH'#3#31#3#0#9'TNOTEBOOK'#15'ResultsNoteBook'#5'ALIGN'#7 +#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3#30#3#18'VertScrol'
+#8'albottom'#7'ANCHORS'#11#5'aktop'#6'akleft'#0#17'ONCLOSETABCLICKED'#7#30'R' +'lBar.Page'#3#228#0#4'Left'#3#11#1#6'Height'#3#229#0#3'Top'#3#226#1#5'Width'
+'esultsNoteBookClosetabclicked'#7'OPTIONS'#11#19'nboshowclosebuttons'#12'nbo' +#3#31#3#0#9'TNotebook'#15'ResultsNoteBook'#5'Align'#7#8'alBottom'#7'Anchors'
+'multiline'#0#6'HEIGHT'#3#189#0#3'TOP'#2'('#5'WIDTH'#3#31#3#0#0#7'TBUTTON'#14 +#11#5'akTop'#6'akLeft'#0#17'OnCloseTabClicked'#7#30'ResultsNoteBookClosetabc'
+'btnSearchAgain'#7'ANCHORS'#11#5'aktop'#6'akleft'#0#7'CAPTION'#6#12'Search A' +'licked'#7'Options'#11#19'nboShowCloseButtons'#12'nboMultiLine'#0#21'AnchorS'
+'gain'#7'TABSTOP'#9#8'TABORDER'#2#1#7'ONCLICK'#7#19'btnSearchAgainClick'#4'L' +'ideTop.Control'#7#14'btnSearchAgain'#18'AnchorSideTop.Side'#7#9'asrBottom'#6
+'EFT'#2#8#6'HEIGHT'#2#25#3'TOP'#2#8#5'WIDTH'#2's'#0#0#0 +'Height'#3#192#0#3'Top'#2'%'#5'Width'#3#31#3#0#0#7'TButton'#14'btnSearchAgai'
+'n'#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'
+#6#12'Search Again'#7'OnClick'#7#19'btnSearchAgainClick'#9'OnKeyDown'#7#14'L'
+'istBoxKeyDown'#8'TabOrder'#2#1#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anc'
+'horSideTop.Control'#7#5'Owner'#4'Left'#2#6#6'Height'#2#25#3'Top'#2#6#5'Widt'
+'h'#2's'#0#0#0
]); ]);

View File

@ -105,9 +105,10 @@ type
{ TSearchResultsView } { TSearchResultsView }
TSearchResultsView = class(TForm) TSearchResultsView = class(TForm)
btnSearchAgain: TBUTTON; btnSearchAgain: TButton;
ResultsNoteBook: TNOTEBOOK; ResultsNoteBook: TNotebook;
procedure Form1Create(Sender: TObject); procedure Form1Create(Sender: TObject);
procedure ListBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure ResultsNoteBookChangebounds(Sender: TObject); procedure ResultsNoteBookChangebounds(Sender: TObject);
procedure ResultsNoteBookClosetabclicked(Sender: TObject); procedure ResultsNoteBookClosetabclicked(Sender: TObject);
procedure SearchResultsViewDestroy(Sender: TObject); procedure SearchResultsViewDestroy(Sender: TObject);
@ -127,9 +128,9 @@ type
procedure ListBoxDoubleClicked(Sender: TObject); procedure ListBoxDoubleClicked(Sender: TObject);
procedure SetItems(Index: Integer; Value: TStrings); procedure SetItems(Index: Integer; Value: TStrings);
function GetItems(Index: integer): TStrings; function GetItems(Index: integer): TStrings;
fOnSelectionChanged: TNotifyEvent; fOnSelectionChanged: TNotifyEvent;
fListBoxFont: TFont; fListBoxFont: TFont;
fMouseOverIndex: integer; fMouseOverIndex: integer;
public public
function AddResult(const ResultsName: string; function AddResult(const ResultsName: string;
const SearchText: string; const SearchText: string;
@ -378,6 +379,13 @@ begin
end;//for end;//for
end;//PageExists end;//PageExists
procedure TSearchResultsView.ListBoxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = 27 then
Close;
end;
{Add Result will create a tab in the Results view window with an new {Add Result will create a tab in the Results view window with an new
list box or focus an existing listbox and update it's searchoptions.} list box or focus an existing listbox and update it's searchoptions.}
function TSearchResultsView.AddResult(const ResultsName: string; function TSearchResultsView.AddResult(const ResultsName: string;
@ -405,6 +413,7 @@ begin
begin begin
NewPage:= Pages.Add(ResultsName + SPACE); NewPage:= Pages.Add(ResultsName + SPACE);
ResultsNoteBook.PageIndex:= NewPage; ResultsNoteBook.PageIndex:= NewPage;
ResultsNoteBook.Page[ResultsNoteBook.PageIndex].OnKeyDown := @ListBoxKeyDown;
if NewPage > -1 then if NewPage > -1 then
begin begin
NewListBox:= TLazSearchResultLB.Create(Page[NewPage]); NewListBox:= TLazSearchResultLB.Create(Page[NewPage]);
@ -412,9 +421,11 @@ begin
begin begin
Parent:= Page[NewPage]; Parent:= Page[NewPage];
Align:= alClient; Align:= alClient;
BorderSpacing.Around := 6;
ClickOnSelChange:=false; ClickOnSelChange:=false;
OnClick:= @ListBoxClicked; OnClick:= @ListBoxClicked;
OnDblClick:= @ListBoxDoubleClicked; OnDblClick:= @ListBoxDoubleClicked;
OnKeyDown := @ListBoxKeyDown;
Style:= lbOwnerDrawFixed; Style:= lbOwnerDrawFixed;
OnDrawItem:= @ListBoxDrawItem; OnDrawItem:= @ListBoxDrawItem;
OnShowHint:= @LazLBShowHint; OnShowHint:= @LazLBShowHint;