jvcllaz: Less hints and warnings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7269 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-01-11 22:31:50 +00:00
parent 01f504ede7
commit 9b9b3fed49
12 changed files with 166 additions and 163 deletions

View File

@ -3701,11 +3701,12 @@ end;
procedure TJvFullColorGroup.Paint;
var
Index, IndexX, IndexY, XMaj: Integer;
Index: Integer;
//IndexX, IndexY, XMaj: Integer;
XOffset, YOffset, XInc, YInc: Integer;
X, Y: Integer;
lEdge: TJvFullColorEdge;
lClipRect: TRect;
//lClipRect: TRect;
procedure BevelRect(const R: TRect; Style: TJvFullColorEdge;
FillStyle: TBrushStyle; FillColor: TColor);
@ -3752,7 +3753,7 @@ begin
Y := YOffset;
X := XOffset;
lClipRect := Canvas.ClipRect;
//lClipRect := Canvas.ClipRect;
Index := 0;
while Index < Items.Count do

View File

@ -2935,12 +2935,15 @@ begin
(Text = '') and (Description = '');
end;
function HasNonISO_8859_1Chars(const S: WideString): Boolean;
//function HasNonISO_8859_1Chars(const S: WideString): Boolean;
function HasNonISO_8859_1Chars(const S: String): Boolean;
var
I: Integer;
ws: WideString;
begin
for I := 1 to Length(S) do
if Ord(S[I]) > $FF then
ws := UTF8Decode(S);
for I := 1 to Length(ws) do
if Ord(ws[I]) > $FF then
begin
Result := True;
Exit;

View File

@ -123,7 +123,6 @@ var
C, C2: TFPColor;
Dest: TBitmap;
Val: Integer;
Tmp: TFPColor;
IntfImg: TLazIntfImage;
begin
if FWorking or (csLoading in ComponentState) or (csDestroying in ComponentState) then

View File

