📄 jvtfdays.pas
字号:
FDetailHeight: Integer;
FDetailWidth: Integer;
FEditHeight: Integer;
FEditWidth: Integer;
FTextHeight: Integer;
FTextWidth: Integer;
FDropTextFirst: Boolean;
FPicsAllOrNone: Boolean;
FWholePicsOnly: Boolean;
procedure SetDetailHeight(Value: Integer);
procedure SetDetailWidth(Value: Integer);
procedure SetEditHeight(Value: Integer);
procedure SetEditWidth(Value: Integer);
procedure SetTextHeight(Value: Integer);
procedure SetTextWidth(Value: Integer);
procedure SetDropTextFirst(Value: Boolean);
procedure SetPicsAllOrNone(Value: Boolean);
procedure SetWholePicsOnly(Value: Boolean);
protected
FApptGrid: TJvTFDays;
procedure Change; dynamic;
public
constructor Create(AOwner: TJvTFDays);
procedure Assign(Source: TPersistent); override;
published
property DetailHeight: Integer read FDetailHeight write SetDetailHeight default 10;
property DetailWidth: Integer read FDetailWidth write SetDetailWidth default 10;
property EditHeight: Integer read FEditHeight write SetEditHeight default 1;
property EditWidth: Integer read FEditWidth write SetEditWidth default 10;
property TextHeight: Integer read FTextHeight write SetTextHeight default 1;
property TextWidth: Integer read FTextWidth write SetTextWidth default 10;
property DropTextFirst: Boolean read FDropTextFirst write SetDropTextFirst default True;
property PicsAllOrNone: Boolean read FPicsAllOrNone write SetPicsAllOrNone default False;
property WholePicsOnly: Boolean read FWholePicsOnly write SetWholePicsOnly default True;
end;
TJvTFDaysScrollBar = class(TScrollBar)
protected
procedure CMDesignHitTest(var Msg: TCMDesignHitTest); message CM_DESIGNHITTEST;
procedure CreateWnd; override;
function GetLargeChange: Integer; virtual;
procedure SetLargeChange(Value: Integer); virtual;
procedure UpdateRange; virtual;
public
constructor Create(AOwner: TComponent); override;
published
property LargeChange: Integer read GetLargeChange write SetLargeChange default 1;
end;
//TJvTFUpdateTitleEvent = Procedure(Sender: TObject; Col: TJvTFDaysCol;
//var NewTitle: string) of object;
TJvTFUpdateTitlesEvent = procedure(Sender: TObject; Col: TJvTFDaysCol;
var NewGroupTitle, NewTitle: string) of object;
{$IFDEF Jv_TIMEBLOCKS}
// ok
TJvTFDaysTimeBlock = class(TCollectionItem)
private
FLength: Integer;
FTitle: string;
FName: string;
FAllowAppts: Boolean;
procedure SetLength(Value: Integer);
procedure SetTitle(const Value: string);
procedure SetName(const Value: string);
procedure SetAllowAppts(Value: Boolean);
function GetGridLength: Integer;
function GetBlockCollection: TJvTFDaysTimeBlocks;
protected
function GetDisplayName: string; override;
procedure Change;
public
constructor Create(Collection: TCollection); override;
procedure Assign(Source: TPersistent); override;
property BlockCollection: TJvTFDaysTimeBlocks read GetBlockCollection;
published
property AllowAppts: Boolean read FAllowAppts write SetAllowAppts default True;
property GridLength: Integer read GetGridLength;
property Length: Integer read FLength write SetLength default 1;
property Name: string read FName write SetName;
property Title: string read FTitle write SetTitle;
end;
// ok
TJvTFDaysTimeBlocks = class(TCollection)
private
FDaysControl: TJvTFDays;
function GetItem(Index: Integer): TJvTFDaysTimeBlock;
procedure SetItem(Index: Integer; Value: TJvTFDaysTimeBlock);
protected
function GetOwner: TPersistent; override;
public
constructor Create(ADaysControl: TJvTFDays);
function Add: TJvTFDaysTimeBlock;
property DaysControl: TJvTFDays read FDaysControl;
procedure Assign(Source: TPersistent); override;
property Items[Index: Integer]: TJvTFDaysTimeBlock read GetItem
write SetItem; default;
function BlockByName(const BlockName: string): TJvTFDaysTimeBlock;
function FindBlock(const BlockName: string): TJvTFDaysTimeBlock;
end;
// ok
TJvTFDaysBlockProps = class(TPersistent)
private
FBlockGran: Integer;
FDayStart: TTime;
FDaysControl: TJvTFDays;
FBlockHdrAttr: TJvTFDaysHdrAttr;
FSelBlockHdrAttr: TJvTFDaysHdrAttr;
FBlockHdrWidth: Integer;
FOffTimeColor: TColor;
FDataDivColor: TColor;
FSnapMove: Boolean;
FDrawOffTime: Boolean;
procedure SetBlockGran(Value: Integer);
procedure SetDayStart(Value: TTime);
procedure SetBlockHdrAttr(Value: TJvTFDaysHdrAttr);
procedure SetSelBlockHdrAttr(Value: TJvTFDaysHdrAttr);
procedure SetBlockHdrWidth(Value: Integer);
procedure SetOffTimeColor(Value: TColor);
procedure SetDataDivColor(Value: TColor);
procedure SetDrawOffTime(Value: Boolean);
public
constructor Create(ADaysControl: TJvTFDays);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
property DaysControl: TJvTFDays read FDaysControl;
procedure Change;
published
property BlockGran: Integer read FBlockGran write SetBlockGran default 60;
property BlockHdrAttr: TJvTFDaysHdrAttr read FBlockHdrAttr write SetBlockHdrAttr;
property BlockHdrWidth: Integer read FBlockHdrWidth write SetBlockHdrWidth default 50;
property DataDivColor: TColor read FDataDivColor write SetDataDivColor default clBlack;
property DayStart: TTime read FDayStart write SetDayStart;
property DrawOffTime: Boolean read FDrawOffTime write SetDrawOffTime default True;
property OffTimeColor: TColor read FOffTimeColor write SetOffTimeColor default clGray;
property SelBlockHdrAttr: TJvTFDaysHdrAttr read FSelBlockHdrAttr write SetSelBlockHdrAttr;
property SnapMove: Boolean read FSnapMove write FSnapMove default True;
end;
{$ENDIF Jv_TIMEBLOCKS}
TJvTFDaysCol = class(TCollectionItem)
private
FMap: TJvTFApptMap;
FNullSchedDate: Boolean;
FSchedDate: TDate;
FSchedName: string;
FSchedule: TJvTFSched;
FGroupTitle: string;
FTitle: string;
FWidth: Integer;
procedure SetSchedDate(Value: TDate);
procedure SetSchedName(const Value: string);
procedure SetGroupTitle(const Value: string);
procedure SetTitle(const Value: string);
procedure SetWidth(Value: Integer);
protected
FDisconnecting: Boolean;
function GetDisplayName: string; override;
procedure CheckTemplate;
procedure SetIndex(Value: Integer); override;
public
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
function ColCollection: TJvTFDaysCols;
property Schedule: TJvTFSched read FSchedule;
function Connected: Boolean;
procedure Connect;
procedure Disconnect;
procedure SetSchedule(const NewSchedName: string; NewSchedDate: TDate);
function LocateMapCol(Appt: TJvTFAppt; MapSearchRow: Integer): Integer;
function MapColCount(Row: Integer): Integer;
function MapLocation(Col, Row: Integer): TJvTFAppt;
procedure RefreshMap;
procedure CalcStartEndRows(Appt: TJvTFAppt; var StartRow, EndRow: Integer);
//procedure UpdateTitle;
procedure UpdateTitles;
function GetFirstAppt: TJvTFAppt;
function GetPrevAppt(RefAppt: TJvTFAppt): TJvTFAppt;
function GetNextAppt(RefAppt: TJvTFAppt): TJvTFAppt;
function GetLastAppt: TJvTFAppt;
procedure DumpMap;
function ApptInCol(Appt: TJvTFAppt): Boolean;
published
property SchedDate: TDate read FSchedDate write SetSchedDate;
property SchedName: string read FSchedName write SetSchedName;
property GroupTitle: string read FGroupTitle write SetGroupTitle;
property Title: string read FTitle write SetTitle;
property Width: Integer read FWidth write SetWidth;
end;
TJvTFDaysCols = class(TCollection)
private
FApptGrid: TJvTFDays;
FPrinter: TJvTFDaysPrinter;
FOldCount: Integer;
function GetItem(Index: Integer): TJvTFDaysCol;
procedure SetItem(Index: Integer; Value: TJvTFDaysCol);
protected
FAddingCol: Boolean;
FSizingCols: Boolean;
FUpdating: Boolean;
procedure EnsureCol(Index: Integer);
function GetOwner: TPersistent; override;
procedure SizeCols; virtual;
procedure Update(Item: TCollectionItem); override;
public
constructor Create(AApptGrid: TJvTFDays);
constructor CreateForPrinter(APrinter: TJvTFDaysPrinter);
property ApptGrid: TJvTFDays read FApptGrid;
property Printer: TJvTFDaysPrinter read FPrinter;
function Add: TJvTFDaysCol;
property AddingCol: Boolean read FAddingCol;
property Updating: Boolean read FUpdating;
procedure EnsureMinColWidth;
procedure EnsureMaxColWidth;
procedure ResizeCols;
property SizingCols: Boolean read FSizingCols;
procedure MoveCol(SourceIndex, TargetIndex: Integer);
procedure Assign(Source: TPersistent); override;
property Items[Index: Integer]: TJvTFDaysCol read GetItem write SetItem; default;
procedure UpdateTitles;
end;
TJvTFRowHdrType = (rhGrid, rhFancy);
TJvTFDaysFancyRowHdrAttr = class(TPersistent)
private
FColor: TColor;
FHr2400: Boolean;
FMinorFont: TFont;
FMajorFont: TFont;
FTickColor: TColor;
FOnlyShow00Minutes: Boolean;
procedure SetColor(Value: TColor);
procedure SetHr2400(Value: Boolean);
procedure SetMinorFont(Value: TFont);
procedure SetMajorFont(Value: TFont);
procedure SetTickColor(Value: TColor);
procedure SetOnlyShow00Minutes(Value: Boolean);
protected
FGrid: TJvTFDays;
procedure Change; virtual;
procedure FontChange(Sender: TObject); virtual;
public
constructor Create(AOwner: TJvTFDays);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property Color: TColor read FColor write SetColor default clBtnFace;
property Hr2400: Boolean read FHr2400 write SetHr2400;
property MinorFont: TFont read FMinorFont write SetMinorFont;
property MajorFont: TFont read FMajorFont write SetMajorFont;
property TickColor: TColor read FTickColor write SetTickColor default clGray;
property OnlyShow00Minutes: Boolean read FOnlyShow00Minutes write SetOnlyShow00Minutes
default True;
end;
TJvTFDaysHdrAttr = class(TPersistent)
private
FApptGrid: TJvTFDays;
FColor: TColor;
FFont: TFont;
FParentFont: Boolean;
FFrame3D: Boolean;
{$IFDEF Jv_TIMEBLOCKS}
// ok
FFrameColor: TColor;
FTitleRotation: Integer;
{$ENDIF Jv_TIMEBLOCKS}
procedure SetColor(Value: TColor);
procedure SetFont(Value: TFont);
procedure SetParentFont(Value: Boolean);
procedure SetFrame3D(Value: Boolean);
{$IFDEF Jv_TIMEBLOCKS}
// ok
procedure SetFrameColor(Value: TColor);
procedure SetTitleRotation(Value: Integer);
{$ENDIF Jv_TIMEBLOCKS}
protected
procedure Change;
procedure FontChange(Sender: TObject);
public
constructor Create(AOwner: TJvTFDays);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure ParentFontChanged;
published
property Color: TColor read FColor write SetColor default clBtnFace;
property Font: TFont read FFont write SetFont;
property ParentFont: Boolean read FParentFont write SetParentFont default True;
property Frame3D: Boolean read FFrame3D write SetFrame3D default True;
{$IFDEF Jv_TIMEBLOCKS}
// ok
property FrameColor: TColor read FFrameColor write SetFrameColor nodefault;
property TitleRotation: Integer read FTitleRotation write SetTitleRotation default 0;
{$ENDIF Jv_TIMEBLOCKS}
end;
TJvTFTimeStampStyle = (tssNone, tssFullI, tssHalfI, tssBlock);
TJvTFDaysApptBar = class(TPersistent)
private
FColor: TColor;
FVisible: Boolean;
FWidth: Integer;
FTimeStampStyle: TJvTFTimeStampStyle;
FTimeStampColor: TColor;
procedure SetColor(Value: TColor);
procedure SetVisible(Value: Boolean);
procedure SetWidth(Value: Integer);
procedure SetTFTimeStampStyle(Value: TJvTFTimeStampStyle);
procedure SetTimeStampColor(Value: TColor);
protected
FApptGrid: TJvTFDays;
procedure Change; virtual;
public
constructor Create(AApptGrid: TJvTFDays);
procedure Assign(Source: TPersistent); override;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -