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

View File

@ -516,14 +516,31 @@ type
procedure ToggleFormUnitClicked(Sender: TObject);
procedure ToggleObjectInspClicked(Sender: TObject);
// find / replace text
procedure InitFindDialog;
procedure FindClicked(Sender: TObject);
procedure FindNextClicked(Sender: TObject);
procedure FindPreviousClicked(Sender: TObject);
procedure ReplaceClicked(Sender: TObject);
procedure IncrementalFindClicked(Sender: TObject);
// incremental find
procedure EndIncrementalFind;
property IncrementalSearchStr: string
read FIncrementalSearchStr write SetIncrementalSearchStr;
// FindInFiles
procedure FindInFiles(AProject: TProject);
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);
@ -559,20 +576,6 @@ type
procedure FindReplaceDlgKey(Sender: TObject; var Key: Word;
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
property OnAddJumpPoint: TOnAddJumpPoint
read FOnAddJumpPoint write FOnAddJumpPoint;
@ -744,7 +747,13 @@ begin
P := ClientToScreen(Point(CaretXPix, CaretYPix));
Left:=EditorComponent.ClientOrigin.X+(EditorComponent.Width - Width) div 2;
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;
procedure TSourceEditor.ActivateHint(ClientPos: TPoint; const TheHint: string);