Adds more TScreen properties, from patch from bug #19379 by wovan.bugger

git-svn-id: trunk@31339 -
This commit is contained in:
sekelsenmat 2011-06-22 21:03:25 +00:00
parent 0cda734085
commit 35a781c607
11 changed files with 121 additions and 0 deletions

View File

@ -943,8 +943,11 @@ type
function GetCustomFormsZOrdered(Index: Integer): TCustomForm;
function GetDataModuleCount: Integer;
function GetDataModules(AIndex: Integer): TDataModule;
function GetDesktopLeft: Integer;
function GetDesktopTop: Integer;
function GetDesktopHeight: Integer;
function GetDesktopWidth: Integer;
function GetDesktopRect: TRect;
function GetFonts : TStrings;
function GetFormCount: Integer;
function GetForms(IIndex: Integer): TForm;
@ -973,6 +976,11 @@ type
procedure DoRemoveDataModule(DataModule: TDataModule);
procedure NotifyScreenFormHandler(HandlerType: TScreenNotification;
Form: TCustomForm);
function GetWorkAreaHeight: Integer;
function GetWorkAreaLeft: Integer;
function GetWorkAreaRect: TRect;
function GetWorkAreaTop: Integer;
function GetWorkAreaWidth: Integer;
protected
function GetHintFont: TFont; virtual;
function GetIconFont: TFont; virtual;
@ -1033,8 +1041,12 @@ type
property CustomFormZOrderCount: Integer read GetCustomFormZOrderCount;
property CustomFormsZOrdered[Index: Integer]: TCustomForm
read GetCustomFormsZOrdered; // lower index means on top
property DesktopLeft: Integer read GetDesktopLeft;
property DesktopTop: Integer read GetDesktopTop;
property DesktopHeight: Integer read GetDesktopHeight;
property DesktopWidth: Integer read GetDesktopWidth;
property DesktopRect: TRect read GetDesktopRect;
property FocusedForm: TCustomForm read FFocusedForm;
property FormCount: Integer read GetFormCount;
property Forms[Index: Integer]: TForm read GetForms;
@ -1053,6 +1065,11 @@ type
property PixelsPerInch: integer read FPixelsPerInch;
property PrimaryMonitor: TMonitor read GetPrimaryMonitor;
property Width: Integer read GetWidth;
property WorkAreaRect: TRect read GetWorkAreaRect;
property WorkAreaHeight: Integer read GetWorkAreaHeight;
property WorkAreaLeft: Integer read GetWorkAreaLeft;
property WorkAreaTop: Integer read GetWorkAreaTop;
property WorkAreaWidth: Integer read GetWorkAreaWidth;
property OnActiveControlChange: TNotifyEvent read FOnActiveControlChange
write FOnActiveControlChange;
property OnActiveFormChange: TNotifyEvent read FOnActiveFormChange

View File

