jvcllaz: Make TJvGroupHeader high-dpi aware.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7295 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-01-17 22:12:08 +00:00
parent 3132e4ef1f
commit a4945a3a0a

View File

@ -74,13 +74,15 @@ type
procedure SetBevelSpace(Value: Integer);
// procedure SetLabelOptions(Value: TJvGroupHeaderOptions);
protected
procedure StyleChanged(Sender: TObject); virtual;
procedure BevelLine(C: TColor; X, Y, AWidth: Integer); virtual;
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
procedure DoDrawText(var Rect: TRect; Flags: Longint); virtual;
procedure FontChanged; override;
function GetLabelText: string; virtual;
procedure Paint; override;
procedure StyleChanged(Sender: TObject); virtual;
procedure TextChanged; override;
procedure FontChanged; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -256,6 +258,18 @@ begin
inherited Destroy;
end;
procedure TJvGroupHeader.DoAutoAdjustLayout(
const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double);
begin
inherited;
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
begin
FBevelSpace := round(FBevelSpace * AXProportion);
FPositionOffset := round(FPositionOffset * AXProportion);
end;
end;
function TJvGroupHeader.GetLabelText: string;
begin
Result := Caption;