You've already forked lazarus-ccr
jvcllaz: Implement lcl scaling for TJvRollOut. Adapt demo project.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7287 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<CompatibilityMode Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="JvRollOutDemo"/>
|
||||
<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>
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user