diff --git a/components/jvcllaz/examples/JvRollOut/JvRollOutDemo.lpi b/components/jvcllaz/examples/JvRollOut/JvRollOutDemo.lpi index 8a98a7726..fb1037bfa 100644 --- a/components/jvcllaz/examples/JvRollOut/JvRollOutDemo.lpi +++ b/components/jvcllaz/examples/JvRollOut/JvRollOutDemo.lpi @@ -1,11 +1,13 @@ - + + + + - <Scaled Value="True"/> <ResourceType Value="res"/> @@ -21,9 +23,10 @@ <Version Value="2"/> </PublishOptions> <RunParams> - <local> - <FormatVersion Value="1"/> - </local> + <FormatVersion Value="2"/> + <Modes Count="1"> + <Mode0 Name="default"/> + </Modes> </RunParams> <RequiredPackages Count="1"> <Item1> diff --git a/components/jvcllaz/examples/JvRollOut/MainFrm.lfm b/components/jvcllaz/examples/JvRollOut/MainFrm.lfm index ef91f272f..6e49a494e 100644 --- a/components/jvcllaz/examples/JvRollOut/MainFrm.lfm +++ b/components/jvcllaz/examples/JvRollOut/MainFrm.lfm @@ -13,7 +13,6 @@ object Form1: TForm1 OnCreate = FormCreate Position = poScreenCenter LCLVersion = '2.1.0.0' - Scaled = False object Splitter1: TSplitter Cursor = crSizeWE Left = 280 @@ -51,7 +50,7 @@ object Form1: TForm1 Left = 16 Height = 19 Top = 40 - Width = 67 + Width = 66 Caption = 'Tab Stop' Checked = True OnClick = chkTabStopClick @@ -62,7 +61,7 @@ object Form1: TForm1 Left = 128 Height = 19 Top = 16 - Width = 113 + Width = 112 Caption = 'Toggle Anywhere' OnClick = chkToggleAnywhereClick TabOrder = 2 @@ -1066,7 +1065,10 @@ object Form1: TForm1 Width = 131 Align = alBottom ButtonFont.Color = clWindowText + ButtonFont.Height = -27 + ButtonFont.Name = 'Courier' ButtonFont.Style = [fsBold] + ButtonHeight = 60 Caption = '&J' Font.Color = clWindowText GroupIndex = 1 @@ -1080,7 +1082,7 @@ object Form1: TForm1 FAWidth = 145 FAHeight = 170 FCWidth = 22 - FCHeight = 22 + FCHeight = 62 end object RO19: TJvRollOut Left = 0 diff --git a/components/jvcllaz/run/JvCtrls/jvrollout.pas b/components/jvcllaz/run/JvCtrls/jvrollout.pas index 653bc6431..faeabd615 100644 --- a/components/jvcllaz/run/JvCtrls/jvrollout.pas +++ b/components/jvcllaz/run/JvCtrls/jvrollout.pas @@ -226,6 +226,17 @@ type property OnCollapse: TNotifyEvent read FOnCollapse write FOnCollapse; property OnExpand: TNotifyEvent read FOnExpand write FOnExpand; + { LCL scaling } + protected + procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; + const AXProportion, AYProportion: Double); override; + public + {$IF LCL_FullVersion >= 2010000} + procedure FixDesignFontsPPI(const ADesignTimePPI: Integer); override; + {$IFEND} + procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND} + const AProportion: Double); override; + public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -1610,6 +1621,40 @@ begin end; end; +{ LCL scaling } + +procedure TJvCustomRollOut.DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; + const AXProportion, AYProportion: Double); +begin + inherited; + if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then + begin + FButtonHeight := round(FButtonHeight * AYProportion); + FChildOffset := round(FChildOffset * AXProportion); + FCWidth := round(FCWidth * AXProportion); + FCHeight := round(FCHeight * AYProportion); + FAWidth := round(FAWidth * AXProportion); + FAHeight := round(FAHeight * AYProportion); + end; +end; + +{$IF LCL_FullVersion >= 2010000} +procedure TJvCustomRollOut.FixDesignFontsPPI(const ADesignTimePPI: Integer); +begin + inherited; + DoFixDesignFontPPI(FButtonFont, ADesignTimePPI); +end; +{$IFEND} + +procedure TJvCustomRollOut.ScaleFontsPPI( + {$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND} + const AProportion: Double); +begin + inherited; + DoScaleFontPPI(FButtonFont, AToPPI, AProportion); +end; + + //=== { TJvRollOutAction } =================================================== destructor TJvRollOutAction.Destroy;