You've already forked lazarus-ccr
jvcllaz: Fix lcl scaling of TJvTmTimeLine
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6750 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -81,7 +81,6 @@ type
|
|||||||
FReadOnly: Boolean;
|
FReadOnly: Boolean;
|
||||||
FRightClickSelect: Boolean;
|
FRightClickSelect: Boolean;
|
||||||
FDayWidth: Integer;
|
FDayWidth: Integer;
|
||||||
FButtonWidth: Integer;
|
|
||||||
FIconDayDist: Integer;
|
FIconDayDist: Integer;
|
||||||
FDate: TDate;
|
FDate: TDate;
|
||||||
FSelDate: TDate;
|
FSelDate: TDate;
|
||||||
@ -161,7 +160,7 @@ type
|
|||||||
// procedure GetDlgCode(var Code: TDlgCodes); override; <--- wp
|
// procedure GetDlgCode(var Code: TDlgCodes); override; <--- wp
|
||||||
// procedure CursorChanged; override; <--- wo
|
// procedure CursorChanged; override; <--- wo
|
||||||
procedure Change; virtual;
|
procedure Change; virtual;
|
||||||
{$IFDEF LCL_FullVersion >= 1080000}
|
{$IF LCL_FullVersion >= 1080000}
|
||||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||||
const AXProportion, AYProportion: Double); override;
|
const AXProportion, AYProportion: Double); override;
|
||||||
{$IFEND}
|
{$IFEND}
|
||||||
@ -444,7 +443,6 @@ begin
|
|||||||
FMonthFont.Size := 18;
|
FMonthFont.Size := 18;
|
||||||
|
|
||||||
FObjectsFontStyle := [fsUnderline];
|
FObjectsFontStyle := [fsUnderline];
|
||||||
FButtonWidth := -1;
|
|
||||||
FDayWidth := -1;
|
FDayWidth := -1;
|
||||||
FIconDayDist := -1;
|
FIconDayDist := -1;
|
||||||
FDate := SysUtils.Date - 7;
|
FDate := SysUtils.Date - 7;
|
||||||
@ -465,7 +463,7 @@ begin
|
|||||||
with FLeftBtn do
|
with FLeftBtn do
|
||||||
begin
|
begin
|
||||||
Align := alLeft;
|
Align := alLeft;
|
||||||
Width := ButtonWidth;
|
Width := cTMTimeLineButtonWidth;
|
||||||
Parent := Self;
|
Parent := Self;
|
||||||
Transparent := False;
|
Transparent := False;
|
||||||
Layout := blGlyphTop;
|
Layout := blGlyphTop;
|
||||||
@ -487,7 +485,7 @@ begin
|
|||||||
with FRightBtn do
|
with FRightBtn do
|
||||||
begin
|
begin
|
||||||
Align := alRight;
|
Align := alRight;
|
||||||
Width := ButtonWidth;
|
Width := cTMTimeLineButtonWidth;
|
||||||
Parent := Self;
|
Parent := Self;
|
||||||
Transparent := False;
|
Transparent := False;
|
||||||
Layout := blGlyphTop;
|
Layout := blGlyphTop;
|
||||||
@ -908,7 +906,7 @@ end;
|
|||||||
|
|
||||||
function TJvCustomTMTimeLine.ButtonWidthStored: Boolean;
|
function TJvCustomTMTimeLine.ButtonWidthStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := FButtonWidth >= 0;
|
Result := ButtonWidth <> Scale96ToFont(cTMTimeLineButtonWidth);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TJvCustomTMTimeLine.DayWidthStored: Boolean;
|
function TJvCustomTMTimeLine.DayWidthStored: Boolean;
|
||||||
@ -918,10 +916,7 @@ end;
|
|||||||
|
|
||||||
function TJvCustomTMTimeLine.GetButtonWidth: Integer;
|
function TJvCustomTMTimeLine.GetButtonWidth: Integer;
|
||||||
begin
|
begin
|
||||||
if ButtonWidthStored then
|
Result := FLeftBtn.Width;
|
||||||
Result := FButtonWidth
|
|
||||||
else
|
|
||||||
Result := Scale96ToFont(cTMTimeLineButtonWidth);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TJvCustomTMTimeLine.GetDayWidth: Integer;
|
function TJvCustomTMTimeLine.GetDayWidth: Integer;
|
||||||
@ -1055,8 +1050,8 @@ begin
|
|||||||
FOnChange(Self);
|
FOnChange(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF LCL_FullVersion >= 1080000}
|
{$IF LCL_FullVersion >= 1080000}
|
||||||
procedure TCustomTMTimeLine.DoAutoAdjustLayout(
|
procedure TJvCustomTMTimeLine.DoAutoAdjustLayout(
|
||||||
const AMode: TLayoutAdjustmentPolicy;
|
const AMode: TLayoutAdjustmentPolicy;
|
||||||
const AXProportion, AYProportion: Double);
|
const AXProportion, AYProportion: Double);
|
||||||
begin
|
begin
|
||||||
@ -1064,11 +1059,9 @@ begin
|
|||||||
|
|
||||||
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
|
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
|
||||||
begin
|
begin
|
||||||
if FDayWidthStored then
|
if DayWidthStored then
|
||||||
FDayWidth := Round(FDayWidth * AXProportion);
|
FDayWidth := Round(FDayWidth * AXProportion);
|
||||||
if FButtonWidthStored then
|
if IconDayDistStored then
|
||||||
FButtonWidth := Round(FButtonWidth * AXProportion);
|
|
||||||
if FIconDayDistStored then
|
|
||||||
FIconDayDist := Round(FIconDayDist * AYProportion);
|
FIconDayDist := Round(FIconDayDist * AYProportion);
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
@ -1244,9 +1237,8 @@ end;
|
|||||||
|
|
||||||
procedure TJvCustomTMTimeline.SetButtonWidth(const Value: Integer);
|
procedure TJvCustomTMTimeline.SetButtonWidth(const Value: Integer);
|
||||||
begin
|
begin
|
||||||
if (FButtonWidth <> Value) and (Value <> 0) and (Value >= -1) then
|
if (GetButtonWidth <> Value) and (Value > 0) then
|
||||||
begin
|
begin
|
||||||
FButtonWidth := Value;
|
|
||||||
FLeftBtn.Width := ButtonWidth;
|
FLeftBtn.Width := ButtonWidth;
|
||||||
FRightBtn.Width := ButtonWidth;
|
FRightBtn.Width := ButtonWidth;
|
||||||
Invalidate;
|
Invalidate;
|
||||||
|
Reference in New Issue
Block a user