lcl: forgot monitor.inc

git-svn-id: trunk@19240 -
This commit is contained in:
paul 2009-04-06 08:17:36 +00:00
parent 3a19dfff75
commit 0ef22bee57
2 changed files with 100 additions and 0 deletions

1
.gitattributes vendored
View File

@ -3633,6 +3633,7 @@ lcl/include/menu.inc svneol=native#text/pascal
lcl/include/menuactionlink.inc svneol=native#text/pascal
lcl/include/menuitem.inc svneol=native#text/pascal
lcl/include/messagedialogs.inc svneol=native#text/pascal
lcl/include/monitor.inc svneol=native#text/pascal
lcl/include/mouse.inc svneol=native#text/pascal
lcl/include/notebook.inc svneol=native#text/pascal
lcl/include/page.inc svneol=native#text/pascal

99
lcl/include/monitor.inc Normal file
View File

@ -0,0 +1,99 @@
{%MainUnit ../forms.pp}
{******************************************************************************
TMonitor
******************************************************************************
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
{ TMonitor }
function TMonitor.GetInfo(out Info: TMonitorInfo): Boolean;
begin
Info.cbSize := SizeOf(TMonitorInfo);
Result := GetMonitorInfo(Handle, @Info);
end;
function TMonitor.GetLeft: Integer;
begin
with GetBoundsRect do
Result := Left;
end;
function TMonitor.GetHeight: Integer;
begin
with GetBoundsRect do
Result := Bottom - Top;
end;
function TMonitor.GetTop: Integer;
begin
with GetBoundsRect do
Result := Top;
end;
function TMonitor.GetWidth: Integer;
begin
with GetBoundsRect do
Result := Right - Left;
end;
function TMonitor.GetBoundsRect: TRect;
var
Info: TMonitorInfo;
begin
if GetInfo(Info) then
Result := Info.rcMonitor
else
Result := Rect(0, 0, 0, 0);
end;
function TMonitor.GetWorkareaRect: TRect;
var
Info: TMonitorInfo;
begin
if GetInfo(Info) then
Result := Info.rcWork
else
Result := Rect(0, 0, 0, 0);
end;
function TMonitor.GetPrimary: Boolean;
var
Info: TMonitorInfo;
begin
Result := GetInfo(Info) and (Info.dwFlags and MONITORINFOF_PRIMARY <> 0)
end;
{ TMonitorList }
function TMonitorList.GetItem(AIndex: Integer): TMonitor;
begin
Result := TMonitor(inherited Get(AIndex));
end;
procedure TMonitorList.SetItem(AIndex: Integer; const AValue: TMonitor);
begin
inherited Put(AIndex, AValue)
end;
procedure TMonitorList.Notify(Ptr: Pointer; Action: TListNotification);
begin
if Action = lnDeleted then
TMonitor(Ptr).Free;
end;
// included by forms.pp