@ -456,7 +456,7 @@ type
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure AutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); virtual;
const AXProportion, {%H-}AYProportion: Double); virtual;
property DaysControl: TJvTFDays read FDaysControl;
procedure Change;
published
@ -1043,7 +1043,7 @@ type
procedure DrawPics(ACanvas: TCanvas; var ARect: TRect; Appt: TJvTFAppt);
procedure CreatePicDrawList(ARect: TRect; Appt: TJvTFAppt; DrawList: TList);
procedure FilterPicDrawList(ARect: TRect; DrawList: TList;
var PicsHeight: Integer; var PicsWidth: Integer);
out PicsHeight, PicsWidth: Integer);
procedure ClearPicDrawList(DrawList: TList);
procedure DrawListPics(ACanvas: TCanvas; var ARect: TRect; DrawList: TList);
procedure DrawGrabLines(ACanvas: TCanvas; LineTop, LineLeft,
@ -1070,7 +1070,7 @@ type
procedure DrawAppts(ACanvas: TCanvas; DrawAll: Boolean);
procedure AdjustForMargins(var ARect: TRect);
procedure CanDrawWhat(ACanvas: TCanvas; ApptRect: TRect; PicsHeight: Integer;
var CanDrawText, CanDrawPics: Boolean);
out CanDrawText, CanDrawPics: Boolean);
procedure ManualFocusRect(ACanvas: TCanvas; ARect: TRect);
// Fancy painting routines
procedure DrawFancyRowHdrs(ACanvas: TCanvas);
@ -1145,9 +1145,9 @@ type
procedure ContinueDragging(Coord: TJvTFDaysCoord; Appt: TJvTFAppt);
procedure EndDragging(Coord: TJvTFDaysCoord; Appt: TJvTFAppt);
function CanDragWhat(Coord: TJvTFDaysCoord): TJvTFDaysState;
procedure CalcSizeEndTime(Appt: TJvTFAppt; var NewEndDT: TDateTime);
procedure CalcSizeEndTime(Appt: TJvTFAppt; out NewEndDT: TDateTime);
procedure CalcMoveStartEnd(Appt: TJvTFAppt; Coord: TJvTFDaysCoord;
KeepDates, KeepTimes: Boolean; var StartDT, EndDT: TDateTime);
KeepDates, KeepTimes: Boolean; out StartDT, EndDT: TDateTime);
procedure KillAutoScrollTimer;
@ -1190,12 +1190,15 @@ type
{ Lazarus }
class function GetControlClassDefaultSize: TSize; override;
{$IF LCL_FullVersion >= 1080000}
{ lcl scaling }
{$IF LCL_FullVersion >= 1080000}
protected
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
public
procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
const AProportion: Double); override;
{$IFEND}
{$IFEND}
public
constructor Create(AOwner: TComponent); override;
@ -1229,14 +1232,14 @@ type
// ok
function RowToTimeBlock(ARow: Integer): Integer;
// ok
procedure GetTimeBlockStartEnd(ATimeBlock: Integer; var BlockStart,
BlockEnd: Integer);
procedure GetTimeBlockStartEnd(ATimeBlock: Integer;
out BlockStart, BlockEnd: Integer);
// ok
function CalcBlockHdrWidth: Integer;
// ok
function CalcBlockRowHdrsWidth: Integer;
// ok
procedure GetBlockStartEndRows(Row: Integer; var StartRow, EndRow: Integer);
procedure GetBlockStartEndRows(Row: Integer; out StartRow, EndRow: Integer);
// ok
function VirtualBlockHdrRect(Row: Integer): TRect;
{$ENDIF Jv_TIMEBLOCKS}
@ -1275,7 +1278,7 @@ type
procedure DragDrop(Source: TObject; X, Y: Integer); override;
procedure CalcStartEndRows(AAppt: TJvTFAppt; SchedDate: TDate;
var StartRow, EndRow: Integer);
out StartRow, EndRow: Integer);
{$IFDEF Jv_TIMEBLOCKS}
// ok
@ -1678,9 +1681,9 @@ type
procedure CreatePicDrawList(ARect: TRect; Appt: TJvTFAppt; DrawList: TList);
procedure FilterPicDrawList(ARect: TRect; DrawList: TList;
var PicsHeight: Integer; var PicsWidth: Integer);
out PicsHeight, PicsWidth: Integer);
procedure CanDrawWhat(ACanvas: TCanvas; ApptRect: TRect;
PicsHeight, PicsWidth: Integer; var CanDrawText, CanDrawPics: Boolean);
PicsHeight, PicsWidth: Integer; out CanDrawText, CanDrawPics: Boolean);
procedure DrawListPics(ACanvas: TCanvas; var ARect: TRect; DrawList: TList);
procedure ClearPicDrawList(DrawList: TList);
@ -1690,9 +1693,9 @@ type
procedure CreateLayout; override;
procedure ClearPageInfo;
procedure CalcPageInfo; dynamic;
procedure CalcPageRowInfo(ShowColHdrs: Boolean; var CalcRowsPerPage,
procedure CalcPageRowInfo(ShowColHdrs: Boolean; out CalcRowsPerPage,
CalcRowHeight: Integer);
procedure CalcPageColInfo(ShowRowHdrs: Boolean; var CalcColsPerPage,
procedure CalcPageColInfo(ShowRowHdrs: Boolean; out CalcColsPerPage,
CalcColWidth: Integer);
function GetPageLayout: TJvTFDaysPrinterPageLayout;
procedure SetPageLayout(Value: TJvTFDaysPrinterPageLayout);
@ -1718,7 +1721,7 @@ type
PageInfo: TJvTFDaysPageInfo): TRect;
function GetApptDispColor(Appt: TJvTFAppt): TColor;
procedure CalcStartEndRows(AAppt: TJvTFAppt; SchedDate: TDate;
var StartRow, EndRow: Integer);
out StartRow, EndRow: Integer);
procedure Prepare; dynamic;
property ApptCount: Integer read GetApptCount;
property PageInfo[PageNum: Integer]: TJvTFDaysPageInfo read GetPageInfo;
@ -1794,7 +1797,7 @@ type
implementation
uses
Math, FPCanvas,
FPCanvas,
JvResources;
//Type
@ -2368,7 +2371,9 @@ end;
procedure TJvTFApptMap.Add(Appt: TJvTFAppt);
var
StartRow, EndRow, MapRow, MapCol: Integer;
StartRow: Integer = -1; // to silence the compiler
EndRow: Integer = -1; // dto.
MapRow, MapCol: Integer;
Empty: Boolean;
ApptGrid: TJvTFDays;
begin
@ -2545,7 +2550,9 @@ end;
function TJvTFApptMap.HasAppt(Appt: TJvTFAppt): Boolean;
var
MapRow, MapCol, StartRow, EndRow, ApptsExamined: Integer;
StartRow: Integer = -1; // to silence the compiler
EndRow: Integer = -1; // dto.
MapRow, MapCol, ApptsExamined: Integer;
Test: NativeInt;
ApptGrid: TJvTFDays;
begin
@ -2751,7 +2758,7 @@ begin
if not HandleAllocated then
exit;
FillChar(Info, SizeOf(Info), 0);
FillChar(Info{%H-}, SizeOf(Info), 0);
with Info do
begin
cbsize := SizeOf(Info);
@ -5046,8 +5053,10 @@ begin
end;
procedure TJvTFDays.CreateParams(var Params: TCreateParams);
{
const
BorderStyles: array [TBorderStyle] of DWORD = (0, WS_BORDER);
}
begin
inherited CreateParams(Params);
{
@ -5372,9 +5381,11 @@ end;
// ok
procedure TJvTFDays.DrawDataCell(ACanvas: TCanvas; ColIndex, RowIndex: Integer);
var
BlockStart: Integer = -1; // to silence the compiler
BlockEnd: Integer = -1; // dto.
SelFrameRect, FocusRect, Rect: TRect;
I, PrimeStartRow, PrimeEndRow: Integer;
FrameOffset, BlockStart, BlockEnd, TimeBlockIndex: Integer;
FrameOffset, TimeBlockIndex: Integer;
IsPrimeTimeCell: Boolean;
CellColor: TColor;
// col buffer start
@ -6071,10 +6082,11 @@ var
ImageList: TCustomImageList;
ImageMap: TJvTFStateImageMap;
CustomImageMap: TJvTFCustomImageMap;
w, h, d: Integer;
//h,
w, d: Integer;
{$IF LCL_FullVersion >= 2000000}
PPI: integer;
f: Double;
//f: Double;
{$IFEND}
procedure AddToList(AImageList: TCustomImageList; AImageIndex: Integer;
@ -6113,12 +6125,12 @@ begin
{$IF LCL_FullVersion >= 2000000}
PPI := Font.PixelsPerInch;
f := GetCanvasScaleFactor;
w := Imagelist.WidthForPPI[ImageList.Width, PPI];
h := round(ImageList.Height/ImageList.Width * w);
//h := round(ImageList.Height/ImageList.Width * w);
//f := GetCanvasScaleFactor;
{$ELSE}
w := ImageList.Width;
h := ImageList.Height;
//h := ImageList.Height;
{$IFEND}
for I := 0 to CustomImageMap.Count - 1 do
@ -6171,7 +6183,7 @@ begin
end;
procedure TJvTFDays.FilterPicDrawList(ARect: TRect; DrawList: TList;
var PicsHeight: Integer; var PicsWidth: Integer);
out PicsHeight, PicsWidth: Integer);
var
I, NextPicLeft: Integer;
DrawIt: Boolean;
@ -6180,7 +6192,7 @@ var
w, h: Integer;
{$IF LCL_FullVersion >=2000000}
PPI: Integer;
f: Double;
//f: Double;
{$IFEND}
begin
PicsHeight := 0;
@ -6190,7 +6202,7 @@ begin
{$IF LCL_FullVersion >= 2000000}
PPI := Font.PixelsPerInch;
f := GetCanvasScaleFactor;
//f := GetCanvasScaleFactor;
{$IFEND}
{$IF LCL_FullVersion >= 1080000}
@ -6766,7 +6778,7 @@ begin
end;
procedure TJvTFDays.CanDrawWhat(ACanvas: TCanvas; ApptRect: TRect;
PicsHeight: Integer; var CanDrawText, CanDrawPics: Boolean);
PicsHeight: Integer; out CanDrawText, CanDrawPics: Boolean);
//var
// TextHeightThreshold,
// TextWidthThreshold: Integer;
@ -7069,17 +7081,17 @@ begin
while (FirstHourRow < BottomRow) and (ExtractMins(RowToTime(FirstHourRow)) <> 0) do
Inc(FirstHourRow);
if RowTime = 0 then
Result := {$IFDEF RTL220_UP}FormatSettings.{$ENDIF RTL220_UP}TimeAMString
Result := FormatSettings.TimeAMString
else
if RowTime = 0.50 then
Result := {$IFDEF RTL220_UP}FormatSettings.{$ENDIF RTL220_UP}TimePMString
Result := FormatSettings.TimePMString
else
if (RowNum = FirstHourRow) and (ExtractMins(RowTime) = 0) then
begin
if RowTime < 0.50 then
Result := {$IFDEF RTL220_UP}FormatSettings.{$ENDIF RTL220_UP}TimeAMString
Result := FormatSettings.TimeAMString
else
Result := {$IFDEF RTL220_UP}FormatSettings.{$ENDIF RTL220_UP}TimePMString;
Result := FormatSettings.TimePMString;
end
else
Result := FormatDateTime(TimeFmt, RowTime);
@ -8184,7 +8196,7 @@ begin
end;
end;
procedure TJvTFDays.CalcSizeEndTime(Appt: TJvTFAppt; var NewEndDT: TDateTime);
procedure TJvTFDays.CalcSizeEndTime(Appt: TJvTFAppt; out NewEndDT: TDateTime);
var
TimeOffset: TTime;
Sched: TJvTFSched;
@ -8247,7 +8259,7 @@ end;
{$IFDEF Jv_TIMEBLOCKS}
// ok
procedure TJvTFDays.CalcMoveStartEnd(Appt: TJvTFAppt; Coord: TJvTFDaysCoord;
KeepDates, KeepTimes: Boolean; var StartDT, EndDT: TDateTime);
KeepDates, KeepTimes: Boolean; out StartDT, EndDT: TDateTime);
var
NewStart, NewEnd: TDateTime;
TimeBlockIndex, BlockStartRow, BlockEndRow: Integer;
@ -8628,7 +8640,9 @@ end;
// ok
procedure TJvTFDays.SetSelStart(Value: TPoint);
var
TimeBlock, StartRow, EndRow: Integer;
TimeBlock: Integer;
StartRow: Integer = -1; // to silence the compiler
EndRow: Integer = -1; // dto.
begin
TimeBlock := RowToTimeBlock(Value.Y);
if (TimeBlock = -1) and (TimeBlocks.Count > 0) then
@ -9356,6 +9370,8 @@ var
I: Integer;
VisGrpHdrRect: TRect;
begin
Result := EmptyRect;
if (Col = gcGroupHdr) and (Row > gcHdr) then
begin
VisGrpHdrRect := Classes.Rect(0, CalcGroupColHdrsHeight, CalcBlockRowHdrsWidth,
@ -9699,7 +9715,7 @@ begin
if CanDrawPics then
Inc(ApptRect.Left, PicsHeight);
IntersectRect(EditorRect, GetDataAreaRect, ApptRect);
IntersectRect(EditorRect{%H-}, GetDataAreaRect, ApptRect);
// Commented out by Tim - No longer required since no editor failure.
// EditHeightThreshold := CanvasMaxTextHeight(Canvas) * Thresholds.EditHeight;
@ -9972,7 +9988,7 @@ begin
end;
procedure TJvTFDays.CalcStartEndRows(AAppt: TJvTFAppt; SchedDate: TDate;
var StartRow, EndRow: Integer);
out StartRow, EndRow: Integer);
begin
if Trunc(AAppt.StartDate) = Trunc(SchedDate) then
StartRow := TimeToRow(AAppt.StartTime)
@ -10953,7 +10969,9 @@ end;
function TJvTFDays.VirtualGroupHdrRect(Col: Integer): TRect;
var
I, GroupStartCol, GroupEndCol, GroupWidth: Integer;
GroupStartCol: Integer = -1; // to silence the compiler
GroupEndCol: Integer = -1; // dto.
I, GroupWidth: Integer;
begin
EnsureCol(Col);
@ -11058,7 +11076,9 @@ end;
function TJvTFDays.GroupHdrIsSelected(ACol: Integer): Boolean;
var
I, GroupStartCol, GroupEndCol: Integer;
I: Integer;
GroupStartCol: Integer = -1; // to silence the compiler
GroupEndCol: Integer = -1; // dto.
begin
GetGroupStartEndCols(ACol, GroupStartCol, GroupEndCol);
Result := False;
@ -11250,8 +11270,9 @@ end;
procedure TJvTFDays.DrawBlockHdr(ACanvas: TCanvas; BlockIndex: Integer);
var
StartRow: Integer = -1;
EndRow: Integer = -1;
ARect, HdrPicRect, TxtBounds: TRect;
StartRow, EndRow: Integer;
ClipIt: Boolean;
Attr: TJvTFDaysHdrAttr;
TimeBlock: TJvTFDaysTimeBlock;
@ -11313,7 +11334,8 @@ end;
procedure TJvTFDays.FillBlockHdrDeadSpace(ACanvas: TCanvas);
var
ARect: TRect;
StartRow, EndRow: Integer;
StartRow: Integer = -1;
EndRow: Integer = -1;
procedure FillIt;
begin
@ -11510,7 +11532,9 @@ end;
function TJvTFDays.RowToTimeBlock(ARow: Integer): Integer;
var
I, BlockStart, BlockEnd: Integer;
I: Integer;
BlockStart: Integer = -1;
BlockEnd: Integer = -1;
begin
Result := -1;
if TimeBlocks.Count = 0 then
@ -11526,7 +11550,7 @@ begin
end;
procedure TJvTFDays.GetTimeBlockStartEnd(ATimeBlock: Integer;
var BlockStart, BlockEnd: Integer);
out BlockStart, BlockEnd: Integer);
var
I: Integer;
begin
@ -11563,14 +11587,16 @@ begin
end;
procedure TJvTFDays.GetBlockStartEndRows(Row: Integer;
var StartRow, EndRow: Integer);
out StartRow, EndRow: Integer);
begin
GetTimeBlockStartEnd(RowToTimeBlock(Row), StartRow, EndRow);
end;
function TJvTFDays.VirtualBlockHdrRect(Row: Integer): TRect;
var
BlockStartRow, BlockEndRow, BlockHeight: Integer;
BlockStartRow: Integer = -1;
BlockEndRow: Integer = -1;
BlockHeight: Integer;
begin
EnsureRow(Row);
@ -11591,7 +11617,9 @@ end;
function TJvTFDays.BlockHdrIsSelected(ARow: Integer): Boolean;
var
I, StartRow, EndRow: Integer;
I: Integer;
StartRow: Integer = -1;
EndRow: Integer = -1;
begin
GetBlockStartEndRows(ARow, StartRow, EndRow);
Result := False;
@ -11920,6 +11948,7 @@ var
begin
if Assigned(GridCoord.Appt) and not Editing and (agoShowApptHints in Options) then
begin
VisApptRect := EmptyRect;
ApptRect := GetApptRect(GridCoord.Col, GridCoord.Appt);
IntersectRect(VisApptRect, ApptRect, GetDataAreaRect);
FHint.ApptHint(GridCoord.Appt, VisApptRect.Left + 2,
@ -12111,7 +12140,7 @@ begin
end;
procedure TJvTFDaysPrinter.CalcPageColInfo(ShowRowHdrs: Boolean;
var CalcColsPerPage, CalcColWidth: Integer);
out CalcColsPerPage, CalcColWidth: Integer);
var
DataWidth, TargetColsPerPage: Integer;
begin
@ -12215,7 +12244,7 @@ begin
end;
procedure TJvTFDaysPrinter.CalcPageRowInfo(ShowColHdrs: Boolean;
var CalcRowsPerPage, CalcRowHeight: Integer);
out CalcRowsPerPage, CalcRowHeight: Integer);
var
DataHeight, TargetRowsPerPage: Integer;
begin
@ -12232,7 +12261,7 @@ begin
end;
procedure TJvTFDaysPrinter.CalcStartEndRows(AAppt: TJvTFAppt;
SchedDate: TDate; var StartRow, EndRow: Integer);
SchedDate: TDate; out StartRow, EndRow: Integer);
begin
if Trunc(AAppt.StartDate) = Trunc(SchedDate) then
StartRow := TimeToRow(AAppt.StartTime)
@ -12246,7 +12275,7 @@ begin
end;
procedure TJvTFDaysPrinter.CanDrawWhat(ACanvas: TCanvas; ApptRect: TRect;
PicsHeight, PicsWidth: Integer; var CanDrawText, CanDrawPics: Boolean);
PicsHeight, PicsWidth: Integer; out CanDrawText, CanDrawPics: Boolean);
var
TextHeightThreshold, TextWidthThreshold: Integer;
begin
@ -12285,6 +12314,8 @@ function TJvTFDaysPrinter.CellRect(Col, Row: Integer;
var
VisGrpHdrRect: TRect;
begin
Result := EmptyRect;
if (Row = gcGroupHdr) and (Col > gcHdr) then
begin
VisGrpHdrRect := Classes.Rect(RowHdrWidth, 0,
@ -12512,13 +12543,14 @@ end;
procedure TJvTFDaysPrinter.PrintBitmap(ACanvas: TCanvas; SourceRect,
DestRect: TRect; aBitmap: TBitmap);
{
var
BitmapHeader: pBitmapInfo;
BitmapImage: POINTER;
HeaderSize: LongWord;
ImageSize: LongWord;
}
begin
{ wp --- to do (GetDIBSizes not in LCL)
GetDIBSizes(aBitmap.Handle, HeaderSize, ImageSize);
@ -13527,7 +13559,7 @@ begin
end;
procedure TJvTFDaysPrinter.FilterPicDrawList(ARect: TRect;
DrawList: TList; var PicsHeight: Integer; var PicsWidth: Integer);
DrawList: TList; out PicsHeight, PicsWidth: Integer);
var
I, NextPicLeft, PicRight, PicBottom: Integer;
DrawIt: Boolean;
@ -14352,7 +14384,9 @@ end;
function TJvTFDaysPrinter.VirtualGroupHdrRect(Col: Integer;
APageInfo: TJvTFDaysPageInfo): TRect;
var
I, GroupStartCol, GroupEndCol, GroupWidth: Integer;
I, GroupWidth: Integer;
GroupStartCol: Integer = 0; // to silence the compiler
GroupEndCol: Integer = 0; // dto.
begin
Result.Top := 0;
Result.Bottom := CalcGroupHdrHeight;

View File

@ -431,9 +431,11 @@ begin
end;
function TJvTFGantt.ClientCursorPos: TPoint;
var
P: TPoint = (X:0; Y:0);
begin
GetCursorPos(Result);
Result := ScreenToClient(Result);
GetCursorPos(P);
Result := ScreenToClient(P);
end;
function TJvTFGantt.ValidMouseAtDesignTime: Boolean;
@ -534,7 +536,7 @@ procedure TJvTFGanttScrollBar.UpdateRange;
var
Info: TScrollInfo;
begin
FillChar(Info, SizeOf(Info), 0);
FillChar(Info{%H-}, SizeOf(Info), 0);
with Info do
begin
cbSize := SizeOf(Info);

View File

@ -539,7 +539,7 @@ type
function ValidCell(Col, Row: Integer): Boolean;
procedure WMEraseBkgnd(var Msg: TLMessage); message LM_ERASEBKGND;
procedure CMCtl3DChanged(var Msg: TLMessage); message CM_CTL3DCHANGED;
// procedure CMCtl3DChanged(var Msg: TLMessage); message CM_CTL3DCHANGED;
procedure Loaded; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure ImageListChange(Sender: TObject);
@ -590,7 +590,7 @@ type
function PicsToDraw(ACell: TJvTFGlanceCell): Boolean;
procedure GetPicsWidthHeight(ACell: TJvTFGlanceCell; PicBuffer: Integer;
Horz: Boolean; var PicsWidth, PicsHeight: Integer);
Horz: Boolean; out PicsWidth, PicsHeight: Integer);
function ValidPicIndex(PicIndex: Integer): Boolean;
// Drawing event dispatch methods
@ -609,13 +609,6 @@ type
procedure SchedNamesChange(Sender: TObject);
{$IF LCL_FullVersion >= 1080000}
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
const AProportion: Double); override;
{$IFEND}
property SelAppt: TJvTFAppt read FSelAppt write SetSelAppt;
property AllowCustomDates: Boolean read FAllowCustomDates write FAllowCustomDates;
// configuration properties and events
@ -625,6 +618,17 @@ type
property OriginDate: TDate read FOriginDate write SetOriginDate;
property OnConfigCells: TNotifyEvent read FOnConfigCells write FOnConfigCells;
property StartOfWeek: TTFDayOfWeek read FStartOfWeek write SetStartOfWeek default dowSunday;
{ lcl scaling }
{$IF LCL_FullVersion >= 1080000}
protected
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
public
procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
const AProportion: Double); override;
{$IFEND}
public
function GetTFHintClass: TJvTFHintClass; dynamic;
@ -640,7 +644,7 @@ type
function GetDataWidth: Integer; dynamic;
function GetDataHeight: Integer; dynamic;
procedure SplitRects(Col, Row: Integer; var ParentRect, SubRect: TRect);
procedure SplitRects(Col, Row: Integer; out ParentRect, SubRect: TRect);
function CellRect(ACell: TJvTFGlanceCell): TRect;
function WholeCellRect(Col, Row: Integer): TRect;
function TitleRect: TRect;
@ -753,7 +757,7 @@ type
procedure ParentReconfig; virtual;
procedure EnsureCol(ACol: Integer);
procedure EnsureRow(ARow: Integer);
procedure MouseAccel(X, Y: Integer); virtual;
procedure MouseAccel({%H-}X, {%H-}Y: Integer); virtual;
procedure GetDistinctAppts(ApptList: TStringList);
procedure FinishEditAppt; virtual;
@ -780,10 +784,10 @@ type
property Appts[Index: Integer]: TJvTFAppt read GetAppt;
function ScheduleCount: Integer;
property Schedules[Index: Integer]: TJvTFSched read GetSchedule;
function GetApptAt(X, Y: Integer): TJvTFAppt; virtual;
function GetApptAt({%H-}X, {%H-}Y: Integer): TJvTFAppt; virtual;
function CanScrollCell(ADir: TJvTFVScrollDir): Boolean; virtual;
procedure ScrollCell(ADelta: Integer); virtual;
function CanScrollCell({%H-}ADir: TJvTFVScrollDir): Boolean; virtual;
procedure ScrollCell({%H-}ADelta: Integer); virtual;
published
property RepeatGrouped: Boolean read FRepeatGrouped write SetRepeatGrouped default True;
property ShowSchedNamesInHint: Boolean read FShowSchedNamesInHint write SetShowSchedNamesInHint default True;
@ -1522,6 +1526,7 @@ begin
end;
end;
(******************** NOT CONVERTED ***
procedure TJvTFCustomGlance.CMCtl3DChanged(var Msg: TLMessage);
begin
if FBorderStyle = bsSingle then
@ -1529,6 +1534,7 @@ begin
RecreateWnd(self);
inherited;
end;
************************************)
procedure TJvTFCustomGlance.CreateParams(var Params: TCreateParams);
const
@ -2832,7 +2838,7 @@ begin
end;
procedure TJvTFCustomGlance.GetPicsWidthHeight(ACell: TJvTFGlanceCell;
PicBuffer: Integer; Horz: Boolean; var PicsWidth, PicsHeight: Integer);
PicBuffer: Integer; Horz: Boolean; out PicsWidth, PicsHeight: Integer);
var
I, PicIndex: Integer;
begin
@ -3190,7 +3196,7 @@ begin
end;
procedure TJvTFCustomGlance.SplitRects(Col, Row: Integer;
var ParentRect, SubRect: TRect);
out ParentRect, SubRect: TRect);
var
ACell: TJvTFGlanceCell;
WorkRect: TRect;

