fpspreadsheet: Add zooming support to WorksheetGrid (use SHIFT+CTRL+MouseWheel in fpctrls demo).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5218 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-09-26 22:34:28 +00:00
parent aed1feecaa
commit 0a99b97c4b
7 changed files with 161 additions and 78 deletions

View File

@ -140,7 +140,8 @@ function PtsToIn(AValue: Double): Double; inline;
function PtsToTwips(AValue: Single): Integer; inline;
function PtsToMM(AValue: Double): Double; inline;
function PtsToPx(AValue: Double; AScreenPixelsPerInch: Integer): Integer; inline;
function pxToPts(AValue, AScreenPixelsPerInch: Integer): Double; inline;
function pxToPts(AValue, AScreenPixelsPerInch: Integer): Double; inline; overload;
function pxToPts(AValue: Double; AScreenPixelsPerInch: Integer): Double; inline; overload;
function TwipsToPts(AValue: Integer): Single; inline;
function HTMLLengthStrToPts(AValue: String; DefaultUnits: String = 'pt'): Double;
@ -1701,6 +1702,11 @@ begin
Result := (AValue / AScreenPixelsPerInch) * 72;
end;
function pxToPts(AValue: Double; AScreenPixelsPerInch: Integer): Double;
begin
Result := AValue / AScreenPixelsPerInch * 72.0;
end;
{@@ ----------------------------------------------------------------------------
Converts points to pixels
@param AValue Length value given in points