You've already forked lazarus-ccr
tvplanit: DPI-aware font sizes of planner controls.
Publish some missing inherited properties of VpCalendar Move "GetTimeFormat" from FullDemo to unit vpmisc. Remove some hints/warnings. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5078 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1,35 +1,35 @@
|
|||||||
object MainForm: TMainForm
|
object MainForm: TMainForm
|
||||||
Left = 301
|
Left = 301
|
||||||
Height = 600
|
Height = 596
|
||||||
Top = 177
|
Top = 177
|
||||||
Width = 978
|
Width = 959
|
||||||
Caption = 'Turbo Power VisualPlanIt Demo'
|
Caption = 'Turbo Power VisualPlanIt Demo'
|
||||||
ClientHeight = 580
|
ClientHeight = 576
|
||||||
ClientWidth = 978
|
ClientWidth = 959
|
||||||
Menu = MainMenu1
|
Menu = MainMenu1
|
||||||
OnCloseQuery = FormCloseQuery
|
OnCloseQuery = FormCloseQuery
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '1.7'
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 125
|
Left = 125
|
||||||
Height = 580
|
Height = 576
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 853
|
Width = 834
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 580
|
ClientHeight = 576
|
||||||
ClientWidth = 853
|
ClientWidth = 834
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object HeaderPanel: TPanel
|
object HeaderPanel: TPanel
|
||||||
Left = 2
|
Left = 2
|
||||||
Height = 48
|
Height = 48
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 851
|
Width = 832
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Left = 2
|
BorderSpacing.Left = 2
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 48
|
ClientHeight = 48
|
||||||
ClientWidth = 851
|
ClientWidth = 832
|
||||||
Color = clActiveCaption
|
Color = clActiveCaption
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@@ -54,28 +54,28 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object Notebook: TNotebook
|
object Notebook: TNotebook
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 532
|
Height = 528
|
||||||
Top = 48
|
Top = 48
|
||||||
Width = 853
|
Width = 834
|
||||||
PageIndex = 1
|
PageIndex = 0
|
||||||
Align = alClient
|
Align = alClient
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
TabStop = True
|
TabStop = True
|
||||||
object Events: TPage
|
object Events: TPage
|
||||||
object LeftPanel: TPanel
|
object LeftPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 532
|
Height = 528
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 333
|
Width = 333
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 532
|
ClientHeight = 528
|
||||||
ClientWidth = 333
|
ClientWidth = 333
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object VpMonthView1: TVpMonthView
|
object VpMonthView1: TVpMonthView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 197
|
Height = 197
|
||||||
Top = 335
|
Top = 331
|
||||||
Width = 333
|
Width = 333
|
||||||
DataStore = VpBufDSDataStore1
|
DataStore = VpBufDSDataStore1
|
||||||
ControlLink = VpControlLink1
|
ControlLink = VpControlLink1
|
||||||
@@ -108,14 +108,14 @@ object MainForm: TMainForm
|
|||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 5
|
Height = 5
|
||||||
Top = 330
|
Top = 326
|
||||||
Width = 333
|
Width = 333
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
ResizeAnchor = akBottom
|
ResizeAnchor = akBottom
|
||||||
end
|
end
|
||||||
object VpDayView1: TVpDayView
|
object VpDayView1: TVpDayView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 288
|
Height = 284
|
||||||
Top = 42
|
Top = 42
|
||||||
Width = 333
|
Width = 333
|
||||||
DataStore = VpBufDSDataStore1
|
DataStore = VpBufDSDataStore1
|
||||||
@@ -262,15 +262,15 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object Splitter3: TSplitter
|
object Splitter3: TSplitter
|
||||||
Left = 333
|
Left = 333
|
||||||
Height = 532
|
Height = 528
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
end
|
end
|
||||||
object VpWeekView1: TVpWeekView
|
object VpWeekView1: TVpWeekView
|
||||||
Left = 338
|
Left = 338
|
||||||
Height = 532
|
Height = 528
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 515
|
Width = 496
|
||||||
DataStore = VpBufDSDataStore1
|
DataStore = VpBufDSDataStore1
|
||||||
ControlLink = VpControlLink1
|
ControlLink = VpControlLink1
|
||||||
Color = clWindow
|
Color = clWindow
|
||||||
@@ -561,7 +561,7 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object VpNavBar1: TVpNavBar
|
object VpNavBar1: TVpNavBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 580
|
Height = 576
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 120
|
Width = 120
|
||||||
ActiveFolder = 0
|
ActiveFolder = 0
|
||||||
@@ -664,7 +664,7 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
Left = 120
|
Left = 120
|
||||||
Height = 580
|
Height = 576
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
end
|
end
|
||||||
|
@@ -11,7 +11,8 @@ uses
|
|||||||
Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics, Dialogs,
|
||||||
ExtCtrls, StdCtrls, ComCtrls, LCLTranslator, Menus, VpBaseDS, VpDayView,
|
ExtCtrls, StdCtrls, ComCtrls, LCLTranslator, Menus, VpBaseDS, VpDayView,
|
||||||
VpWeekView, VpTaskList, VpAbout, VpContactGrid, VpMonthView, VpResEditDlg,
|
VpWeekView, VpTaskList, VpAbout, VpContactGrid, VpMonthView, VpResEditDlg,
|
||||||
VpContactButtons, VpBufDS, VpNavBar, VpData, VpPrtPrvDlg, VpPrtFmtDlg, Types, VpBase;
|
VpContactButtons, VpBufDS, VpNavBar, VpData, VpPrtPrvDlg, VpPrtFmtDlg, Types,
|
||||||
|
VpBase, VpCalendar;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@@ -366,34 +367,6 @@ begin
|
|||||||
PopulateLanguages;
|
PopulateLanguages;
|
||||||
ReadIni;
|
ReadIni;
|
||||||
|
|
||||||
with VpDayview1 do begin
|
|
||||||
AllDayEventAttributes.Font.Size := ScaleY(AllDayEventAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
Font.Size := ScaleY(Font.Size, DesignTimeDPI);
|
|
||||||
HeadAttributes.Font.Size := ScaleY(HeadAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
RowHeadAttributes.HourFont.Size := ScaleY(RowHeadAttributes.HourFont.Size, DesignTimeDPI);
|
|
||||||
RowHeadAttributes.MinuteFont.Size := ScaleY(RowHeadAttributes.MinuteFont.Size, DesignTimeDPI);
|
|
||||||
end;
|
|
||||||
with VpWeekView1 do begin
|
|
||||||
AllDayEventAttributes.Font.Size := ScaleY(AllDayEventAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
DayHeadAttributes.Font.Size := ScaleY(DayHeadAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
HeadAttributes.Font.Size := ScaleY(HeadAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
end;
|
|
||||||
with VpMonthView1 do begin
|
|
||||||
DayHeadAttributes.Font.Size := ScaleY(DayHeadAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
DayNumberFont.Size := ScaleY(DayNumberFont.Size, DesignTimeDPI);
|
|
||||||
EventFont.Size := ScaleY(EventFont.Size, DesignTimeDPI);
|
|
||||||
Font.Size := ScaleY(Font.Size, DesignTimeDPI);
|
|
||||||
HeadAttributes.Font.Size := ScaleY(HeadAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
TodayAttributes.Font.Size := ScaleY(TodayAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
end;
|
|
||||||
with VpTaskList1 do begin
|
|
||||||
Font.Size := ScaleY(Font.Size, DesignTimeDPI);
|
|
||||||
TaskHeadAttributes.Font.Size := ScaleY(TaskHeadAttributes.Font.Size, DesignTimeDPI);
|
|
||||||
end;
|
|
||||||
with VpContactGrid1 do begin
|
|
||||||
Font.Size := ScaleY(Font.Size, DesignTimeDPI);
|
|
||||||
end;
|
|
||||||
|
|
||||||
ds := VpControlLink1.Datastore;
|
ds := VpControlLink1.Datastore;
|
||||||
if ds.Resources.Count > 0 then
|
if ds.Resources.Count > 0 then
|
||||||
begin
|
begin
|
||||||
@@ -573,7 +546,6 @@ end;
|
|||||||
procedure TMainForm.PositionControls;
|
procedure TMainForm.PositionControls;
|
||||||
var
|
var
|
||||||
w: Integer;
|
w: Integer;
|
||||||
cnv: TControlCanvas;
|
|
||||||
begin
|
begin
|
||||||
// DayView page
|
// DayView page
|
||||||
DaySelectorPanel.Height := 2*CbGranularity.Top + CbGranularity.Height;
|
DaySelectorPanel.Height := 2*CbGranularity.Top + CbGranularity.Height;
|
||||||
@@ -636,7 +608,6 @@ procedure TMainForm.ReadIni;
|
|||||||
var
|
var
|
||||||
ini: TCustomIniFile;
|
ini: TCustomIniFile;
|
||||||
lang: String;
|
lang: String;
|
||||||
idx: Integer;
|
|
||||||
L,T, W,H: Integer;
|
L,T, W,H: Integer;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
begin
|
begin
|
||||||
@@ -752,17 +723,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.SetLanguage(ALang: String);
|
procedure TMainForm.SetLanguage(ALang: String);
|
||||||
|
|
||||||
function GetTimeFormat: TVpTimeFormat;
|
|
||||||
var
|
|
||||||
s: String;
|
|
||||||
begin
|
|
||||||
s := lowercase(FormatDateTime('hh:nn ampm', 0.25));
|
|
||||||
if pos(lowercase(FormatSettings.TimeAMString), s) = Length(s) - Length(FormatSettings.TimeAMString) then
|
|
||||||
Result := tf12Hour else
|
|
||||||
Result := tf24Hour;
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
langdir: String;
|
langdir: String;
|
||||||
@@ -802,13 +762,14 @@ begin
|
|||||||
SetDefaultLang(FLang, langdir);
|
SetDefaultLang(FLang, langdir);
|
||||||
TranslateUnitResourceStrings('vpsr', langdir + 'vpsr.' + FLang + '.po');
|
TranslateUnitResourceStrings('vpsr', langdir + 'vpsr.' + FLang + '.po');
|
||||||
end;
|
end;
|
||||||
|
{
|
||||||
VpDayView1.LoadLanguage;
|
VpDayView1.LoadLanguage;
|
||||||
VpWeekView1.LoadLanguage;
|
VpWeekView1.LoadLanguage;
|
||||||
VpMonthView1.LoadLanguage;
|
VpMonthView1.LoadLanguage;
|
||||||
VpTaskList1.LoadLanguage;
|
VpTaskList1.LoadLanguage;
|
||||||
VpContactGrid1.LoadLanguage;
|
VpContactGrid1.LoadLanguage;
|
||||||
|
//VpCalendar1.LoadLanguage;
|
||||||
|
}
|
||||||
// Select language in language combobox.
|
// Select language in language combobox.
|
||||||
if ALang = '' then ALang := 'en';
|
if ALang = '' then ALang := 'en';
|
||||||
found := false;
|
found := false;
|
||||||
@@ -877,10 +838,11 @@ begin
|
|||||||
VpDayView1.TimeFormat := tfmt;
|
VpDayView1.TimeFormat := tfmt;
|
||||||
VpWeekView1.TimeFormat := tfmt;
|
VpWeekView1.TimeFormat := tfmt;
|
||||||
VpMonthView1.TimeFormat := tfmt;
|
VpMonthView1.TimeFormat := tfmt;
|
||||||
|
{$ENDIF}
|
||||||
firstWeekDay := GetFirstDayofWeek(ALang); // not correct at the moment
|
firstWeekDay := GetFirstDayofWeek(ALang); // not correct at the moment
|
||||||
VpMonthView1.WeekStartsOn := firstWeekDay;
|
VpMonthView1.WeekStartsOn := firstWeekDay;
|
||||||
VpWeekView1.WeekStartsOn := firstWeekDay;
|
VpWeekView1.WeekStartsOn := firstWeekDay;
|
||||||
{$ENDIF}
|
//VpCalendar1.WeekStarts := firstWeekDay;
|
||||||
|
|
||||||
PositionControls;
|
PositionControls;
|
||||||
|
|
||||||
|
@@ -107,7 +107,6 @@ uses
|
|||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
ShellAPI,
|
ShellAPI,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Math,
|
|
||||||
VpConst, VpMisc, VpSR;
|
VpConst, VpMisc, VpSR;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@@ -168,6 +168,7 @@ type
|
|||||||
clRevertDate : TDateTime; {date on entry}
|
clRevertDate : TDateTime; {date on entry}
|
||||||
clRowCount : Integer; {7 if no header, otherwise 8}
|
clRowCount : Integer; {7 if no header, otherwise 8}
|
||||||
clStartRow : Integer; {first row number}
|
clStartRow : Integer; {first row number}
|
||||||
|
calMargin : Integer;
|
||||||
|
|
||||||
{property methods}
|
{property methods}
|
||||||
function GetDay: Integer;
|
function GetDay: Integer;
|
||||||
@@ -239,6 +240,8 @@ type
|
|||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
constructor CreateEx(AOwner: TComponent; AsPopup: Boolean); virtual;
|
constructor CreateEx(AOwner: TComponent; AsPopup: Boolean); virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure LoadLanguage;
|
||||||
|
|
||||||
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
|
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
|
||||||
|
|
||||||
function GetControlType: TVpItemType; override;
|
function GetControlType: TVpItemType; override;
|
||||||
@@ -268,6 +271,11 @@ type
|
|||||||
property Year : Integer read GetYear;
|
property Year : Integer read GetYear;
|
||||||
|
|
||||||
{properties}
|
{properties}
|
||||||
|
property Align;
|
||||||
|
property Anchors;
|
||||||
|
{$IFDEF LCL}
|
||||||
|
property BorderSpacing;
|
||||||
|
{$ENDIF}
|
||||||
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle;
|
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle;
|
||||||
property Color;
|
property Color;
|
||||||
property Colors: TVpCalColors read FColors write FColors;
|
property Colors: TVpCalColors read FColors write FColors;
|
||||||
@@ -347,7 +355,7 @@ uses
|
|||||||
VpCalendarPainter;
|
VpCalendarPainter;
|
||||||
|
|
||||||
const
|
const
|
||||||
calMargin = 4; {left, right, and top margin}
|
CAL_MARGIN = 4; {left, right, and top margin}
|
||||||
|
|
||||||
function SumOf(const A: array of Integer; First, Last: Integer): Integer;
|
function SumOf(const A: array of Integer; First, Last: Integer): Integer;
|
||||||
var
|
var
|
||||||
@@ -776,6 +784,8 @@ begin
|
|||||||
TabStop := True;
|
TabStop := True;
|
||||||
Width := 200;
|
Width := 200;
|
||||||
|
|
||||||
|
calMargin := ScaleX(CAL_MARGIN, DesignTimeDPI);
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
Font.Name := 'MS Sans Serif';
|
Font.Name := 'MS Sans Serif';
|
||||||
Font.Size := 8;
|
Font.Size := 8;
|
||||||
@@ -1427,6 +1437,12 @@ begin
|
|||||||
Result := itCalendar;
|
Result := itCalendar;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpCustomCalendar.LoadLanguage;
|
||||||
|
begin
|
||||||
|
FDefaultPopup.Items.Clear;
|
||||||
|
InitializeDefaultPopup;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpCustomCalendar.PaintToCanvas(ACanvas: TCanvas; ARect: TRect;
|
procedure TVpCustomCalendar.PaintToCanvas(ACanvas: TCanvas; ARect: TRect;
|
||||||
Angle: TVpRotationAngle; ADate: TDateTime);
|
Angle: TVpRotationAngle; ADate: TDateTime);
|
||||||
begin
|
begin
|
||||||
|
@@ -380,6 +380,7 @@ begin
|
|||||||
SetMeasurements;
|
SetMeasurements;
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(FCalendar.Font);
|
RenderCanvas.Font.Assign(FCalendar.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
|
|
||||||
with TVpCalendarOpener(FCalendar) do
|
with TVpCalendarOpener(FCalendar) do
|
||||||
if (RealRight - RealLeft <> FLastRenderX) or
|
if (RealRight - RealLeft <> FLastRenderX) or
|
||||||
|
@@ -267,6 +267,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
TmpBmpRect := Rect(0, 0, TmpBmp.Width, TmpBmp.Height);
|
TmpBmpRect := Rect(0, 0, TmpBmp.Width, TmpBmp.Height);
|
||||||
TmpBmp.Canvas.Font.Assign(FContactGrid.Font);
|
TmpBmp.Canvas.Font.Assign(FContactGrid.Font);
|
||||||
|
TmpBmp.Canvas.Font.Size := ScaleY(TmpBmp.Canvas.Font.Size, DesignTimeDPI);
|
||||||
|
|
||||||
{ Calculate Phone Lbl Width }
|
{ Calculate Phone Lbl Width }
|
||||||
PhoneLblWidth := TmpBmp.Canvas.TextWidth(RSEmail);
|
PhoneLblWidth := TmpBmp.Canvas.TextWidth(RSEmail);
|
||||||
@@ -317,6 +318,7 @@ begin
|
|||||||
TmpBmp.Canvas.Pen.Color := BevelDarkShadow;
|
TmpBmp.Canvas.Pen.Color := BevelDarkShadow;
|
||||||
TmpBmp.Canvas.Brush.Style := bsSolid;
|
TmpBmp.Canvas.Brush.Style := bsSolid;
|
||||||
TmpBmp.Canvas.Font.Assign(FContactGrid.ContactHeadAttributes.Font);
|
TmpBmp.Canvas.Font.Assign(FContactGrid.ContactHeadAttributes.Font);
|
||||||
|
TmpBmp.Canvas.Font.Size := ScaleY(TmpBmp.Canvas.Font.Size, DesignTimeDPI);
|
||||||
case Angle of
|
case Angle of
|
||||||
ra0:
|
ra0:
|
||||||
begin
|
begin
|
||||||
@@ -414,6 +416,7 @@ begin
|
|||||||
|
|
||||||
{ restore font and colors }
|
{ restore font and colors }
|
||||||
TmpBmp.Canvas.Font.Assign(FContactGrid.Font);
|
TmpBmp.Canvas.Font.Assign(FContactGrid.Font);
|
||||||
|
TmpBmp.Canvas.Font.Size := ScaleY(TmpBmp.Canvas.Font.Size, DesignTimeDPI);
|
||||||
TmpBmp.Canvas.Brush.Color := RealColor;
|
TmpBmp.Canvas.Brush.Color := RealColor;
|
||||||
TmpBmp.Canvas.Pen.Color := BevelDarkShadow;
|
TmpBmp.Canvas.Pen.Color := BevelDarkShadow;
|
||||||
TmpBmp.Canvas.Pen.Style := psSolid;
|
TmpBmp.Canvas.Pen.Style := psSolid;
|
||||||
|
@@ -1246,6 +1246,7 @@ var
|
|||||||
TextHeight: Integer;
|
TextHeight: Integer;
|
||||||
begin
|
begin
|
||||||
Canvas.Font.Assign(FHeadAttr.Font);
|
Canvas.Font.Assign(FHeadAttr.Font);
|
||||||
|
Canvas.Font.Size := ScaleY(Canvas.Font.Size, DesignTimeDPI);
|
||||||
|
|
||||||
if FShowResourceName and (DataStore <> nil) and (DataStore.Resource <> nil) then
|
if FShowResourceName and (DataStore <> nil) and (DataStore.Resource <> nil) then
|
||||||
TextHeight := Canvas.TextHeight(TallShortChars) * 2 + TextMargin * 3
|
TextHeight := Canvas.TextHeight(TallShortChars) * 2 + TextMargin * 3
|
||||||
@@ -1359,6 +1360,7 @@ begin
|
|||||||
{ font, the standard client font, and a sample character string. }
|
{ font, the standard client font, and a sample character string. }
|
||||||
SaveFont := Canvas.Font;
|
SaveFont := Canvas.Font;
|
||||||
Canvas.Font.Assign(FRowHeadAttr.FMinuteFont);
|
Canvas.Font.Assign(FRowHeadAttr.FMinuteFont);
|
||||||
|
Canvas.Font.Size := ScaleY(Canvas.Font.Size, DesignTimeDPI);
|
||||||
Canvas.Font.Height := GetRealFontHeight(Canvas.Font);
|
Canvas.Font.Height := GetRealFontHeight(Canvas.Font);
|
||||||
Result := Canvas.TextHeight(TallShortChars);
|
Result := Canvas.TextHeight(TallShortChars);
|
||||||
Canvas.Font.Assign(SaveFont);
|
Canvas.Font.Assign(SaveFont);
|
||||||
|
@@ -353,6 +353,7 @@ begin
|
|||||||
if NumADEvents > 0 then begin
|
if NumADEvents > 0 then begin
|
||||||
// Measure the AllDayEvent text height
|
// Measure the AllDayEvent text height
|
||||||
RenderCanvas.Font.Assign(FDayView.AllDayEventAttributes.Font);
|
RenderCanvas.Font.Assign(FDayView.AllDayEventAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
ADTextHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin;
|
ADTextHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin;
|
||||||
|
|
||||||
// Distance between text and border
|
// Distance between text and border
|
||||||
@@ -493,6 +494,7 @@ begin
|
|||||||
SavedFont.Assign(RenderCanvas.Font);
|
SavedFont.Assign(RenderCanvas.Font);
|
||||||
try
|
try
|
||||||
RenderCanvas.Font.Assign(FDayView.Font);
|
RenderCanvas.Font.Assign(FDayView.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
RenderCanvas.Brush.Color := RealColor;
|
RenderCanvas.Brush.Color := RealColor;
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
||||||
|
|
||||||
@@ -515,7 +517,7 @@ begin
|
|||||||
Break;
|
Break;
|
||||||
|
|
||||||
RenderCanvas.Brush.Color := RealColor;
|
RenderCanvas.Brush.Color := RealColor;
|
||||||
RenderCanvas.Font.Assign(SavedFont);
|
RenderCanvas.Font.Assign(SavedFont); // no further scaling needed here
|
||||||
LineRect.Top := Round(R.Top + i * RealRowHeight);
|
LineRect.Top := Round(R.Top + i * RealRowHeight);
|
||||||
LineRect.Bottom := Round(LineRect.Top + RealRowHeight);
|
LineRect.Bottom := Round(LineRect.Top + RealRowHeight);
|
||||||
|
|
||||||
@@ -670,6 +672,7 @@ begin
|
|||||||
|
|
||||||
{ Draw Column Header }
|
{ Draw Column Header }
|
||||||
RenderCanvas.Font.Assign(FDayView.HeadAttributes.Font);
|
RenderCanvas.Font.Assign(FDayView.HeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
RenderCanvas.Brush.Color := RealHeadAttrColor;
|
RenderCanvas.Brush.Color := RealHeadAttrColor;
|
||||||
RenderCanvas.Pen.Style := psClear;
|
RenderCanvas.Pen.Style := psClear;
|
||||||
tmpRect := R;
|
tmpRect := R;
|
||||||
@@ -1289,6 +1292,7 @@ begin
|
|||||||
|
|
||||||
{ Calculate the column rect for this day }
|
{ Calculate the column rect for this day }
|
||||||
RenderCanvas.Font.Assign(FDayView.Font);
|
RenderCanvas.Font.Assign(FDayView.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
CellsRect := Rect(RPos, ADEventsRect.Bottom + 1, RPos + DayWidth, RealBottom - 2);
|
CellsRect := Rect(RPos, ADEventsRect.Bottom + 1, RPos + DayWidth, RealBottom - 2);
|
||||||
if (i = RealNumDays - 1) and (ExtraSpace > 0) then
|
if (i = RealNumDays - 1) and (ExtraSpace > 0) then
|
||||||
CellsRect.Right := CellsRect.Right + ExtraSpace;
|
CellsRect.Right := CellsRect.Right + ExtraSpace;
|
||||||
@@ -1417,6 +1421,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// In case of 60-min granularity paint time as simple string
|
// In case of 60-min granularity paint time as simple string
|
||||||
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
timeStr := Format('%s:%s', [hourStr, minuteStr]);
|
timeStr := Format('%s:%s', [hourStr, minuteStr]);
|
||||||
x := lineRect.Right - RenderCanvas.TextWidth(timeStr) - MINUTES_BORDER;
|
x := lineRect.Right - RenderCanvas.TextWidth(timeStr) - MINUTES_BORDER;
|
||||||
TPSTextOut(RenderCanvas, Angle, RenderIn, x, y + TextMargin, timeStr);
|
TPSTextOut(RenderCanvas, Angle, RenderIn, x, y + TextMargin, timeStr);
|
||||||
@@ -1425,11 +1430,13 @@ begin
|
|||||||
// In all other cases, paint large hour and small minutes (or am/pm)
|
// In all other cases, paint large hour and small minutes (or am/pm)
|
||||||
// Draw minutes
|
// Draw minutes
|
||||||
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
x := lineRect.Right - RenderCanvas.TextWidth(MinuteStr) - MINUTES_BORDER;
|
x := lineRect.Right - RenderCanvas.TextWidth(MinuteStr) - MINUTES_BORDER;
|
||||||
TPSTextOut(RenderCanvas, Angle, RenderIn, x, y + TextMargin, minuteStr);
|
TPSTextOut(RenderCanvas, Angle, RenderIn, x, y + TextMargin, minuteStr);
|
||||||
|
|
||||||
// Draw hours
|
// Draw hours
|
||||||
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.HourFont);
|
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.HourFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
dec(x, RenderCanvas.TextWidth(HourStr) + MINUTES_HOUR_DISTANCE);
|
dec(x, RenderCanvas.TextWidth(HourStr) + MINUTES_HOUR_DISTANCE);
|
||||||
TPSTextOut(RenderCanvas, Angle, RenderIn, x, y + TextMargin{ - 2}, hourStr);
|
TPSTextOut(RenderCanvas, Angle, RenderIn, x, y + TextMargin{ - 2}, hourStr);
|
||||||
end;
|
end;
|
||||||
@@ -1461,6 +1468,7 @@ begin
|
|||||||
|
|
||||||
// Calculate length of minutes ticks
|
// Calculate length of minutes ticks
|
||||||
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
minutesLen := RenderCanvas.TextWidth('00') + MINUTES_BORDER + MINUTES_HOUR_DISTANCE div 2;
|
minutesLen := RenderCanvas.TextWidth('00') + MINUTES_BORDER + MINUTES_HOUR_DISTANCE div 2;
|
||||||
|
|
||||||
// Prepare pen
|
// Prepare pen
|
||||||
@@ -1529,8 +1537,10 @@ function TVpDayViewPainter.CalcRowHeadWidth: integer;
|
|||||||
begin
|
begin
|
||||||
Result := 2 * MINUTES_BORDER + MINUTES_HOUR_DISTANCE;
|
Result := 2 * MINUTES_BORDER + MINUTES_HOUR_DISTANCE;
|
||||||
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.MinuteFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
inc(Result, RenderCanvas.TextWidth('00'));
|
inc(Result, RenderCanvas.TextWidth('00'));
|
||||||
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.HourFont);
|
RenderCanvas.Font.Assign(FDayView.RowHeadAttributes.HourFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
inc(Result, RenderCanvas.TextWidth('33'));
|
inc(Result, RenderCanvas.TextWidth('33'));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
LazFileUtils,
|
LazFileUtils,
|
||||||
VpConst, VpException, VpMisc, VpData;
|
VpConst, VpMisc;
|
||||||
|
|
||||||
{ TVpIBDatastore }
|
{ TVpIBDatastore }
|
||||||
|
|
||||||
|
@@ -122,6 +122,7 @@ function SameDate(dt1, dt2: TDateTime): Boolean;
|
|||||||
function DateInRange(ADate, StartDate, EndDate: TDateTime; IncludeLimits: Boolean): Boolean;
|
function DateInRange(ADate, StartDate, EndDate: TDateTime; IncludeLimits: Boolean): Boolean;
|
||||||
function TimeInRange(ATime, StartTime, EndTime: TDateTime; IncludeLimits: Boolean): Boolean;
|
function TimeInRange(ATime, StartTime, EndTime: TDateTime; IncludeLimits: Boolean): Boolean;
|
||||||
|
|
||||||
|
function GetTimeFormat: TVpTimeFormat;
|
||||||
function GranularityToStr(Gran: TVpGranularity): string;
|
function GranularityToStr(Gran: TVpGranularity): string;
|
||||||
function HourToAMPM(Hour: TVpHours): string;
|
function HourToAMPM(Hour: TVpHours): string;
|
||||||
function HourToStr(Hour: TVpHours; Mil: Boolean): string;
|
function HourToStr(Hour: TVpHours; Mil: Boolean): string;
|
||||||
@@ -487,6 +488,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
function GetTimeFormat: TVpTimeFormat;
|
||||||
|
var
|
||||||
|
s: String;
|
||||||
|
begin
|
||||||
|
s := lowercase(FormatDateTime('hh:nn ampm', 0.25));
|
||||||
|
if pos(lowercase(FormatSettings.TimeAMString), s) = Length(s) - Length(FormatSettings.TimeAMString) then
|
||||||
|
Result := tf12Hour else
|
||||||
|
Result := tf24Hour;
|
||||||
|
end;
|
||||||
|
|
||||||
function GranularityToStr(Gran: TVpGranularity): string;
|
function GranularityToStr(Gran: TVpGranularity): string;
|
||||||
begin
|
begin
|
||||||
Result := IntToStr(GranularityMinutes[Gran]);
|
Result := IntToStr(GranularityMinutes[Gran]);
|
||||||
|
@@ -448,10 +448,8 @@ begin
|
|||||||
{ Assign default font to DayNumberFont and EventFont }
|
{ Assign default font to DayNumberFont and EventFont }
|
||||||
FDayNumberFont := TVpFont.Create(AOwner);
|
FDayNumberFont := TVpFont.Create(AOwner);
|
||||||
FDayNumberFont.Assign(Font);
|
FDayNumberFont.Assign(Font);
|
||||||
// FDayNumberFont.OnChange := mvFontChanged;
|
|
||||||
FEventFont := TVpFont.Create(AOwner);
|
FEventFont := TVpFont.Create(AOwner);
|
||||||
FEventFont.Assign(Font);
|
FEventFont.Assign(Font);
|
||||||
// FEventFont.OnChange := mvFontChanged;
|
|
||||||
FOffDayFontColor := clGray;
|
FOffDayFontColor := clGray;
|
||||||
|
|
||||||
SetLength(mvEventArray, MaxVisibleEvents);
|
SetLength(mvEventArray, MaxVisibleEvents);
|
||||||
|
@@ -120,6 +120,7 @@ var
|
|||||||
begin
|
begin
|
||||||
{ clear day head area }
|
{ clear day head area }
|
||||||
RenderCanvas.Font.Assign(FMonthView.DayHeadAttributes.Font);
|
RenderCanvas.Font.Assign(FMonthView.DayHeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
RenderCanvas.Brush.Color := DayHeadAttrColor;
|
RenderCanvas.Brush.Color := DayHeadAttrColor;
|
||||||
|
|
||||||
{ build rect }
|
{ build rect }
|
||||||
@@ -364,7 +365,8 @@ begin
|
|||||||
RenderCanvas.Font.Assign(FMonthView.TodayAttributes.Font)
|
RenderCanvas.Font.Assign(FMonthView.TodayAttributes.Font)
|
||||||
else
|
else
|
||||||
RenderCanvas.Font.Assign(FMonthView.DayNumberFont);
|
RenderCanvas.Font.Assign(FMonthView.DayNumberFont);
|
||||||
fontstyle := Rendercanvas.Font.style;
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
|
fontstyle := RenderCanvas.Font.style;
|
||||||
|
|
||||||
if (DisplayDate = ThisDate) then begin
|
if (DisplayDate = ThisDate) then begin
|
||||||
if FMonthView.Focused then begin
|
if FMonthView.Focused then begin
|
||||||
@@ -474,7 +476,8 @@ begin
|
|||||||
RenderCanvas.Font.Assign(FMonthView.TodayAttributes.Font)
|
RenderCanvas.Font.Assign(FMonthView.TodayAttributes.Font)
|
||||||
else
|
else
|
||||||
RenderCanvas.Font.Assign(FMonthView.DayNumberFont);
|
RenderCanvas.Font.Assign(FMonthView.DayNumberFont);
|
||||||
fontstyle := Rendercanvas.Font.style;
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
|
fontstyle := Rendercanvas.Font.Style;
|
||||||
|
|
||||||
if (DisplayDate = ThisDate) then begin
|
if (DisplayDate = ThisDate) then begin
|
||||||
if FMonthView.Focused then
|
if FMonthView.Focused then
|
||||||
@@ -657,6 +660,7 @@ begin
|
|||||||
|
|
||||||
{ set the event font }
|
{ set the event font }
|
||||||
RenderCanvas.Font.Assign(FMonthView.EventFont);
|
RenderCanvas.Font.Assign(FMonthView.EventFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
if TVpMonthViewOpener(FMonthView).mvMonthDayArray[I].OffDay then
|
if TVpMonthViewOpener(FMonthView).mvMonthDayArray[I].OffDay then
|
||||||
RenderCanvas.Font.Color := FMonthView.OffDayFontColor;
|
RenderCanvas.Font.Color := FMonthView.OffDayFontColor;
|
||||||
|
|
||||||
@@ -764,6 +768,7 @@ begin
|
|||||||
|
|
||||||
{ Calculate the text rectangle }
|
{ Calculate the text rectangle }
|
||||||
RenderCanvas.Font.Assign(FMonthView.HeadAttributes.Font);
|
RenderCanvas.Font.Assign(FMonthView.HeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
if DisplayOnly and (RenderCanvas.TextWidth(HeadStr) >= RealWidth) then
|
if DisplayOnly and (RenderCanvas.TextWidth(HeadStr) >= RealWidth) then
|
||||||
HeadTextRect.Left:= RealLeft + TextMargin * 2
|
HeadTextRect.Left:= RealLeft + TextMargin * 2
|
||||||
else
|
else
|
||||||
@@ -788,6 +793,7 @@ begin
|
|||||||
|
|
||||||
// Draw the text
|
// Draw the text
|
||||||
RenderCanvas.Font.Assign(FMonthView.HeadAttributes.Font);
|
RenderCanvas.Font.Assign(FMonthView.HeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
TPSTextOut(
|
TPSTextOut(
|
||||||
RenderCanvas,
|
RenderCanvas,
|
||||||
Angle,
|
Angle,
|
||||||
@@ -897,16 +903,20 @@ begin
|
|||||||
{ we use the VpProductName because is is a good representation of some }
|
{ we use the VpProductName because is is a good representation of some }
|
||||||
{ generic text }
|
{ generic text }
|
||||||
RenderCanvas.Font.Assign(FMonthView.DayHeadAttributes.Font);
|
RenderCanvas.Font.Assign(FMonthView.DayHeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
with TVpMonthViewOpener(FMonthView) do
|
with TVpMonthViewOpener(FMonthView) do
|
||||||
mvDayHeadHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin + 2;
|
mvDayHeadHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin + 2;
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(FMonthView.DayNumberFont);
|
RenderCanvas.Font.Assign(FMonthView.DayNumberFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
mvDayNumberHeight := RenderCanvas.TextHeight('00');
|
mvDayNumberHeight := RenderCanvas.TextHeight('00');
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(FMonthView.EventFont);
|
RenderCanvas.Font.Assign(FMonthView.EventFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
mvEventTextHeight := RenderCanvas.TextHeight(VpProductName);
|
mvEventTextHeight := RenderCanvas.TextHeight(VpProductName);
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(FMonthView.Font);
|
RenderCanvas.Font.Assign(FMonthView.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
mvLineHeight := RenderCanvas.TextHeight(VpProductName) + 2;
|
mvLineHeight := RenderCanvas.TextHeight(VpProductName) + 2;
|
||||||
mvColWidth := (RealWidth - 4) div 7;
|
mvColWidth := (RealWidth - 4) div 7;
|
||||||
end;
|
end;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
object TaskEditForm: TTaskEditForm
|
object TaskEditForm: TTaskEditForm
|
||||||
Left = 243
|
Left = 284
|
||||||
Height = 378
|
Height = 378
|
||||||
Top = 283
|
Top = 286
|
||||||
Width = 547
|
Width = 547
|
||||||
HorzScrollBar.Page = 545
|
HorzScrollBar.Page = 545
|
||||||
VertScrollBar.Page = 339
|
VertScrollBar.Page = 339
|
||||||
|
@@ -252,6 +252,7 @@ var
|
|||||||
begin
|
begin
|
||||||
RenderCanvas.Brush.Color := TaskHeadAttrColor;
|
RenderCanvas.Brush.Color := TaskHeadAttrColor;
|
||||||
RenderCanvas.Font.Assign(FTaskList.TaskHeadAttributes.Font);
|
RenderCanvas.Font.Assign(FTaskList.TaskHeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
|
|
||||||
if FTaskList.DrawingStyle = dsFlat then delta := 1 else delta := 2;
|
if FTaskList.DrawingStyle = dsFlat then delta := 1 else delta := 2;
|
||||||
HeadRect.Left := RealLeft + delta;
|
HeadRect.Left := RealLeft + delta;
|
||||||
@@ -321,6 +322,7 @@ begin
|
|||||||
else
|
else
|
||||||
HeadStr := RSTaskTitleNoResource;
|
HeadStr := RSTaskTitleNoResource;
|
||||||
RenderCanvas.Font.Assign(TaskHeadAttributes.Font);
|
RenderCanvas.Font.Assign(TaskHeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
TPSTextOut(
|
TPSTextOut(
|
||||||
RenderCanvas,
|
RenderCanvas,
|
||||||
Angle,
|
Angle,
|
||||||
@@ -396,6 +398,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(Font);
|
RenderCanvas.Font.Assign(Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
for I := StartLine to pred(tlAllTaskList.Count) do begin
|
for I := StartLine to pred(tlAllTaskList.Count) do begin
|
||||||
Task := tlAllTaskList[I];
|
Task := tlAllTaskList[I];
|
||||||
if (LineRect.Top + Trunc(RowHeight * 0.5) <= RealBottom) then begin
|
if (LineRect.Top + Trunc(RowHeight * 0.5) <= RealBottom) then begin
|
||||||
@@ -528,6 +531,7 @@ end;
|
|||||||
procedure TVpTaskListPainter.MeasureRowHeight;
|
procedure TVpTaskListPainter.MeasureRowHeight;
|
||||||
begin
|
begin
|
||||||
RenderCanvas.Font.Assign(FTaskList.Font);
|
RenderCanvas.Font.Assign(FTaskList.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
RowHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin * 2;
|
RowHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin * 2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@@ -143,6 +143,7 @@ begin
|
|||||||
{ Measure the AllDayEvent TextHeight }
|
{ Measure the AllDayEvent TextHeight }
|
||||||
txtDist := TextMargin div 2;
|
txtDist := TextMargin div 2;
|
||||||
RenderCanvas.Font.Assign(FWeekView.AllDayEventAttributes.Font);
|
RenderCanvas.Font.Assign(FWeekView.AllDayEventAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
ADTextHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin + txtDist;
|
ADTextHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin + txtDist;
|
||||||
|
|
||||||
{ Build the AllDayEvent rect based on the value of NumADEvents }
|
{ Build the AllDayEvent rect based on the value of NumADEvents }
|
||||||
@@ -295,6 +296,7 @@ begin
|
|||||||
tmpRect := TextRect;
|
tmpRect := TextRect;
|
||||||
inc(tmpRect.Right);
|
inc(tmpRect.Right);
|
||||||
RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font);
|
RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
RenderCanvas.Brush.Color := RealDayHeadAttrColor;
|
RenderCanvas.Brush.Color := RealDayHeadAttrColor;
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
||||||
if FWeekView.DayHeadAttributes.Bordered and (FWeekView.DrawingStyle <> dsNoBorder) then
|
if FWeekView.DayHeadAttributes.Bordered and (FWeekView.DrawingStyle <> dsNoBorder) then
|
||||||
@@ -505,6 +507,7 @@ begin
|
|||||||
|
|
||||||
{ set the event font }
|
{ set the event font }
|
||||||
RenderCanvas.Font.Assign(FWeekView.EventFont);
|
RenderCanvas.Font.Assign(FWeekView.EventFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
RenderCanvas.Brush.Color := RealColor;
|
RenderCanvas.Brush.Color := RealColor;
|
||||||
|
|
||||||
{ Build the event text }
|
{ Build the event text }
|
||||||
@@ -540,6 +543,7 @@ var
|
|||||||
begin
|
begin
|
||||||
RenderCanvas.Brush.Color := RealHeadAttrColor;
|
RenderCanvas.Brush.Color := RealHeadAttrColor;
|
||||||
RenderCanvas.Font.Assign(TFont(FWeekView.HeadAttributes.Font));
|
RenderCanvas.Font.Assign(TFont(FWeekView.HeadAttributes.Font));
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
|
|
||||||
{ draw the header cell and borders }
|
{ draw the header cell and borders }
|
||||||
if FWeekView.DrawingStyle = ds3d then begin
|
if FWeekView.DrawingStyle = ds3d then begin
|
||||||
@@ -697,11 +701,16 @@ begin
|
|||||||
StartDate := GetStartOfWeek(RenderDate, WeekStartsOn);
|
StartDate := GetStartOfWeek(RenderDate, WeekStartsOn);
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font);
|
RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
FDayHeadHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin + 2 ;
|
FDayHeadHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin + 2 ;
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(FWeekView.EventFont);
|
RenderCanvas.Font.Assign(FWeekView.EventFont);
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
with TVpWeekViewOpener(FWeekView) do
|
with TVpWeekViewOpener(FWeekView) do
|
||||||
wvRowHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin div 2;
|
wvRowHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin div 2;
|
||||||
|
|
||||||
RenderCanvas.Font.Assign(TFont(FWeekView.HeadAttributes.Font));
|
RenderCanvas.Font.Assign(TFont(FWeekView.HeadAttributes.Font));
|
||||||
|
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||||
with TVpWeekViewOpener(FWeekView) do
|
with TVpWeekViewOpener(FWeekView) do
|
||||||
wvHeaderHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin * 2;
|
wvHeaderHeight := RenderCanvas.TextHeight(VpProductName) + TextMargin * 2;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user