@ -654,6 +654,48 @@ begin
Result := GetSystemMetrics(SM_CXVIRTUALSCREEN);
end;
function TScreen.GetDesktopLeft: Integer;
begin
Result := GetSystemMetrics(SM_XVIRTUALSCREEN);
end;
function TScreen.GetDesktopRect: TRect;
begin
Result := Bounds(DesktopLeft, DesktopTop, DesktopWidth, DesktopHeight);
end;
function TScreen.GetDesktopTop: Integer;
begin
Result := GetSystemMetrics(SM_YVIRTUALSCREEN);
end;
function TScreen.GetWorkAreaLeft: Integer;
begin
Result := WorkAreaRect.Left;
end;
function TScreen.GetWorkAreaRect: TRect;
begin
SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0);
end;
function TScreen.GetWorkAreaTop: Integer;
begin
Result := WorkAreaRect.Top;
end;
function TScreen.GetWorkAreaHeight: Integer;
begin
with WorkAreaRect do Result := Bottom - Top;
end;
function TScreen.GetWorkAreaWidth: Integer;
begin
with WorkAreaRect do Result := Right - Left;
end;
{------------------------------------------------------------------------------
Function: TScreen.AddForm
Params: FForm: The form to be added

View File

@ -3616,6 +3616,21 @@ begin
TCarbonBitmap(Mask), XMask, YMask, Rop);
end;
function TCarbonWidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
pvParam: Pointer; fWinIni: DWord): LongBool;
begin
Result:=False;
Case uiAction of
SPI_GETWORKAREA: begin
TRect(pvParam^):=Bounds(GetSystemMetrics(SM_XVIRTUALSCREEN),
GetSystemMetrics(SM_YVIRTUALSCREEN),
GetSystemMetrics(SM_CXVIRTUALSCREEN),
GetSystemMetrics(SM_CYVIRTUALSCREEN));
Result:=True;
end;
end;
end;
{------------------------------------------------------------------------------
Method: TextOut
Params: DC - Handle of the device context

View File

@ -217,6 +217,7 @@ function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; ov
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override;
function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;
function SystemParametersInfo(uiAction: DWord; uiParam: DWord; pvParam: Pointer; fWinIni: DWord): LongBool; override;
function TextOut(DC: HDC; X,Y : Integer; Str : Pchar; Count: Integer) : Boolean; override;
function UpdateWindow(Handle: HWND): Boolean; override;

View File

@ -9776,6 +9776,21 @@ begin
Rop);
end;
function TGTKWidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
pvParam: Pointer; fWinIni: DWord): LongBool;
begin
Result:=False;
Case uiAction of
SPI_GETWORKAREA: begin
TRect(pvParam^):=Bounds(GetSystemMetrics(SM_XVIRTUALSCREEN),
GetSystemMetrics(SM_YVIRTUALSCREEN),
GetSystemMetrics(SM_CXVIRTUALSCREEN),
GetSystemMetrics(SM_CYVIRTUALSCREEN));
Result:=True;
end;
end;
end;
{------------------------------------------------------------------------------
Function: TextOut
Params: DC:

View File

@ -215,6 +215,7 @@ function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; ov
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override;
function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;
function SystemParametersInfo(uiAction: DWord; uiParam: DWord; pvParam: Pointer; fWinIni: DWord): LongBool; override;
function TextOut(DC: HDC; X,Y : Integer; Str : Pchar; Count: Integer) : Boolean; override;

View File

@ -9106,6 +9106,21 @@ begin
Rop);
end;
function TGtk2WidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
pvParam: Pointer; fWinIni: DWord): LongBool;
begin
Result:=False;
Case uiAction of
SPI_GETWORKAREA: begin
TRect(pvParam^):=Bounds(GetSystemMetrics(SM_XVIRTUALSCREEN),
GetSystemMetrics(SM_YVIRTUALSCREEN),
GetSystemMetrics(SM_CXVIRTUALSCREEN),
GetSystemMetrics(SM_CYVIRTUALSCREEN));
Result:=True;
end;
end;
end;
{------------------------------------------------------------------------------
Function: TextOut
Params: DC:

View File

@ -231,6 +231,7 @@ function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; ov
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override;
function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;
function SystemParametersInfo(uiAction: DWord; uiParam: DWord; pvParam: Pointer; fWinIni: DWord): LongBool; override;
function TextOut(DC: HDC; X,Y : Integer; Str : Pchar; Count: Integer) : Boolean; override;

View File

@ -5790,6 +5790,13 @@ function TQtWidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord; pvPa
begin
case uiAction of
SPI_GETWHEELSCROLLLINES: PDword(pvPAram)^ := QApplication_wheelScrollLines;
SPI_GETWORKAREA: begin
TRect(pvParam^):=Bounds(GetSystemMetrics(SM_XVIRTUALSCREEN),
GetSystemMetrics(SM_YVIRTUALSCREEN),
GetSystemMetrics(SM_CXVIRTUALSCREEN),
GetSystemMetrics(SM_CYVIRTUALSCREEN));
Result:=True;
end;
else
Result := False;
end

View File

@ -3534,6 +3534,12 @@ begin
Result := true;
end;
function TWinCEWidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
pvParam: Pointer; fWinIni: DWord): LongBool;
begin
Result := Windows.SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
end;
{------------------------------------------------------------------------------
Method: TextOut
Params: DC - handle of device context

View File

@ -229,6 +229,7 @@ function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; ov
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override;
function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;
function SystemParametersInfo(uiAction: DWord; uiParam: DWord; pvParam: Pointer; fWinIni: DWord): LongBool; override;
function TextOut(DC: HDC; X,Y : Integer; Str : Pchar; Count: Integer) : Boolean; override;