LCL: added ASystemTopAlso bool param to TApplication.RemoveStayOnTop & TApplication.RestoreStayOnTop, WS.AppRemoveStayOnTop & WS.AppRestoreStayOnTop, because TApplication.HandleException should normalize all stayontop (app, sys), but app activate/deactivate only fsStayOnTop.

git-svn-id: trunk@25535 -
This commit is contained in:
zeljko 2010-05-20 10:54:19 +00:00
parent b0ec64ca2d
commit c86392f301
8 changed files with 26 additions and 26 deletions

View File

@ -1299,8 +1299,8 @@ type
const Keyword: String): Boolean; const Keyword: String): Boolean;
function HelpKeyword(const Keyword: String): Boolean; function HelpKeyword(const Keyword: String): Boolean;
procedure ShowHelpForObject(Sender: TObject); procedure ShowHelpForObject(Sender: TObject);
procedure RemoveStayOnTop; procedure RemoveStayOnTop(const ASystemTopAlso: Boolean = False);
procedure RestoreStayOnTop; procedure RestoreStayOnTop(const ASystemTopAlso: Boolean = False);
function IsWaiting: boolean; function IsWaiting: boolean;
procedure CancelHint; procedure CancelHint;
procedure HideHint; procedure HideHint;

View File

@ -1175,7 +1175,7 @@ begin
// a message can be shown // a message can be shown
if GetCapture <> 0 then SendMessage(GetCapture, LM_CANCELMODE, 0, 0); if GetCapture <> 0 then SendMessage(GetCapture, LM_CANCELMODE, 0, 0);
if not Skip then if not Skip then
RemoveStayOnTop; RemoveStayOnTop(True);
// handle the exception // handle the exception
if ExceptObject is Exception then if ExceptObject is Exception then
begin begin
@ -1196,7 +1196,7 @@ begin
else else
SysUtils.ShowException(ExceptObject, ExceptAddr); SysUtils.ShowException(ExceptObject, ExceptAddr);
if not Skip then if not Skip then
RestoreStayOnTop; RestoreStayOnTop(True);
Exclude(FFlags, AppHandlingException); Exclude(FFlags, AppHandlingException);
end; end;
@ -1257,12 +1257,12 @@ end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
procedure TApplication.RemoveStayOnTop; procedure TApplication.RemoveStayOnTop;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TApplication.RemoveStayOnTop; procedure TApplication.RemoveStayOnTop(const ASystemTopAlso: Boolean = False);
var var
i: Integer; i: Integer;
AForm: TCustomForm; AForm: TCustomForm;
begin begin
if WidgetSet.AppRemoveStayOnTopFlags then if WidgetSet.AppRemoveStayOnTopFlags(ASystemTopAlso) then
Exit; Exit;
if Screen = nil then if Screen = nil then
Exit; Exit;
@ -1282,11 +1282,11 @@ begin
end; end;
end; end;
procedure TApplication.RestoreStayOnTop; procedure TApplication.RestoreStayOnTop(const ASystemTopAlso: Boolean = False);
var var
i: integer; i: integer;
begin begin
if WidgetSet.AppRestoreStayOnTopFlags then if WidgetSet.AppRestoreStayOnTopFlags(ASystemTopAlso) then
Exit; Exit;
if FRestoreStayOnTop <> nil then if FRestoreStayOnTop <> nil then
for i := FRestoreStayOnTop.Count - 1 downto 0 do for i := FRestoreStayOnTop.Count - 1 downto 0 do

View File

@ -61,12 +61,12 @@ procedure TWidgetSet.AppSetVisible(const AVisible: Boolean);
begin begin
end; end;
function TWidgetSet.AppRemoveStayOnTopFlags: Boolean; function TWidgetSet.AppRemoveStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean;
begin begin
Result := False; Result := False;
end; end;
function TWidgetSet.AppRestoreStayOnTopFlags: Boolean; function TWidgetSet.AppRestoreStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean;
begin begin
Result := False; Result := False;
end; end;

View File

@ -107,8 +107,8 @@ type
procedure AppSetIcon(const Small, Big: HICON); virtual; procedure AppSetIcon(const Small, Big: HICON); virtual;
procedure AppSetTitle(const ATitle: string); virtual; procedure AppSetTitle(const ATitle: string); virtual;
procedure AppSetVisible(const AVisible: Boolean); virtual; procedure AppSetVisible(const AVisible: Boolean); virtual;
function AppRemoveStayOnTopFlags: Boolean; virtual; function AppRemoveStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean; virtual;
function AppRestoreStayOnTopFlags: Boolean; virtual; function AppRestoreStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean; virtual;
function LCLPlatform: TLCLPlatform; virtual; abstract; function LCLPlatform: TLCLPlatform; virtual; abstract;
function GetLCLCapability(ACapability: TLCLCapability): PtrUInt; virtual; function GetLCLCapability(ACapability: TLCLCapability): PtrUInt; virtual;

