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