lcl: set PopupMode to pmAuto to fix problems with showing input/message/question dialogs to users from StayOnTop forms

win32: fix ShowModal of child forms which has WS_EX_TOPMOST parent

git-svn-id: trunk@28200 -
This commit is contained in:
paul 2010-11-13 09:12:04 +00:00
parent 06f15d8c61
commit 511b386b50
3 changed files with 10 additions and 2 deletions

View File

@ -41,6 +41,7 @@ begin
Form.CreateNew(nil, 0);
with Form do
begin
PopupMode := pmAuto;
BorderStyle := bsDialog;
Caption := InputCaption;
Position := poScreenCenter;

View File

@ -182,6 +182,7 @@ begin
//debugln('TPromptDialog.CreateMessageDialog A ButtonCount=',dbgs(ButtonCount));
ControlStyle:= ControlStyle-[csSetCaption];
PopupMode := pmAuto;
BorderStyle := bsDialog;
Position := poScreenCenter;
SetInitialBounds(0,0,200,100);
@ -794,7 +795,7 @@ var
IsDefault: Boolean;
begin
inherited Create(nil);
PopupMode := pmAuto;
BorderStyle := bsDialog;
Position := poScreenCenter;
MessageTxt := ConvertLineEndings(aMsg);

View File

@ -661,8 +661,14 @@ begin
end;
class procedure TWin32WSCustomForm.ShowModal(const ACustomForm: TCustomForm);
var
Parent: HWND;
begin
BringWindowToTop(ACustomForm.Handle);
Parent := GetParent(ACustomForm.Handle);
if (Parent <> 0) and (GetWindowLong(Parent, GWL_EXSTYLE) and WS_EX_TOPMOST <> 0) then
SetWindowPos(ACustomForm.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE)
else
BringWindowToTop(ACustomForm.Handle);
end;
class procedure TWin32WSCustomForm.SetAlphaBlend(const ACustomForm: TCustomForm;