diff --git a/lcl/forms.pp b/lcl/forms.pp index 09015b9d5d..093756a90f 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -850,6 +850,7 @@ type function GetHeight : Integer; function GetMonitor(Index: Integer): TMonitor; function GetMonitorCount: Integer; + function GetPrimaryMonitor: TMonitor; function GetWidth : Integer; procedure AddForm(AForm: TCustomForm); procedure RemoveForm(AForm: TCustomForm); @@ -925,12 +926,13 @@ type property HintFont: TFont read GetHintFont; property MonitorCount: Integer read GetMonitorCount; property Monitors[Index: Integer]: TMonitor read GetMonitor; + property PixelsPerInch: integer read FPixelsPerInch; + property PrimaryMonitor: TMonitor read GetPrimaryMonitor; property Width: Integer read GetWidth; property OnActiveControlChange: TNotifyEvent read FOnActiveControlChange write FOnActiveControlChange; property OnActiveFormChange: TNotifyEvent read FOnActiveFormChange write FOnActiveFormChange; - property PixelsPerInch: integer read FPixelsPerInch; end; diff --git a/lcl/include/screen.inc b/lcl/include/screen.inc index 43faabb799..526038a74e 100644 --- a/lcl/include/screen.inc +++ b/lcl/include/screen.inc @@ -551,6 +551,16 @@ begin Result := FMonitors.Count; end; +function TScreen.GetPrimaryMonitor: TMonitor; +var + i: integer; +begin + for i := 0 to MonitorCount - 1 do + if Monitors[i].Primary then + Exit(Monitors[i]); + Result := nil; +end; + function TScreen.GetHintFont: TFont; begin if (FHintFont=nil) then