fixed positioning of Find dialog for out of window

git-svn-id: trunk@5385 -
This commit is contained in:
mattias 2004-04-09 12:00:30 +00:00
parent 60622502da
commit 5c3e6d1692
2 changed files with 29 additions and 20 deletions

View File

@ -133,7 +133,7 @@ begin
Parent:=Self; Parent:=Self;
Left:=8; Left:=8;
Top:=8; Top:=8;
Width:= 100; Width:= TextToFindComboBox.Left-Left;
Caption:=dlgTextToFing; Caption:=dlgTextToFing;
FocusControl:= TextToFindComboBox; FocusControl:= TextToFindComboBox;
end; end;
@ -142,9 +142,9 @@ begin
with ReplaceTextComboBox do begin with ReplaceTextComboBox do begin
Name:='ReplaceTextComboBox'; Name:='ReplaceTextComboBox';
Parent:=Self; Parent:=Self;
Left:=90; Left:=TextToFindComboBox.Left;
Top:=28; Top:=28;
Width:= 306; Width:= TextToFindComboBox.Width;
Anchors:= [akLeft, akTop, akRight]; Anchors:= [akLeft, akTop, akRight];
Text:=''; Text:='';
OnKeyDown:=@TextToFindComboBoxKeyDown; OnKeyDown:=@TextToFindComboBoxKeyDown;
@ -154,9 +154,9 @@ begin
with ReplaceWithLabel do begin with ReplaceWithLabel do begin
Name:='ReplaceWithLabel'; Name:='ReplaceWithLabel';
Parent:=Self; Parent:=Self;
Left:=8; Left:=TextToFindLabel.Left;
Top:=32; Top:=32;
Width:= 100; Width:= TextToFindLabel.Width;
Caption:=dlgReplaceWith; Caption:=dlgReplaceWith;
FocusControl:= ReplaceTextComboBox; FocusControl:= ReplaceTextComboBox;
end; end;

View File

@ -516,14 +516,31 @@ type
procedure ToggleFormUnitClicked(Sender: TObject); procedure ToggleFormUnitClicked(Sender: TObject);
procedure ToggleObjectInspClicked(Sender: TObject); procedure ToggleObjectInspClicked(Sender: TObject);
// find / replace text
procedure InitFindDialog; procedure InitFindDialog;
procedure FindClicked(Sender: TObject); procedure FindClicked(Sender: TObject);
procedure FindNextClicked(Sender: TObject); procedure FindNextClicked(Sender: TObject);
procedure FindPreviousClicked(Sender: TObject); procedure FindPreviousClicked(Sender: TObject);
procedure ReplaceClicked(Sender: TObject); procedure ReplaceClicked(Sender: TObject);
procedure IncrementalFindClicked(Sender: TObject); procedure IncrementalFindClicked(Sender: TObject);
// incremental find
procedure EndIncrementalFind;
property IncrementalSearchStr: string
read FIncrementalSearchStr write SetIncrementalSearchStr;
// FindInFiles
procedure FindInFiles(AProject: TProject); procedure FindInFiles(AProject: TProject);
procedure ShowSearchResultsView; procedure ShowSearchResultsView;
function CreateFindInFilesDialog: TLazFindInFilesDialog;
procedure LoadFindInFilesHistory(ADialog: TLazFindInFilesDialog);
procedure SaveFindInFilesHistory(ADialog: TLazFindInFilesDialog);
procedure FIFSearchProject(AProject: TProject;
ADialog: TLazFindInFilesDialog);
procedure FIFSearchOpenFiles(ADialog: TLazFindInFilesDialog);
procedure FIFSearchDir(ADialog: TLazFindInFilesDialog);
function FIFCreateSearchForm(ADialog:TLazFindInFilesDialog): TSearchForm;
procedure DoFindInFiles(ASearchForm: TSearchForm);
procedure GotoLineClicked(Sender: TObject); procedure GotoLineClicked(Sender: TObject);
@ -559,20 +576,6 @@ type
procedure FindReplaceDlgKey(Sender: TObject; var Key: Word; procedure FindReplaceDlgKey(Sender: TObject; var Key: Word;
Shift:TShiftState; FindDlgComponent: TFindDlgComponent); Shift:TShiftState; FindDlgComponent: TFindDlgComponent);
procedure EndIncrementalFind;
property IncrementalSearchStr: string
read FIncrementalSearchStr write SetIncrementalSearchStr;
//FindInFiles
function CreateFindInFilesDialog: TLazFindInFilesDialog;
procedure LoadFindInFilesHistory(ADialog: TLazFindInFilesDialog);
procedure SaveFindInFilesHistory(ADialog: TLazFindInFilesDialog);
procedure FIFSearchProject(AProject: TProject;
ADialog: TLazFindInFilesDialog);
procedure FIFSearchOpenFiles(ADialog: TLazFindInFilesDialog);
procedure FIFSearchDir(ADialog: TLazFindInFilesDialog);
function FIFCreateSearchForm(ADialog:TLazFindInFilesDialog): TSearchForm;
procedure DoFindInFiles(ASearchForm: TSearchForm);
published published
property OnAddJumpPoint: TOnAddJumpPoint property OnAddJumpPoint: TOnAddJumpPoint
read FOnAddJumpPoint write FOnAddJumpPoint; read FOnAddJumpPoint write FOnAddJumpPoint;
@ -744,7 +747,13 @@ begin
P := ClientToScreen(Point(CaretXPix, CaretYPix)); P := ClientToScreen(Point(CaretXPix, CaretYPix));
Left:=EditorComponent.ClientOrigin.X+(EditorComponent.Width - Width) div 2; Left:=EditorComponent.ClientOrigin.X+(EditorComponent.Width - Width) div 2;
Top:=P.Y-Height-2*EditorComponent.LineHeight; Top:=P.Y-Height-2*EditorComponent.LineHeight;
if Top<10 then Top:=P.y+2*EditorComponent.LineHeight; if Top<10 then begin
Top:=P.y+2*EditorComponent.LineHeight;
if Top+Height>SCreen.Height then begin
Top:=(Screen.Height-Height) div 2;
if Top<0 then Top:=0;
end;
end;
end; end;
procedure TSourceEditor.ActivateHint(ClientPos: TPoint; const TheHint: string); procedure TSourceEditor.ActivateHint(ClientPos: TPoint; const TheHint: string);