lcl: don't show Find/Replace dialog modal but instead show them on top of active form based on patch of Anton (the second part of issue #0018329)

git-svn-id: trunk@28945 -
This commit is contained in:
paul 2011-01-11 03:43:20 +00:00
parent ebffc65625
commit 9a7581569d
2 changed files with 34 additions and 39 deletions

View File

@ -166,27 +166,25 @@ end;
function TFindDialog.CreateForm: TForm; function TFindDialog.CreateForm: TForm;
begin begin
Result:=TFindDialogForm.Create(nil);// do not use Self as Owner, otherwise as desgntime this will not work // do not use Self as Owner, otherwise as desgntime this will not work
//DebugLn(['TFindDialog.CreateForm ',DbgSName(Result),' ',Result.ControlCount]); Result := TFindDialogForm.Create(nil);
with TFindDialogForm(Result) do begin with TFindDialogForm(Result) do
FindButton.Caption:=rsFind; begin
CancelButton.Caption:=rsMbCancel; FindButton.Caption := rsFind;
HelpButton.Caption:=ifsVK_HELP; CancelButton.Caption := rsMbCancel;
WholeWordsOnlyCheckBox.Caption:=rsWholeWordsOnly; HelpButton.Caption := ifsVK_HELP;
CaseSensitiveCheckBox.Caption:=rsCaseSensitive; WholeWordsOnlyCheckBox.Caption := rsWholeWordsOnly;
EntireScopeCheckBox.Caption:=rsEntireScope; CaseSensitiveCheckBox.Caption := rsCaseSensitive;
FindLabel.Caption:=rsText; EntireScopeCheckBox.Caption := rsEntireScope;
DirectionRadioGroup.Caption:=rsDirection; FindLabel.Caption := rsText;
DirectionRadioGroup.Items[0]:=rsForward; DirectionRadioGroup.Caption := rsDirection;
DirectionRadioGroup.Items[1]:=rsBackward; DirectionRadioGroup.Items[0] := rsForward;
DirectionRadioGroup.Items[1] := rsBackward;
//Setting up button eventhandlers //Setting up button eventhandlers
FindButton.OnClick := @FindClick; FindButton.OnClick := @FindClick;
HelpButton.OnClick := @HelpClick; HelpButton.OnClick := @HelpClick;
CancelButton.OnClick := @CancelClick; CancelButton.OnClick := @CancelClick;
//Once the issues concerning FormStyle = fsStayOnTop are resolved we can implement this PopupMode := pmAuto;
//so that the form should stay on top of the application (not on top of everything)
//See bug #8471 in Mantis
//FormStyle := fsStayOnTop;
end; end;
end; end;
@ -268,9 +266,7 @@ begin
FFindForm.OnShow := Self.OnShow; FFindForm.OnShow := Self.OnShow;
FFindForm.HelpContext:=HelpContext; FFindForm.HelpContext:=HelpContext;
FFindForm.Caption:=Title; FFindForm.Caption:=Title;
//Once the issues concerning FormStyle = fsStayOnTop are resolved we can FFindForm.Show;
//make this a non-Modal window using FFindForm.Show;
FFindForm.ShowModal;
Result := true; Result := true;
end; end;
end; end;

View File

@ -64,21 +64,23 @@ end;
function TReplaceDialog.CreateForm: TForm; function TReplaceDialog.CreateForm: TForm;
begin begin
Result:=TReplaceDialogForm.Create(nil); // do not use Self as Owner, otherwise as desgntime this will not work
with TReplaceDialogForm(Result) do begin Result := TReplaceDialogForm.Create(nil);
FindMoreButton.Caption:=rsFindMore; with TReplaceDialogForm(Result) do
ReplaceButton.Caption:=rsReplace; begin
ReplaceAllButton.Caption:=rsReplaceAll; FindMoreButton.Caption := rsFindMore;
CancelButton.Caption:=rsMbCancel; ReplaceButton.Caption := rsReplace;
HelpButton.Caption:=ifsVK_HELP; ReplaceAllButton.Caption := rsReplaceAll;
WholeWordsOnlyCheckBox.Caption:=rsWholeWordsOnly; CancelButton.Caption := rsMbCancel;
CaseSensitiveCheckBox.Caption:=rsCaseSensitive; HelpButton.Caption := ifsVK_HELP;
EntireScopeCheckBox.Caption:=rsEntireScope; WholeWordsOnlyCheckBox.Caption := rsWholeWordsOnly;
TextLabel.Caption:=rsText; CaseSensitiveCheckBox.Caption := rsCaseSensitive;
ReplaceLabel.Caption:=rsReplace; EntireScopeCheckBox.Caption := rsEntireScope;
DirectionRadioGroup.Caption:=rsDirection; TextLabel.Caption := rsText;
DirectionRadioGroup.Items[0]:=rsForward; ReplaceLabel.Caption := rsReplace;
DirectionRadioGroup.Items[1]:=rsBackward; DirectionRadioGroup.Caption := rsDirection;
DirectionRadioGroup.Items[0] := rsForward;
DirectionRadioGroup.Items[1] := rsBackward;
//Setting up button eventhandlers //Setting up button eventhandlers
FindMoreButton.OnClick := @FindClick; FindMoreButton.OnClick := @FindClick;
@ -86,10 +88,7 @@ begin
ReplaceAllButton.OnClick := @ReplaceAllClick; ReplaceAllButton.OnClick := @ReplaceAllClick;
CancelButton.OnClick := @CancelClick; CancelButton.OnClick := @CancelClick;
HelpButton.OnClick := @HelpClick; HelpButton.OnClick := @HelpClick;
//Once the issues concerning FormStyle = fsStayOnTop are resolved we can implement this PopupMode := pmAuto;
//so that the form should stay on top of the application (not on top of everything)
//See bug #8471 in Mantis
//FormStyle := fsStayOnTop;
end; end;
end; end;