View File

@ -414,7 +414,7 @@ end;
procedure TJvTFGVTextControl.PaintTo(ACanvas: TCanvas; DrawInfo: TJvTFGlTxtVwDrawInfo);
var
I, NextLineTop, LastLine, lLine: Integer;
aRect, lLineRect, TxtRect, BtnRect: TRect;
aRect, lLineRect, TxtRect: TRect;
Flags: UINT;
Txt: string;
Appt: TJvTFAppt;
@ -573,7 +573,7 @@ begin
// If the control is being moved, we keep track of when this happened.
// See in MouseUp for details of usage of this value.
if (Left <> ALeft) or (Top <> ATop) then
FWasMovedTicks := GetTickCount
FWasMovedTicks := GetTickCount64
else
FWasMovedTicks := 0;
@ -763,7 +763,7 @@ begin
// the change of location in SetBounds and if we get a MouseUp event
// in less than the double click time, we know it's a because of a
// double click and we trigger the appropriate event.
ticks := GetTickCount;
ticks := GetTickCount64;
if (ticks - FWasMovedTicks < GetDoubleClickTime) then
begin
DoViewerDblClick;

View File

@ -508,7 +508,7 @@ type
Code: TJvTFServNotifyCode);
procedure RetrieveSchedule(const SchedName: string; SchedDate: TDate;
var Schedule: TJvTFSched; var LoadedNow: Boolean);
out Schedule: TJvTFSched; out LoadedNow: Boolean);
procedure NeedAppts(Schedule: TJvTFSched); virtual;
procedure AddAppt(Appt: TJvTFAppt);
@ -907,7 +907,7 @@ type
procedure CreateLayout; virtual;
procedure SetPropertyCheck; dynamic;
procedure GetHeaderFooterRects(var HeaderRect, FooterRect: TRect);
procedure GetHeaderFooterRects(out HeaderRect, FooterRect: TRect);
// document management methods
procedure CreateDoc; dynamic;
@ -2716,7 +2716,7 @@ begin
end;
procedure TJvTFScheduleManager.RetrieveSchedule(const SchedName: string; SchedDate: TDate;
var Schedule: TJvTFSched; var LoadedNow: Boolean);
out Schedule: TJvTFSched; out LoadedNow: Boolean);
var
SchedID: string;
I: Integer;
@ -3003,6 +3003,7 @@ function TJvTFScheduleManager.RequestSchedule(Comp: TJvTFComponent;
var
ApptsNeeded: Boolean;
begin
Result := nil;
RetrieveSchedule(SchedName, SchedDate, Result, ApptsNeeded);
if Assigned(Comp) then
@ -3023,6 +3024,7 @@ end;
function TJvTFScheduleManager.RequestSchedule(Comp: TJvTFComponent;
const SchedName: string; SchedDate: TDate; var LoadedNow: Boolean): TJvTFSched;
begin
Result := nil;
RetrieveSchedule(SchedName, SchedDate, Result, LoadedNow);
if Assigned(Comp) then
@ -3178,7 +3180,7 @@ end;
function TJvTFScheduleManager.dbNewAppt(const ID: string): TJvTFAppt;
var
New: Boolean;
New: Boolean = false; // to silence the compiler
begin
Result := nil;
RequestAppt(ID, Result, New);
@ -4527,7 +4529,7 @@ begin
Result := FDocDateTime;
end;
procedure TJvTFPrinter.GetHeaderFooterRects(var HeaderRect, FooterRect: TRect);
procedure TJvTFPrinter.GetHeaderFooterRects(out HeaderRect, FooterRect: TRect);
begin
HeaderRect.Left := FMarginOffsets.Left;
HeaderRect.Top := FMarginOffsets.Top;
@ -4777,8 +4779,8 @@ begin
end;
procedure TJvTFPrinter.SaveDocToFiles(BaseFileName: TFileName);
var
I: Integer;
{var
I: Integer; }
begin
if State <> spsFinished then
raise EJvTFPrinterError.CreateRes(@RsEDocumentMustBeFinishedToSaveToFile);

View File

@ -31,7 +31,7 @@ unit JvTFMonths;
interface
uses
LCLIntf, LCLType, LMessages,
LCLIntf, LCLType, //LMessages,
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
JvTFGlance, JvTFUtils, JvTFManager;

View File

@ -54,7 +54,7 @@ type
procedure Put(Row, Col: Integer; Data: NativeInt);
function Get(Row, Col: Integer): NativeInt;
function FindQuantum(Row, Col: Integer;
var Prev, Curr: PSMQuantum; var RowExists: Boolean): Boolean;
out Prev, Curr: PSMQuantum; out RowExists: Boolean): Boolean;
public
destructor Destroy; override;
procedure Clear;
@ -81,7 +81,7 @@ procedure TJvTFSparseMatrix.Clear;
var
P, CurrRow, CurrCol: PSMQuantum;
begin
CurrRow := PSMQuantum(FMatrix.Data);
CurrRow := {%H-}PSMQuantum(FMatrix.Data);
while CurrRow <> nil do
begin
@ -94,7 +94,7 @@ begin
end;
P := CurrRow;
CurrRow := PSMQuantum(CurrRow^.Data);
CurrRow := {%H-}PSMQuantum(CurrRow^.Data);
Dispose(P);
end;
@ -108,7 +108,7 @@ begin
DestMatrix.Clear;
DestMatrix.NullValue := NullValue;
CurrRow := PSMQuantum(FMatrix.Data);
CurrRow := {%H-}PSMQuantum(FMatrix.Data);
while CurrRow <> nil do
begin
@ -119,7 +119,7 @@ begin
CurrCol := CurrCol^.Link;
end;
CurrRow := PSMQuantum(CurrRow^.Data);
CurrRow := {%H-}PSMQuantum(CurrRow^.Data);
end;
end;
@ -128,7 +128,7 @@ var
CurrRow, CurrCol: PSMQuantum;
begin
DumpList.Clear;
CurrRow := PSMQuantum(FMatrix.Data);
CurrRow := {%H-}PSMQuantum(FMatrix.Data);
DumpList.BeginUpdate;
try
while CurrRow <> nil do
@ -141,7 +141,7 @@ begin
IntToStr(CurrCol^.Data));
CurrCol := CurrCol^.Link;
end;
CurrRow := PSMQuantum(CurrRow^.Data);
CurrRow := {%H-}PSMQuantum(CurrRow^.Data);
end;
finally
DumpList.EndUpdate;
@ -149,18 +149,18 @@ begin
end;
function TJvTFSparseMatrix.FindQuantum(Row, Col: Integer;
var Prev, Curr: PSMQuantum; var RowExists: Boolean): Boolean;
out Prev, Curr: PSMQuantum; out RowExists: Boolean): Boolean;
begin
Prev := @FMatrix;
Curr := PSMQuantum(FMatrix.Data);
Result := False;
Prev := @FMatrix;
Curr := {%H-}PSMQuantum(FMatrix.Data);
RowExists := False;
// Find Row Header
while (Curr <> nil) and (Curr^.Index < Row) do
begin
Prev := Curr;
Curr := PSMQuantum(Curr^.Data);
Curr := {%H-}PSMQuantum(Curr^.Data);
end;
// If Row Header found, then find col
@ -217,7 +217,7 @@ begin
P^.Index := Row;
P^.Link := nil;
P^.Data := Prev^.Data;
PSMQuantum(Prev^.Data) := P;
{%H-}PSMQuantum(Prev^.Data) := P;
Prev := P;
end;
@ -246,7 +246,7 @@ procedure TJvTFSparseMatrix.Pack;
var
P, Prev, CurrRow: PSMQuantum;
begin
CurrRow := PSMQuantum(FMatrix.Data);
CurrRow := {%H-}PSMQuantum(FMatrix.Data);
Prev := @FMatrix;
while CurrRow <> nil do
@ -254,14 +254,14 @@ begin
if CurrRow^.Link <> nil then
begin
Prev := CurrRow;
CurrRow := PSMQuantum(CurrRow^.Data);
CurrRow := {%H-}PSMQuantum(CurrRow^.Data);
end
else
begin
P := CurrRow;
Prev^.Data := CurrRow^.Data;
Dispose(P);
CurrRow := PSMQuantum(Prev^.Data);
CurrRow := {%H-}PSMQuantum(Prev^.Data);
end;
end;
end;

