You've already forked lazarus-ccr
Fix for non-ASCII chars in calendar month names.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2500 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -41,7 +41,7 @@ unit ovccal;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFNDEF LCL} Windows, Messages, {$ELSE} LclIntf, LMessages, LclType, MyMisc, {$ENDIF}
|
{$IFNDEF LCL} Windows, Messages, {$ELSE} LclIntf, LMessages, LclType, MyMisc, FileUtil,{$ENDIF}
|
||||||
Buttons, Classes, Controls, Forms, Graphics, Menus,
|
Buttons, Classes, Controls, Forms, Graphics, Menus,
|
||||||
SysUtils, OvcBase, OvcConst, OvcData, OvcIntl,
|
SysUtils, OvcBase, OvcConst, OvcData, OvcIntl,
|
||||||
OvcMisc, OvcDate;
|
OvcMisc, OvcDate;
|
||||||
@ -1449,6 +1449,10 @@ var
|
|||||||
if Canvas.TextWidth(S) > R.Right-R.Left then
|
if Canvas.TextWidth(S) > R.Right-R.Left then
|
||||||
S := FormatDateTime('mmm yyyy', FDate);
|
S := FormatDateTime('mmm yyyy', FDate);
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
S := SysToUTF8(S); //DrawText expects UTF8 with most widgetsets
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
Canvas.Font.Color := FColors.MonthAndYear;
|
Canvas.Font.Color := FColors.MonthAndYear;
|
||||||
if Assigned(FOnDrawDate) then
|
if Assigned(FOnDrawDate) then
|
||||||
FOnDrawDate(Self, FDate, R)
|
FOnDrawDate(Self, FDate, R)
|
||||||
@ -1475,6 +1479,10 @@ var
|
|||||||
{get the day name}
|
{get the day name}
|
||||||
S := Copy(ShortDayNames[Ord(DOW)+1], 1, FDayNameWidth);
|
S := Copy(ShortDayNames[Ord(DOW)+1], 1, FDayNameWidth);
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
S := SysToUTF8(S);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{draw the day name above each column}
|
{draw the day name above each column}
|
||||||
DrawText(Canvas.Handle, @S[1], Length(S), clRowCol[1,I],
|
DrawText(Canvas.Handle, @S[1], Length(S), clRowCol[1,I],
|
||||||
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
|
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
|
||||||
@ -1533,6 +1541,9 @@ var
|
|||||||
FOnGetHighlight(Self, FDate+(NewIdx-OldIdx), Cl);
|
FOnGetHighlight(Self, FDate+(NewIdx-OldIdx), Cl);
|
||||||
Canvas.Font.Color := Cl;
|
Canvas.Font.Color := Cl;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF LCL}
|
||||||
|
S := SysToUTF8(S);
|
||||||
|
{$ENDIF}
|
||||||
if Assigned(FOnDrawItem) then
|
if Assigned(FOnDrawItem) then
|
||||||
FOnDrawItem(Self, FDate+(NewIdx-OldIdx), clRowCol[R,C])
|
FOnDrawItem(Self, FDate+(NewIdx-OldIdx), clRowCol[R,C])
|
||||||
else
|
else
|
||||||
@ -1555,6 +1566,9 @@ var
|
|||||||
R := DrawButtonFace(Canvas, calGetCurrentRectangle, 1, BS, True, True, False)
|
R := DrawButtonFace(Canvas, calGetCurrentRectangle, 1, BS, True, True, False)
|
||||||
else
|
else
|
||||||
R := DrawButtonFace(Canvas, calGetCurrentRectangle, 1, BS, True, False, False);
|
R := DrawButtonFace(Canvas, calGetCurrentRectangle, 1, BS, True, False, False);
|
||||||
|
{$IFDEF LCL}
|
||||||
|
S := SysToUTF8(S);
|
||||||
|
{$ENDIF}
|
||||||
DrawText(Canvas.Handle, @S[1], Length(S), R, DT_CENTER or DT_VCENTER or DT_SINGLELINE);
|
DrawText(Canvas.Handle, @S[1], Length(S), R, DT_CENTER or DT_VCENTER or DT_SINGLELINE);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -3,6 +3,9 @@ program Project1;
|
|||||||
uses
|
uses
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
Interfaces,
|
Interfaces,
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
clocale,
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Forms,
|
Forms,
|
||||||
Unit1 in 'Unit1.pas' {Form1};
|
Unit1 in 'Unit1.pas' {Form1};
|
||||||
|
Reference in New Issue
Block a user