View File

@ -75,8 +75,8 @@ type
FSysColorBrushes: array[0..MAX_SYS_COLORS] of HBrush; FSysColorBrushes: array[0..MAX_SYS_COLORS] of HBrush;
procedure ClearCachedColors; procedure ClearCachedColors;
procedure SetOverrideCursor(const AValue: TObject); procedure SetOverrideCursor(const AValue: TObject);
procedure QtRemoveStayOnTop; procedure QtRemoveStayOnTop(const ASystemTopAlso: Boolean = False);
procedure QtRestoreStayOnTop; procedure QtRestoreStayOnTop(const ASystemTopAlso: Boolean = False);
protected protected
FStockNullBrush: HBRUSH; FStockNullBrush: HBRUSH;
FStockBlackBrush: HBRUSH; FStockBlackBrush: HBRUSH;
@ -109,8 +109,8 @@ type
procedure AppBringToFront; override; procedure AppBringToFront; override;
procedure AppSetIcon(const Small, Big: HICON); override; procedure AppSetIcon(const Small, Big: HICON); override;
procedure AppSetTitle(const ATitle: string); override; procedure AppSetTitle(const ATitle: string); override;
function AppRemoveStayOnTopFlags: Boolean; override; function AppRemoveStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean; override;
function AppRestoreStayOnTopFlags: Boolean; override; function AppRestoreStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean; override;
public public
constructor Create; override; constructor Create; override;
destructor Destroy; override; destructor Destroy; override;

View File

@ -312,16 +312,16 @@ begin
QCoreApplication_setApplicationName(@W); QCoreApplication_setApplicationName(@W);
end; end;
function TQtWidgetSet.AppRemoveStayOnTopFlags: Boolean; function TQtWidgetSet.AppRemoveStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean;
begin begin
Result := True; Result := True;
QtRemoveStayOnTop; QtRemoveStayOnTop(ASystemTopAlso);
end; end;
function TQtWidgetSet.AppRestoreStayOnTopFlags: Boolean; function TQtWidgetSet.AppRestoreStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean;
begin begin
Result := True; Result := True;
QtRestoreStayOnTop; QtRestoreStayOnTop(ASystemTopAlso);
end; end;
procedure TQtWidgetSet.SetOverrideCursor(const AValue: TObject); procedure TQtWidgetSet.SetOverrideCursor(const AValue: TObject);
@ -336,7 +336,7 @@ begin
FOverrideCursor := AValue; FOverrideCursor := AValue;
end; end;
procedure TQtWidgetSet.QtRemoveStayOnTop; procedure TQtWidgetSet.QtRemoveStayOnTop(const ASystemTopAlso: Boolean = False);
var var
i: Integer; i: Integer;
AForm: TCustomForm; AForm: TCustomForm;
@ -372,7 +372,7 @@ begin
end; end;
end; end;
procedure TQtWidgetSet.QtRestoreStayOnTop; procedure TQtWidgetSet.QtRestoreStayOnTop(const ASystemTopAlso: Boolean = False);
var var
i: Integer; i: Integer;
AForm: TCustomForm; AForm: TCustomForm;

View File

@ -175,8 +175,8 @@ type
procedure AppSetIcon(const Small, Big: HICON); override; procedure AppSetIcon(const Small, Big: HICON); override;
procedure AppSetTitle(const ATitle: string); override; procedure AppSetTitle(const ATitle: string); override;
procedure AppSetVisible(const AVisible: Boolean); override; procedure AppSetVisible(const AVisible: Boolean); override;
function AppRemoveStayOnTopFlags: Boolean; override; function AppRemoveStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean; override;
function AppRestoreStayOnTopFlags: Boolean; override; function AppRestoreStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean; override;
function InitStockFont(AFont: TObject; AStockFont: TStockFont): Boolean; override; function InitStockFont(AFont: TObject; AStockFont: TStockFont): Boolean; override;

View File

@ -509,13 +509,13 @@ begin
Windows.ShowWindow(FAppHandle, SW_HIDE); Windows.ShowWindow(FAppHandle, SW_HIDE);
end; end;
function TWin32WidgetSet.AppRemoveStayOnTopFlags: Boolean; function TWin32WidgetSet.AppRemoveStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean;
begin begin
RemoveStayOnTopFlags(AppHandle); RemoveStayOnTopFlags(AppHandle);
Result := True; Result := True;
end; end;
function TWin32WidgetSet.AppRestoreStayOnTopFlags: Boolean; function TWin32WidgetSet.AppRestoreStayOnTopFlags(const ASystemTopAlso: Boolean = False): Boolean;
begin begin
RestoreStayOnTopFlags(AppHandle); RestoreStayOnTopFlags(AppHandle);
Result := True; Result := True;