You've already forked lazarus-ccr
jvcllaz: several minoor fixes (cosmetics, less hints and warnings, fix TJvTimelines.Borderstyle).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6613 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -32,7 +32,7 @@ unit JvBaseThumbnail;
|
||||
interface
|
||||
|
||||
uses
|
||||
LclIntf, LCLType, LMessages,
|
||||
LclIntf, LCLType, //LMessages,
|
||||
(*
|
||||
Windows, // TWin32FindData
|
||||
{$IFDEF HAS_UNIT_LIBC}
|
||||
@ -40,10 +40,10 @@ uses
|
||||
{$ENDIF HAS_UNIT_LIBC}
|
||||
Messages,
|
||||
*)
|
||||
Classes, Graphics, Controls, Forms, ExtCtrls,
|
||||
Classes, Graphics, Controls, Forms, ExtCtrls;
|
||||
//JclBase,
|
||||
//JvExForms,
|
||||
JvExExtCtrls;
|
||||
// JvExExtCtrls;
|
||||
|
||||
// (rom) TFileName is already declared in SysUtils
|
||||
|
||||
@ -94,10 +94,10 @@ type
|
||||
procedure SetLength(NewLength: Integer);
|
||||
procedure Init;
|
||||
public
|
||||
procedure LoadFromStream(AStream: TStream; APos: Integer); //Load From stream
|
||||
procedure LoadFromStream({%H-}AStream: TStream; {%H-}APos: Integer); //Load From stream
|
||||
// both of this routines are inserting extract data to the stream its self
|
||||
// like a header and data end string;
|
||||
procedure SaveToStream(AStream: TStream; APos: Integer); // Save to a Stream
|
||||
procedure SaveToStream({%H-}AStream: TStream; {%H-}APos: Integer); // Save to a Stream
|
||||
{ wp -- not used anywhere
|
||||
// (rom) moved to public
|
||||
property LongName: string read FLongName; // The LongName of this filename
|
||||
@ -183,8 +183,10 @@ type
|
||||
function BoundByte(Min, Max, Value: Integer): Byte;
|
||||
procedure InsertStr(var Str: string; const NewStr: string; Pos: Longint);
|
||||
function ProportionalSize(PhysicalSize, NewSize: TPoint): TPoint;
|
||||
{
|
||||
function ReplaceChar(const AStr: string; const CharToFind, NewChar: Char;
|
||||
ReplaceNo: Longint; CaseSensitive: Boolean): string;
|
||||
}
|
||||
function JkCeil(I: Extended): Longint;
|
||||
function ReplaceAllStr(const Str, SearchFor, ReplaceWith: string;
|
||||
CaseSensitive: Boolean): string;
|
||||
@ -249,7 +251,7 @@ begin
|
||||
T := T - 1;
|
||||
Result := T;
|
||||
end;
|
||||
|
||||
(*
|
||||
function ReplaceChar(const AStr: string; const CharToFind, NewChar: Char;
|
||||
ReplaceNo: Longint; CaseSensitive: Boolean): string;
|
||||
var
|
||||
@ -274,7 +276,7 @@ begin
|
||||
Inc(Count, 1);
|
||||
until (Count > Length(Res)) or (RepCount >= ReplaceNo);
|
||||
Result := Res;
|
||||
end;
|
||||
end; *)
|
||||
|
||||
function ProportionalSize(PhysicalSize, NewSize: TPoint): TPoint;
|
||||
var
|
||||
@ -658,13 +660,14 @@ var
|
||||
LocalTime: TFileTime;
|
||||
DOSTime: Integer;
|
||||
begin
|
||||
FileTimeToLocalFileTime(FileTime, LocalTime);
|
||||
FileTimeToDosDateTime(LocalTime, LongRec(DOSTime).Hi, LongRec(DOSTime).Lo);
|
||||
FileTimeToLocalFileTime(FileTime, LocalTime{%H-});
|
||||
FileTimeToDosDateTime(LocalTime, LongRec(DOSTime).Hi, LongRec({%H-}DOSTime).Lo);
|
||||
Result := FileDateToDateTime(DOSTime);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TJvFileName.Init;
|
||||
(*
|
||||
var
|
||||
{$IFDEF WINDOWS}
|
||||
Dft: DWORD;
|
||||
@ -674,9 +677,9 @@ var
|
||||
{$IFDEF UNIX}
|
||||
info: stat;
|
||||
{$ENDIF}
|
||||
*)
|
||||
begin
|
||||
(* wp: not used anywhere...
|
||||
|
||||
(*
|
||||
{$IFDEF WINDOWS}
|
||||
if FindFirst(FFileName, faAnyFile or faDirectory, sr) = 0 then
|
||||
begin
|
||||
|
@ -278,7 +278,7 @@ type
|
||||
procedure Paint; override;
|
||||
//procedure PaintWindow(DC: HDC); override;
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
procedure IndexToColRow(Index: Integer; var ACol, ARow: Integer);
|
||||
procedure IndexToColRow(Index: Integer; out ACol, ARow: Integer);
|
||||
procedure DrawItem(Index: Integer; State: TCustomDrawState; ACanvas: TCanvas; AItemRect, TextRect: TRect); virtual;
|
||||
function GetItemClass: TJvViewerItemClass; virtual;
|
||||
function GetOptionsClass: TJvItemViewerOptionsClass; virtual;
|
||||
@ -355,8 +355,9 @@ function CenterRect(InnerRect, OuterRect: TRect): TRect;
|
||||
implementation
|
||||
|
||||
uses
|
||||
SysUtils, Math,
|
||||
JvJCLUtils, JvJVCLUtils, Themes, LCLIntf;
|
||||
SysUtils, Math, Themes, LCLIntf,
|
||||
JvJCLUtils;
|
||||
// JvJVCLUtils, ;
|
||||
|
||||
const
|
||||
cScrollDelay = 400;
|
||||
@ -880,7 +881,7 @@ end;
|
||||
|
||||
procedure TJvCustomItemViewer.CheckHotTrack;
|
||||
var
|
||||
P: TPoint;
|
||||
P: TPoint = (X:0; Y:0);
|
||||
I: Integer;
|
||||
begin
|
||||
if Options.HotTrack and GetCursorPos(P) then
|
||||
@ -964,8 +965,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TJvCustomItemViewer.CreateParams(var Params: TCreateParams);
|
||||
const
|
||||
BorderStyles: array [TBorderStyle] of DWORD = (0, WS_BORDER);
|
||||
//const
|
||||
// BorderStyles: array [TBorderStyle] of DWORD = (0, WS_BORDER);
|
||||
begin
|
||||
inherited CreateParams(Params);
|
||||
//with Params do
|
||||
@ -1067,7 +1068,7 @@ end;
|
||||
function TJvCustomItemViewer.GetDragImages: TDragImageList;
|
||||
var
|
||||
B: TBitmap;
|
||||
P: TPoint;
|
||||
P: TPoint = (X:0; Y:0);
|
||||
I: Integer;
|
||||
AItemRect, TextRect: TRect;
|
||||
begin
|
||||
@ -1190,7 +1191,7 @@ begin
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
procedure TJvCustomItemViewer.IndexToColRow(Index: Integer; var ACol, ARow: Integer);
|
||||
procedure TJvCustomItemViewer.IndexToColRow(Index: Integer; out ACol, ARow: Integer);
|
||||
begin
|
||||
Assert(FCols > 0);
|
||||
ACol := Index mod FCols;
|
||||
@ -1808,7 +1809,7 @@ end;
|
||||
procedure TJvCustomItemViewer.DoScrollTimer(Sender: TObject);
|
||||
var
|
||||
DoInvalidate: Boolean;
|
||||
P: TPoint;
|
||||
P: TPoint = (X:0; Y:0);
|
||||
begin
|
||||
FScrollTimer.Enabled := False;
|
||||
FScrollTimer.Interval := cScrollIntervall;
|
||||
|
@ -66,15 +66,16 @@ type
|
||||
FClient: TJvOutlookBarButton;
|
||||
protected
|
||||
procedure AssignClient(AClient: TObject); override;
|
||||
function IsCaptionLinked: Boolean; override;
|
||||
function IsImageIndexLinked: Boolean; override;
|
||||
function IsOnExecuteLinked: Boolean; override;
|
||||
function IsEnabledLinked: Boolean; override;
|
||||
procedure SetCaption(const Value: string); override;
|
||||
procedure SetEnabled(Value: Boolean); override;
|
||||
procedure SetImageIndex(Value: Integer); override;
|
||||
procedure SetOnExecute(Value: TNotifyEvent); override;
|
||||
property Client: TJvOutlookBarButton read FClient write FClient;
|
||||
public
|
||||
function IsCaptionLinked: Boolean; override;
|
||||
function IsEnabledLinked: Boolean; override;
|
||||
function IsImageIndexLinked: Boolean; override;
|
||||
end;
|
||||
|
||||
TJvOutlookBarButtonActionLinkClass = class of TJvOutlookBarButtonActionLink;
|
||||
@ -1058,9 +1059,6 @@ begin
|
||||
ActionChange(Sender, False);
|
||||
end;
|
||||
|
||||
type
|
||||
THackOwnedCollection = class(TOwnedCollection);
|
||||
|
||||
procedure TJvOutlookBarButton.SetAction(Value: TBasicAction);
|
||||
begin
|
||||
if (FActionLink <> nil) and (FActionLink.Action <> nil) then
|
||||
@ -1603,7 +1601,6 @@ end;
|
||||
|
||||
function TJvCustomOutlookBar.CalcPageButtonHeight: Integer;
|
||||
var
|
||||
DC: THandle;
|
||||
OldFont: HFONT;
|
||||
begin
|
||||
OldFont := SelectObject(Canvas.Handle, Canvas.Font.Handle);
|
||||
@ -1685,7 +1682,7 @@ var
|
||||
Flags: Cardinal;
|
||||
HasImage: Boolean;
|
||||
Details: TThemedElementDetails;
|
||||
margin, w: Integer;
|
||||
margin: Integer;
|
||||
{$IF LCL_FullVersion >= 1090000}
|
||||
pageImageRes: TScaledImageListResolution;
|
||||
f: Double;
|
||||
@ -1867,7 +1864,6 @@ var
|
||||
SavedDC: Integer;
|
||||
flags: Integer;
|
||||
Details: TThemedElementDetails;
|
||||
w: Integer;
|
||||
dist: Integer;
|
||||
{$IF LCL_FullVersion >= 1090000}
|
||||
LargeImageRes, SmallImageRes: TScaledImageListResolution;
|
||||
@ -2914,7 +2910,7 @@ begin
|
||||
OldFont := SelectObject(Canvas.Handle, Canvas.Font.Handle);
|
||||
try
|
||||
Canvas.Font.Assign(Font);
|
||||
GetTextMetrics(Canvas.Handle, TM);
|
||||
GetTextMetrics(Canvas.Handle, TM{%H-});
|
||||
Result := TM.tmHeight + TM.tmExternalLeading;
|
||||
if (PageIndex >= 0) and (PageIndex < Pages.Count) then
|
||||
begin
|
||||
|
@ -105,8 +105,6 @@ type
|
||||
procedure SetMonthFont(const Value: TFont);
|
||||
procedure SetSelDate(const Value: TDate);
|
||||
procedure SetDayWidth(const Value: Integer);
|
||||
function GetBorderStyle: TBorderStyle;
|
||||
procedure SetBorderStyle(const Value: TBorderStyle);
|
||||
procedure SetImages(const Value: TImageList);
|
||||
procedure DoChange(Sender: TObject);
|
||||
function GetImageIndex(ADate: TDate): Integer;
|
||||
@ -118,11 +116,11 @@ type
|
||||
procedure SetImageCursor(const Value: TCursor);
|
||||
procedure SetSelection(const Value: TJvTLSelFrame);
|
||||
procedure DoLMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure DoMouseUp(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
|
||||
procedure DoMouseUp(Sender: TObject; {%H-}Button: TMouseButton;
|
||||
{%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
|
||||
procedure DoRMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
|
||||
// this is needed so we receive the arrow keys
|
||||
|
||||
procedure DrawFrame(ACanvas: TCanvas; AColor: TColor;
|
||||
@ -149,21 +147,22 @@ type
|
||||
protected
|
||||
// procedure GetDlgCode(var Code: TDlgCodes); override; <--- wp
|
||||
// procedure CursorChanged; override; <--- wo
|
||||
procedure EnabledChanged; override;
|
||||
procedure Paint; override;
|
||||
procedure Change; virtual;
|
||||
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;
|
||||
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;
|
||||
procedure EnabledChanged; override;
|
||||
function GetBorderStyle: TBorderStyle;
|
||||
function GetLastVisibleDate: TDate;
|
||||
function GetVisibleDays: Integer;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure LoadObject(Stream: TStream; var AObject: TObject); virtual;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
|
||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
|
||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
|
||||
procedure Paint; override;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
procedure Change; virtual;
|
||||
procedure LoadObject(Stream: TStream; var AObject: TObject); virtual;
|
||||
procedure SaveObject(Stream: TStream; const AObject: TObject); virtual;
|
||||
function GetLastVisibleDate: TDate;
|
||||
function GetVisibleDays: Integer;
|
||||
procedure SetBorderStyle(Value: TBorderStyle); override;
|
||||
|
||||
property BorderStyle: TBorderStyle read GetBorderStyle write SetBorderStyle;
|
||||
property ButtonWidth: Integer read FButtonWidth write SetButtonWidth default 16;
|
||||
@ -198,6 +197,7 @@ type
|
||||
property OnReadObject: TJvObjectReadEvent read FOnReadObject write FOnReadObject;
|
||||
property OnWriteObject: TJvObjectWriteEvent read FOnWriteObject write FOnWriteObject;
|
||||
property Align default alTop;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -899,13 +899,13 @@ begin
|
||||
Result := inherited BorderStyle;
|
||||
end;
|
||||
|
||||
procedure TJvCustomTMTimeline.SetBorderStyle(const Value: TBorderStyle);
|
||||
procedure TJvCustomTMTimeline.SetBorderStyle(Value: TBorderStyle);
|
||||
begin
|
||||
inherited BorderStyle := Value;
|
||||
if BorderStyle <> Value then
|
||||
begin
|
||||
inherited BorderStyle := Value;
|
||||
FLeftBtn.Flat := BorderStyle = bsNone;
|
||||
FRightBtn.Flat := BorderStyle = bsNone;
|
||||
FLeftBtn.Flat := (BorderStyle = bsNone);
|
||||
FRightBtn.Flat := (BorderStyle = bsNone);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1187,14 +1187,17 @@ begin
|
||||
end;
|
||||
|
||||
function ReadInt(Stream: TStream): Integer;
|
||||
var
|
||||
n: Integer = 0;
|
||||
begin
|
||||
Stream.Read(Result, SizeOf(Result));
|
||||
Stream.Read(n, SizeOf(n));
|
||||
Result := n;
|
||||
end;
|
||||
|
||||
function ReadStr(Stream: TStream): string;
|
||||
var
|
||||
I: Integer;
|
||||
UTF8Value: UTF8String;
|
||||
UTF8Value: UTF8String = '';
|
||||
begin
|
||||
I := ReadInt(Stream);
|
||||
SetLength(Result, I);
|
||||
|
@ -128,10 +128,9 @@ uses
|
||||
FPImage,
|
||||
JvThumbnails, JvTypes, JvResources;
|
||||
|
||||
procedure GrayScaleProc(AImg: TLazIntfImage; ARedData, AGreenData, ABlueData: Pointer);
|
||||
procedure GrayScaleProc(AImg: TLazIntfImage; {%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
var
|
||||
r, c: Integer;
|
||||
clr: TColor;
|
||||
col: TFPColor;
|
||||
intens: Integer;
|
||||
begin
|
||||
@ -143,7 +142,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure InvertProc(AImg: TLazIntfImage; ARedData, AGreenData, ABlueData: Pointer);
|
||||
procedure InvertProc(AImg: TLazIntfImage; {%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
const
|
||||
MX: word = $FFFF;
|
||||
var
|
||||
@ -159,7 +158,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure MirrorHorProc(AImg: TLazIntfImage; ARedData, AGreenData, ABlueData: Pointer);
|
||||
procedure MirrorHorProc(AImg: TLazIntfImage; {%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
var
|
||||
r, c, w, h: Integer;
|
||||
col1, col2: TFPColor;
|
||||
@ -175,7 +174,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure MirrorVertProc(AImg: TLazIntfImage; ARedData, AGreenData, ABlueData: Pointer);
|
||||
procedure MirrorVertProc(AImg: TLazIntfImage; {%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
var
|
||||
r, c, w, h: Integer;
|
||||
col1, col2: TFPColor;
|
||||
@ -192,7 +191,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure Rotate90Proc(ASrcImg, ADestImg: TLazIntfImage;
|
||||
ARedData, AGreenData, ABlueData: Pointer);
|
||||
{%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
var
|
||||
r, c, w, h: Integer;
|
||||
col: TFPColor;
|
||||
@ -208,7 +207,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure Rotate180Proc(ASrcImg, ADestImg: TLazIntfImage;
|
||||
ARedData, AGreenData, ABlueData: Pointer);
|
||||
{%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
var
|
||||
r, c, w, h: Integer;
|
||||
col: TFPColor;
|
||||
@ -223,7 +222,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure Rotate270Proc(ASrcImg, ADestImg: TLazIntfImage;
|
||||
ARedData, AGreenData, ABlueData: Pointer);
|
||||
{%H-}ARedData, {%H-}AGreenData, {%H-}ABlueData: Pointer);
|
||||
var
|
||||
r, c, w, h: Integer;
|
||||
col: TFPColor;
|
||||
@ -247,9 +246,9 @@ var
|
||||
rVal, gVal, bVal: Byte;
|
||||
deltaR, deltaG, deltaB: Integer;
|
||||
begin
|
||||
deltaR := PtrUInt(ARedData);
|
||||
deltaG := PtrUInt(AGreenData);
|
||||
deltaB := PtrUInt(ABlueData);
|
||||
deltaR := {%H-}PtrUInt(ARedData);
|
||||
deltaG := {%H-}PtrUInt(AGreenData);
|
||||
deltaB := {%H-}PtrUInt(ABlueData);
|
||||
for r := 0 to AImg.Height - 1 do
|
||||
for c := 0 to AImg.Width - 1 do begin
|
||||
a := AImg.Colors[c, r].Alpha;
|
||||
@ -478,7 +477,7 @@ end;
|
||||
procedure TJvThumbImage.LoadFromFile(AFile: string);
|
||||
var
|
||||
JpegImage: TJpegImage;
|
||||
Fl: TFileStream;
|
||||
// Fl: TFileStream;
|
||||
begin
|
||||
try
|
||||
if UpperCase(ExtractFileExt(AFile)) = '.JPG' then
|
||||
@ -787,7 +786,7 @@ end;
|
||||
not preserved or values calculations depending on the current channel values. }
|
||||
procedure TJvThumbImage.ChangeRGB(R, G, B: Longint);
|
||||
begin
|
||||
Transform(@RGBProc, Pointer(PtrUInt(R)), Pointer(PtrUInt(G)), Pointer(PtrUInt(B)));
|
||||
Transform(@RGBProc, {%H-}Pointer(PtrUInt(R)), {%H-}Pointer(PtrUInt(G)), {%H-}Pointer(PtrUInt(B)));
|
||||
end;
|
||||
|
||||
{ General bitmap transformation method using LazIntfImages. The operation is
|
||||
|
@ -34,7 +34,7 @@ uses
|
||||
LCLIntf, LCLType, LMessages, Types,
|
||||
Classes, Controls, Forms, ExtCtrls,
|
||||
SysUtils, Graphics,
|
||||
JvThumbnails, JvBaseThumbnail, JvExControls;
|
||||
JvThumbnails, JvBaseThumbnail; //, JvExControls;
|
||||
|
||||
type
|
||||
// (rom) already in JvBaseThumbnail
|
||||
@ -820,7 +820,7 @@ end;
|
||||
procedure TJvThumbView.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
var
|
||||
SelNo, No: Word;
|
||||
SelNo, No: Integer;
|
||||
TempX, TempY: Longint;
|
||||
thumb: TJvThumbnail;
|
||||
begin
|
||||
@ -1007,7 +1007,7 @@ begin
|
||||
try
|
||||
FFilling := True;
|
||||
// if Assigned(ReadFileList) then FreeAndNil(ReadFileList);
|
||||
FStartTime := GetTickCount;
|
||||
FStartTime := GetTickCount64;
|
||||
GetFiles(Value);
|
||||
if FSorted then
|
||||
ReadFileList.Assign(FFileListSorted)
|
||||
@ -1029,7 +1029,7 @@ begin
|
||||
AddThumb(ExtractFilename(ReadFileList.Strings[Counter1]), True);
|
||||
TJvThumbnail(FThumbList.Objects[Counter1]).FileName := ReadFileList.Strings[Counter1];
|
||||
Inc(FDiskSize, TJvThumbnail(FThumbList.Objects[Counter1]).FileSize);
|
||||
if (Cursor <> crHourGlass) and (GetTickCount - FStartTime > 1000) then
|
||||
if (Cursor <> crHourGlass) and (GetTickCount64 - FStartTime > 1000) then
|
||||
Cursor := crHourGlass;
|
||||
end;
|
||||
end;
|
||||
|
@ -116,8 +116,8 @@ type
|
||||
function GetTitleBorderStyle: TBorderStyle;
|
||||
function IsTitleFontStored: Boolean;
|
||||
procedure RefreshFont(Sender: TObject);
|
||||
procedure SetDummyCard(AInt: Longint);
|
||||
procedure SetDummyStr(AStr: string);
|
||||
procedure SetDummyCard({%H-}AInt: Longint);
|
||||
procedure SetDummyStr({%H-}AStr: string);
|
||||
procedure SetFileName(const AFile: string);
|
||||
procedure SetMargin(AValue: Integer);
|
||||
procedure SetMinimizeMemory(Min: Boolean);
|
||||
@ -137,7 +137,7 @@ type
|
||||
procedure BoundsChanged; override;
|
||||
procedure CalculateImageSize; virtual;
|
||||
procedure CreateHandle; override;
|
||||
procedure THSizeChanged(var Msg: TLMessage); message TH_IMAGESIZECHANGED;
|
||||
procedure THSizeChanged(var {%H-}Msg: TLMessage); message TH_IMAGESIZECHANGED;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer); override;
|
||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
||||
@ -189,7 +189,7 @@ implementation
|
||||
|
||||
uses
|
||||
FileUtil, DateUtils,
|
||||
JvThumbViews, JvResources;
|
||||
JvThumbViews; //, JvResources;
|
||||
|
||||
constructor TJvThumbnail.Create(AOwner: TComponent);
|
||||
begin
|
||||
@ -329,7 +329,7 @@ procedure TJvThumbnail.GetFileInfo(AName: String);
|
||||
var
|
||||
{$IFDEF WINDOWS}
|
||||
info: TWin32FindDataW;
|
||||
dft: DWORD;
|
||||
dft: DWORD = 0;
|
||||
lft: TFileTime;
|
||||
H: THandle;
|
||||
ws: WideString;
|
||||
@ -340,12 +340,12 @@ var
|
||||
begin
|
||||
{$IFDEF WINDOWS}
|
||||
ws := UTF8Decode(AName);
|
||||
H := Windows.FindFirstFileW(PWideChar(ws), info);
|
||||
H := Windows.FindFirstFileW(PWideChar(ws), info{%H-});
|
||||
if H <> INVALID_HANDLE_VALUE then
|
||||
begin
|
||||
Windows.FindClose(H);
|
||||
//fdFileAccessed
|
||||
FileTimeToLocalFileTime(info.ftLastAccessTime, lft);
|
||||
FileTimeToLocalFileTime(info.ftLastAccessTime, lft{%H-});
|
||||
FileTimeToDosDateTime(lft, LongRec(dft).Hi, LongRec(dft).Lo);
|
||||
try
|
||||
FDFileAccessed := FileDateToDateTime(dft);
|
||||
|
@ -41,7 +41,7 @@ Known Issues:
|
||||
unit JvTimeLine;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{$WARN 5024 off : Parameter "$1" not used}
|
||||
interface
|
||||
|
||||
uses
|
||||
@ -189,7 +189,7 @@ type
|
||||
FList: TList;
|
||||
FBmp: TBitmap;
|
||||
FYearWidth: TJvYearWidth;
|
||||
FBorderStyle: TBorderStyle;
|
||||
// FBorderStyle: TBorderStyle;
|
||||
FUpdate: Integer;
|
||||
FMonthWidth: Extended;
|
||||
FTopOffset: Integer;
|
||||
@ -218,7 +218,8 @@ type
|
||||
FImages: TCustomImageList;
|
||||
FYearFont: TFont;
|
||||
FSelectedItem: TJvTimeItem;
|
||||
FYearList: TList;
|
||||
//FYearList: TList;
|
||||
FYearList: array of Integer;
|
||||
FImageChangeLink: TChangeLink;
|
||||
FOnVertScroll: TScrollEvent;
|
||||
FOnHorzScroll: TScrollEvent;
|
||||
@ -237,7 +238,7 @@ type
|
||||
FCanvas: TControlCanvas;
|
||||
FAutoDrag: Boolean;// automatic (or allowed) drag start
|
||||
FDragImages: TDragImageList;
|
||||
FDragItem: TJvTimeItem;
|
||||
// FDragItem: TJvTimeItem;
|
||||
FStartPos: TPoint;
|
||||
FStates: TJvTimeLineStates;
|
||||
FRangeAnchor: TJvTimeItem;
|
||||
@ -248,7 +249,7 @@ type
|
||||
procedure SetHelperYears(Value: Boolean);
|
||||
procedure SetFlat(Value: Boolean);
|
||||
procedure SetScrollArrows(Value: TJvScrollArrows);
|
||||
procedure SetBorderStyle(Value: TBorderStyle);
|
||||
// procedure SetBorderStyle(Value: TBorderStyle);
|
||||
procedure SetYearFont(Value: TFont);
|
||||
procedure SetYearWidth(Value: TJvYearWidth);
|
||||
procedure SetFirstDate(Value: TDate);
|
||||
@ -271,7 +272,7 @@ type
|
||||
|
||||
procedure CNKeyDown(var Msg: TLMKeyDown); message CN_KEYDOWN;
|
||||
procedure WMNCCalcSize(var Msg: TLMNCCalcSize); message LM_NCCALCSIZE;
|
||||
procedure WMNCPaint(var Msg: TLMessage); message LM_NCPAINT;
|
||||
// procedure WMNCPaint(var Msg: TLMessage); message LM_NCPAINT;
|
||||
procedure WMCancelMode(var Msg: TLMessage); message LM_CANCELMODE;
|
||||
procedure CMEnter(var Msg: TLMessage); message CM_ENTER;
|
||||
procedure CMExit(var Msg: TLMessage); message CM_EXIT;
|
||||
@ -290,7 +291,7 @@ type
|
||||
procedure DrawRightItemHint(ACanvas: TCanvas);
|
||||
procedure DrawScrollButtons;
|
||||
procedure DoYearFontChange(Sender: TObject);
|
||||
procedure DoDragOver(Source: TDragObject; X, Y: Integer; CanDrop: Boolean);
|
||||
procedure DoDragOver({%H-}Source: TDragObject; X, Y: Integer; {%H-}CanDrop: Boolean);
|
||||
function HasItemsToLeft: Boolean;
|
||||
function HasItemsToRight: Boolean;
|
||||
procedure SetHorzSupport(const Value: Boolean);
|
||||
@ -302,8 +303,7 @@ type
|
||||
procedure HandleClickSelection(LastFocused, NewItem: TJvTimeItem;
|
||||
Shift: TShiftState);
|
||||
function HasMoved(P: TPoint): Boolean;
|
||||
function GetHint: string;
|
||||
procedure SetHint(const Value: TTranslateString);
|
||||
// function GetHint: string;
|
||||
procedure SetShowSelection(const Value: Boolean);
|
||||
procedure SetSupportsColor(const Value: TColor);
|
||||
protected
|
||||
@ -343,6 +343,7 @@ type
|
||||
function GetDragImages: TDragImageList; override;
|
||||
property Align default alTop;
|
||||
property Color default clWindow;
|
||||
procedure SetHint(const Value: TTranslateString); override;
|
||||
|
||||
{ new properties }
|
||||
property Year: Word read GetYear write SetYear;
|
||||
@ -350,15 +351,17 @@ type
|
||||
property Selected: TJvTimeItem read FSelectedItem write SetSelectedItem;
|
||||
property ShowHiddenItemHints: Boolean read FShowHiddenItemHints write
|
||||
SetShowHiddenItemHints default True;
|
||||
{
|
||||
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle
|
||||
default bsSingle;
|
||||
}
|
||||
property DragLine: Boolean read FDragLine write FDragLine default True;
|
||||
property ShowItemHint: Boolean read FShowItemHint write FShowItemHint default False;
|
||||
property AutoSize: Boolean read FAutoSize write SetAutoSize default False;
|
||||
property HelperYears: Boolean read FHelperYears write SetHelperYears default True;
|
||||
property MultiSelect: Boolean read FMultiSelect write SetMultiSelect default False;
|
||||
property Flat: Boolean read FFlat write SetFlat default False;
|
||||
property Hint: TTranslateString read GetHint write SetHint;
|
||||
// property Hint: TTranslateString read GetHint write SetHint;
|
||||
property YearFont: TFont read FYearFont write SetYearFont;
|
||||
property YearWidth: TJvYearWidth read FYearWidth write SetYearWidth default 140;
|
||||
property TopOffset: Integer read FTopOffset write SetTopOffset default 21;
|
||||
@ -416,73 +419,72 @@ type
|
||||
property Selected;
|
||||
published
|
||||
property Align;
|
||||
property AutoSize;
|
||||
property BorderStyle;
|
||||
property Color;
|
||||
property Cursor;
|
||||
property DoubleBuffered default True;
|
||||
property DragCursor;
|
||||
property DragLine;
|
||||
property DragMode;
|
||||
property DoubleBuffered default True;
|
||||
property Enabled;
|
||||
property FirstVisibleDate;
|
||||
property Flat;
|
||||
property Font;
|
||||
property Height;
|
||||
property HelperYears;
|
||||
property ShowSelection;
|
||||
property Hint;
|
||||
property HorzSupports;
|
||||
property Images;
|
||||
// property ItemAlign;
|
||||
property ItemHeight;
|
||||
property Items;
|
||||
property Left;
|
||||
property MultiSelect;
|
||||
property PopupMenu;
|
||||
property ParentShowHint;
|
||||
property ShowHint;
|
||||
property Top;
|
||||
property Visible;
|
||||
property Width;
|
||||
property Font;
|
||||
property ScrollArrows;
|
||||
property TabStop;
|
||||
property ShowDays;
|
||||
property ShowHiddenItemHints;
|
||||
property ShowHint;
|
||||
property ShowItemHint;
|
||||
property ShowMonthNames;
|
||||
property ShowSelection;
|
||||
property Style;
|
||||
property SupportsColor;
|
||||
property TabOrder;
|
||||
property TabStop;
|
||||
property Top;
|
||||
property TopLevel;
|
||||
property TopOffset;
|
||||
property Visible;
|
||||
property YearFont;
|
||||
property YearWidth;
|
||||
property VertSupports;
|
||||
property Width;
|
||||
property OnClick;
|
||||
property OnDblClick;
|
||||
property OnDragDrop;
|
||||
property OnDragOver;
|
||||
property OnDrawItem;
|
||||
property OnEndDrag;
|
||||
property OnHorzScroll;
|
||||
property OnItemClick;
|
||||
property OnItemDblClick;
|
||||
property OnItemMouseMove;
|
||||
property OnItemMoved;
|
||||
property OnItemMoving;
|
||||
property OnLoadItem;
|
||||
property OnMeasureItem;
|
||||
property OnMouseDown;
|
||||
property OnMouseUp;
|
||||
property OnMouseMove;
|
||||
property OnMouseEnter;
|
||||
property OnMouseLeave;
|
||||
property OnDblClick;
|
||||
property OnClick;
|
||||
|
||||
property BorderStyle;
|
||||
property AutoSize;
|
||||
property DragCursor;
|
||||
property DragMode;
|
||||
property OnEndDrag;
|
||||
property OnStartDrag;
|
||||
property OnDragOver;
|
||||
property OnDragDrop;
|
||||
property MultiSelect;
|
||||
property Flat;
|
||||
property YearFont;
|
||||
property YearWidth;
|
||||
property TopOffset;
|
||||
property ShowDays;
|
||||
property ShowHiddenItemHints;
|
||||
property ShowItemHint;
|
||||
property ShowMonthNames;
|
||||
property FirstVisibleDate;
|
||||
property Images;
|
||||
property Items;
|
||||
property ItemHeight;
|
||||
// property ItemAlign;
|
||||
property VertSupports;
|
||||
property HorzSupports;
|
||||
property SupportsColor;
|
||||
property Style;
|
||||
property TopLevel;
|
||||
property OnItemClick;
|
||||
property OnItemDblClick;
|
||||
property OnSize;
|
||||
property OnHorzScroll;
|
||||
property OnVertScroll;
|
||||
property OnDrawItem;
|
||||
property OnMeasureItem;
|
||||
property OnSaveItem;
|
||||
property OnLoadItem;
|
||||
property OnItemMoved;
|
||||
property OnItemMouseMove;
|
||||
property OnItemMoving;
|
||||
property OnSize;
|
||||
property OnStartDrag;
|
||||
property OnVertScroll;
|
||||
end;
|
||||
|
||||
|
||||
@ -537,7 +539,7 @@ function RectInRect(const Rect1, Rect2: TRect): Boolean;
|
||||
var
|
||||
R: TRect;
|
||||
begin
|
||||
Result := IntersectRect(R, Rect1, Rect2);
|
||||
Result := IntersectRect(R{%H-}, Rect1, Rect2);
|
||||
end;
|
||||
|
||||
|
||||
@ -1079,9 +1081,10 @@ begin
|
||||
FHelperYears := True;
|
||||
ControlStyle := [csOpaque, csClickEvents, csDoubleClicks,
|
||||
csCaptureMouse, csDisplayDragImage];
|
||||
FBorderStyle := bsSingle;
|
||||
// FBorderStyle := bsSingle;
|
||||
Color := clWhite;
|
||||
FYearList := TList.Create;
|
||||
SetLength(FYearList, 0);
|
||||
// FYearList := TList.Create;
|
||||
FScrollArrows := [scrollLeft..scrollDown];
|
||||
FSupportLines := False;
|
||||
FTopOffset := 21;
|
||||
@ -1114,9 +1117,10 @@ end;
|
||||
|
||||
destructor TJvCustomTimeLine.Destroy;
|
||||
begin
|
||||
SetLength(FYearList, 0);
|
||||
FDragImages.Free;
|
||||
FCanvas.Free;
|
||||
FYearList.Free;
|
||||
// FYearList.Free;
|
||||
FBmp.Free;
|
||||
FList.Free;
|
||||
FTimeItems.Free;
|
||||
@ -1201,7 +1205,7 @@ begin
|
||||
FArrows[scrollDown].Visible :=
|
||||
(scrollDown in ScrollArrows) and (FNewHeight >= Height) and not AutoSize ;
|
||||
end;
|
||||
|
||||
{
|
||||
procedure TJvCustomTimeLine.SetBorderStyle(Value: TBorderStyle);
|
||||
begin
|
||||
inherited;
|
||||
@ -1215,7 +1219,7 @@ begin
|
||||
// RecreateWnd; -- wp: Invalidate instead of RecreateWnd
|
||||
end;
|
||||
end;
|
||||
|
||||
}
|
||||
|
||||
procedure TJvCustomTimeLine.SetTopLevel(Value: Integer);
|
||||
begin
|
||||
@ -1810,7 +1814,8 @@ var
|
||||
begin
|
||||
if csDestroying in ComponentState then
|
||||
Exit;
|
||||
FYearList.Clear;
|
||||
SetLength(FYearList, 0);
|
||||
// FYearList.Clear;
|
||||
UpdateOffset;
|
||||
{ draw the top horizontal line }
|
||||
with ACanvas do
|
||||
@ -1850,7 +1855,9 @@ begin
|
||||
end
|
||||
else
|
||||
begin { this is a new year }
|
||||
FYearList.Add(Pointer(I));
|
||||
SetLength(FYearList, Length(FYearList)+1);
|
||||
FYearList[High(FYearList)] := I;
|
||||
// FYearList.Add(Pointer(PtrInt(I)));
|
||||
if FirstYear then
|
||||
begin
|
||||
fYr := Y;
|
||||
@ -1884,9 +1891,11 @@ begin
|
||||
DrawText(ACanvas.Handle, PChar(aShadowRight), -1, R,
|
||||
DT_VCENTER or DT_SINGLELINE);
|
||||
end;
|
||||
for I := 0 to FYearList.Count - 1 do
|
||||
// for I := 0 to FYearList.Count - 1 do
|
||||
for I := 0 to High(FYearList)do
|
||||
begin
|
||||
DrawYear(ACanvas, Integer(FYearList[I]), IntToStr(fYr));
|
||||
DrawYear(ACanvas, FYearList[i], IntToStr(fYr));
|
||||
// DrawYear(ACanvas, Integer(FYearList[I]), IntToStr(fYr));
|
||||
Inc(fYr);
|
||||
end;
|
||||
if HorzSupports then
|
||||
@ -2212,7 +2221,7 @@ end;
|
||||
procedure TJvCustomTimeLine.LoadFromStream(Stream: TStream);
|
||||
var
|
||||
I: Integer;
|
||||
Ch: AnsiChar;
|
||||
Ch: AnsiChar = #0;
|
||||
S: string;
|
||||
UTF8Str: AnsiString;
|
||||
Item: TJvTimeItem;
|
||||
@ -2393,7 +2402,7 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
end;
|
||||
|
||||
(*
|
||||
procedure TJvCustomTimeLine.WMNCPaint(var Msg: TLMessage);
|
||||
var
|
||||
DC: HDC;
|
||||
@ -2405,7 +2414,6 @@ var
|
||||
begin
|
||||
if csDestroying in ComponentState then
|
||||
Exit;
|
||||
(*
|
||||
ACanvas := TCanvas.Create;
|
||||
{ Get window DC that is clipped to the non-client area }
|
||||
DC := GetWindowDC(Handle);
|
||||
@ -2446,9 +2454,8 @@ begin
|
||||
ReleaseDC(Handle, DC);
|
||||
ACanvas.Free;
|
||||
end;
|
||||
*)
|
||||
end;
|
||||
|
||||
*)
|
||||
procedure TJvCustomTimeLine.WMNCCalcSize(var Msg: TLMNCCalcSize);
|
||||
begin
|
||||
InflateRect(Msg.CalcSize_Params^.rgrc[0], -2, -2);
|
||||
@ -2479,7 +2486,7 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
{ -------- FIXME !!!
|
||||
(* -------- FIXME !!!
|
||||
procedure TJvCustomTimeLine.CMDrag(var Msg: TCMDrag);
|
||||
var
|
||||
P: TPoint;
|
||||
@ -2559,7 +2566,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
}
|
||||
*)
|
||||
|
||||
procedure TJvCustomTimeLine.SetAutoSize(Value: Boolean);
|
||||
begin
|
||||
@ -2694,7 +2701,7 @@ end;
|
||||
procedure TJvCustomTimeLine.DblClick;
|
||||
var
|
||||
Tmp: Boolean;
|
||||
P: TPoint;
|
||||
P: TPoint = (X:0; Y:0);
|
||||
begin
|
||||
Tmp := DragLine;
|
||||
try
|
||||
@ -2717,7 +2724,7 @@ end;
|
||||
|
||||
procedure TJvCustomTimeLine.Click;
|
||||
var
|
||||
P: TPoint;
|
||||
P: TPoint = (X: 0; Y: 0);
|
||||
begin
|
||||
inherited Click;
|
||||
if GetCursorPos(P) then
|
||||
@ -2857,9 +2864,9 @@ end;
|
||||
function TJvCustomTimeLine.GetDragImages: TDragImageList;
|
||||
var
|
||||
Bmp: TBitmap;
|
||||
P: TPoint;
|
||||
P: TPoint = (X:0; Y:0);
|
||||
R: TRect;
|
||||
H: Integer;
|
||||
H: Integer = 0;
|
||||
begin
|
||||
GetCursorPos(P);
|
||||
P := ScreenToClient(P);
|
||||
@ -2903,12 +2910,12 @@ begin
|
||||
// Application.ActivateHint(ClientToScreen(Point(X,Y)));
|
||||
end;
|
||||
end;
|
||||
|
||||
{
|
||||
function TJvCustomTimeLine.GetHint: string;
|
||||
begin
|
||||
Result := inherited Hint;
|
||||
end;
|
||||
|
||||
}
|
||||
procedure TJvCustomTimeLine.SetHint(const Value: TTranslateString);
|
||||
begin
|
||||
inherited Hint := Value;
|
||||
|
Reference in New Issue
Block a user