View File

@ -92,8 +92,8 @@ function BorlToDOW(BorlDOW: Integer): TTFDayOfWeek;
function DateToDOW(ADate: TDateTime): TTFDayOfWeek;
procedure CalcTextPos(ACanvas: TCanvas;
HostRect: TRect; var TextLeft, TextTop: Integer;
var TextBounds: TRect; AFont: TFont; AAngle: Integer;
HostRect: TRect; out TextLeft, TextTop: Integer;
out TextBounds: TRect; AFont: TFont; AAngle: Integer;
HAlign: TAlignment; VAlign: TJvTFVAlignment; ATxt: String);
{
procedure CalcTextPos(HostRect: TRect; var TextLeft, TextTop: Integer;
@ -101,7 +101,7 @@ procedure CalcTextPos(HostRect: TRect; var TextLeft, TextTop: Integer;
HAlign: TAlignment; VAlign: TJvTFVAlignment; ATxt: string);
}
procedure DrawAngleText(ACanvas: TCanvas; HostRect: TRect;
var TextBounds: TRect; AAngle: Integer; HAlign: TAlignment;
out TextBounds: TRect; AAngle: Integer; HAlign: TAlignment;
VAlign: TJvTFVAlignment; ATxt: string);
function RectWidth(ARect: TRect): Integer;
@ -442,8 +442,8 @@ begin
Result := BorlToDOW(BorlDOW);
end;
procedure CalcTextPos(ACanvas: TCanvas; HostRect: TRect; var TextLeft, TextTop: Integer;
var TextBounds: TRect; AFont: TFont; AAngle: Integer;
procedure CalcTextPos(ACanvas: TCanvas; HostRect: TRect; out TextLeft, TextTop: Integer;
out TextBounds: TRect; AFont: TFont; AAngle: Integer;
HAlign: TAlignment; VAlign: TJvTFVAlignment; ATxt: String);
var
sinAngle, cosAngle: Extended;
@ -671,14 +671,14 @@ begin
end; *)
procedure DrawAngleText(ACanvas: TCanvas; HostRect: TRect;
var TextBounds: TRect; AAngle: Integer; HAlign: TAlignment;
out TextBounds: TRect; AAngle: Integer; HAlign: TAlignment;
VAlign: TJvTFVAlignment; ATxt: string);
var
// LogFont: TLogFont;
TxtRect: TRect;
Flags: UINT;
PTxt: PChar;
ClipRgn: HRgn;
// Flags: UINT;
// PTxt: PChar;
// ClipRgn: HRgn;
TextLeft, TextTop: Integer;
ts: TTextStyle;
begin
@ -726,49 +726,6 @@ begin
//ARect := TxtRect;
end;
(*
procedure DrawAngleText(ACanvas: TCanvas; HostRect: TRect;
var TextBounds: TRect; AAngle: Integer; HAlign: TAlignment;
VAlign: TJvTFVAlignment; ATxt: string);
var
LogFont: TLogFont;
TxtRect: TRect;
Flags: UINT;
PTxt: PChar;
ClipRgn: HRgn;
TextLeft,
TextTop: Integer;
begin
//TxtRect := ARect;
//CalcTextPos(TxtRect, ACanvas.Font, AAngle, HAlign, VAlign, ATxt);
CalcTextPos(HostRect, TextLeft, TextTop, TextBounds, ACanvas.Font, AAngle,
HAlign, VAlign, ATxt);
Windows.GetObject(ACanvas.Font.Handle, SizeOf(LogFont), @LogFont);
LogFont.lfEscapement := AAngle;
LogFont.lfOrientation := LogFont.lfEscapement;
ACanvas.Font.Handle := CreateFontIndirect(LogFont);
Flags := DT_NOPREFIX or DT_LEFT or DT_TOP or DT_NOCLIP or DT_SINGLELINE;
PTxt := StrAlloc((Length(ATxt) + 4) * SizeOf(Char));
StrPCopy(PTxt, ATxt);
//ClipRgn := Windows.CreateRectRgn(ARect.Left, ARect.Top,
// ARect.Right, ARect.Bottom);
ClipRgn := Windows.CreateRectRgn(HostRect.Left, HostRect.Top,
HostRect.Right, HostRect.Bottom);
Windows.SelectClipRgn(ACanvas.Handle, ClipRgn);
//Windows.DrawText(ACanvas.Handle, PTxt, -1, TxtRect, Flags);
TxtRect := Rect(TextLeft, TextTop, TextLeft + 1, TextTop + 1);
Windows.DrawText(ACanvas.Handle, PTxt, -1, TxtRect, Flags);
Windows.SelectClipRgn(ACanvas.Handle, 0);
Windows.DeleteObject(ClipRgn);
StrDispose(PTxt);
ACanvas.Font.Handle := 0;
//ARect := TxtRect;
end;
*)
function RectWidth(ARect: TRect): Integer;
begin
Result := ARect.Right - ARect.Left;

View File

@ -31,7 +31,7 @@ unit JvTFWeeks;
interface
uses
LCLIntf, LCLType, LMessages, LCLVersion,
LCLIntf, LCLType, LCLVersion,
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
JvTFManager, JvTFGlance, JvTFUtils;
@ -71,9 +71,8 @@ type
{$IF LCL_FullVersion >= 1080000}
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
{ procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
const AProportion: Double); override;
}
// procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
// const AProportion: Double); override;
{$IFEND}
// draws the DW Titles