⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvtfdays.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  published
    property Color: TColor read FColor write SetColor default clBlue;
    property Width: Integer read FWidth write SetWidth default 5;
    property Visible: Boolean read FVisible write SetVisible default True;
    property TimeStampStyle: TJvTFTimeStampStyle read FTimeStampStyle
      write SetTFTimeStampStyle default tssBlock;
    property TimeStampColor: TColor read FTimeStampColor
      write SetTimeStampColor default clBlue;
  end;

  TJvTFDaysApptAttr = class(TPersistent)
  private
    FColor: TColor;
    FFont: TFont;
    FParentFont: Boolean;
    FFrameColor: TColor;
    FFrameWidth: Integer;
    procedure SetColor(Value: TColor);
    procedure SetFont(Value: TFont);
    procedure SetParentFont(Value: Boolean);
    procedure SetFrameColor(Value: TColor);
    procedure SetFrameWidth(Value: Integer);
  protected
    FApptGrid: TJvTFDays;
    procedure Change; virtual;
    procedure FontChange(Sender: TObject); virtual;
  public
    constructor Create(AApptGrid: TJvTFDays);
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    procedure ParentFontChanged; virtual;
  published
    property Color: TColor read FColor write SetColor;
    property Font: TFont read FFont write SetFont;
    property ParentFont: Boolean read FParentFont write SetParentFont default True;
    property FrameColor: TColor read FFrameColor write SetFrameColor default clBlack;
    property FrameWidth: Integer read FFrameWidth write SetFrameWidth default 1;
  end;

  TJvTFSelCellStyle = (scsSolid, scsFrame, scsCombo);

  TJvTFSelCellAttr = class(TPersistent)
  private
    FColor: TColor;
    FFrameWidth: Integer;
    FStyle: TJvTFSelCellStyle;
    procedure SetColor(Value: TColor);
    procedure SetFrameWidth(Value: Integer);
    procedure SetStyle(Value: TJvTFSelCellStyle);
  protected
    FApptGrid: TJvTFDays;
    procedure Change; virtual;
  public
    constructor Create(AApptGrid: TJvTFDays);
    procedure Assign(Source: TPersistent); override;
  published
    property Color: TColor read FColor write SetColor default clNavy;
    property FrameWidth: Integer read FFrameWidth write SetFrameWidth default 2;
    property Style: TJvTFSelCellStyle read FStyle write SetStyle default scsSolid;
  end;

  TJvTFGrabStyle = (gs3D, gsFlat);

  TJvTFDaysGrabHandles = class(TPersistent)
  private
    FColor: TColor;
    FHeight: Integer;
    FStyle: TJvTFGrabStyle;
    procedure SetColor(Value: TColor);
    procedure SetHeight(Value: Integer);
    procedure SetStyle(Value: TJvTFGrabStyle);
  protected
    FApptGrid: TJvTFDays;
    procedure Change; virtual;
    property Style: TJvTFGrabStyle read FStyle write SetStyle default gsFlat;
  public
    constructor Create(AApptGrid: TJvTFDays);
    procedure Assign(Source: TPersistent); override;
  published
    property Height: Integer read FHeight write SetHeight default 6;
    property Color: TColor read FColor write SetColor default clBlue;
  end;

  TJvTFDaysApptDrawInfo = class(TObject)
  private
    FColor: TColor;
    FFrameColor: TColor;
    FFrameWidth: Integer;
    FFont: TFont;
    FVisible: Boolean;
    procedure SetColor(Value: TColor);
    procedure SetFrameColor(Value: TColor);
    procedure SetFont(Value: TFont);
    procedure SetFrameWidth(const Value: Integer);
    procedure SetVisible(Value: Boolean);
  public
    constructor Create;
    destructor Destroy; override;
  published
    property Color: TColor read FColor write SetColor;
    property FrameColor: TColor read FFrameColor write SetFrameColor;
    property FrameWidth: Integer read FFrameWidth write SetFrameWidth;
    property Font: TFont read FFont write SetFont;
    property Visible: Boolean read FVisible write SetVisible;
  end;

  TJvTFGetDaysApptDrawInfoEvent = procedure(Sender: TObject; Appt: TJvTFAppt;
    DrawInfo: TJvTFDaysApptDrawInfo) of object;

  TDynPointArray = array of TPoint;
  TDynIntArray = array of Integer;

  TJvTFDaysGrouping = (grNone, grDate, grResource, grCustom);

  TJvTFAutoScrollDir = (asdUp, asdDown, asdLeft, asdRight, asdNowhere);

  TJvTFDays = class(TJvTFControl)
  private
   // internal stuff
    FBorderStyle: TBorderStyle;
    FHitTest: TPoint;
    FVisibleScrollBars: TJvTFVisibleScrollBars;
    FDitheredBackground: Boolean;

   // row, col layout
    FGranularity: Integer;
    FColHdrHeight: Integer;
    FRowHdrWidth: Integer;
    FRowHeight: Integer;
    FMinRowHeight: Integer;
    FDefColWidth: Integer;
    FMinColWidth: Integer;
    FAutoSizeCols: Boolean;
    FColTitleStyle: TJvTFColTitleStyle;
    FGroupHdrHeight: Integer;

    FCols: TJvTFDaysCols;
    FTemplate: TJvTFDaysTemplate;

    FTopRow: Integer;
    FFocusedRow: Integer;
    FLeftCol: Integer;
    FFocusedCol: Integer;
    FGrouping: TJvTFDaysGrouping;

    FGridStartTime: TTime;
    FGridEndTime: TTime;

    {$IFDEF Jv_TIMEBLOCKS}
   // ok
    FTimeBlockProps: TJvTFDaysBlockProps;
    FTimeBlocks: TJvTFDaysTimeBlocks;
    {$ENDIF Jv_TIMEBLOCKS}

   // visual appearance attr's
    FHdrAttr: TJvTFDaysHdrAttr;
    FSelHdrAttr: TJvTFDaysHdrAttr;
    FApptAttr: TJvTFDaysApptAttr;
    FSelApptAttr: TJvTFDaysApptAttr;
    FFancyRowHdrAttr: TJvTFDaysFancyRowHdrAttr;
    FSelFancyRowHdrAttr: TJvTFDaysFancyRowHdrAttr;
    FRowHdrType: TJvTFRowHdrType;
    FSelCellAttr: TJvTFSelCellAttr;
    FApptBar: TJvTFDaysApptBar;
    FApptBuffer: Integer;
    FGridLineColor: TColor;
    FGrabHandles: TJvTFDaysGrabHandles;
    FThresholds: TJvTFDaysThresholds;
    FPrimeTime: TJvTFDaysPrimeTime;
    FGroupHdrAttr: TJvTFDaysHdrAttr;
    FSelGroupHdrAttr: TJvTFDaysHdrAttr;

    FOptions: TJvTFDaysOptions;
    FEditor: TJvTFInPlaceApptEditor;
    FHintProps: TJvTFHintProps;

    {$IFDEF Jv_TIMEBLOCKS}
   // ok
    FWeekend: TTFDaysOfWeek;
    FWeekendColor: TColor;
    {$ENDIF Jv_TIMEBLOCKS}

   // Row/Col Sizing/Moving Events
    FOnSizeCol: TJvTFDragRowColEvent;
    FOnSizeRow: TJvTFDragRowColEvent;
    FOnSizeColHdr: TJvTFDragRowColEvent;
    FOnSizeRowHdr: TJvTFDragRowColEvent;
    FOnMoveCol: TJvTFDragRowColEvent;

   // Appt mouse events
    FOnSelectingAppt: TJvTFVarApptEvent;
    FOnSelectAppt: TJvTFSelecTJvTFApptEvent;
    FOnSelectedAppt: TNotifyEvent;
    FOnSizeAppt: TJvTFSizeApptEvent;
    FOnDropAppt: TJvTFDropApptEvent;

   // Drawing events
    FOnDrawAppt: TJvTFDrawApptEvent;
    FOnDrawApptBar: TJvTFDrawApptBarEvent;
    FOnDrawCorner: TJvTFDrawCornerEvent;
    FOnDrawColHdr: TJvTFDrawHdrEvent;
    FOnDrawDataCell: TJvTFDrawDataCellEvent;
    FOnDrawGrabHandle: TJvTFDrawGrabHandleEvent;
    FOnDrawMajorRowHdr: TJvTFDrawHdrEvent;
    FOnDrawMinorRowHdr: TJvTFDrawHdrEvent;
    FOnDrawRowHdr: TJvTFDrawHdrEvent;
   //FOnUpdateColTitle: TJvTFUpdateTitleEvent;
    FOnUpdateColTitles: TJvTFUpdateTitlesEvent;
    FOnDrawGroupHdr: TJvTFDrawHdrEvent;
    FOnShadeCell: TJvTFShadeCellEvent;
    FOnGetApptDrawInfo: TJvTFGetDaysApptDrawInfoEvent;

   // editor events
    FOnFailEditor: TJvTFFailEditorEvent;
    FOnCreateQuickEntry: TJvTFCreateQuickEntryEvent;
    FOnQuickEntry: TNotifyEvent;
    FOnBeginEdit: TJvTFBeginEditEvent;

   // navigation events
    FOnInsertAppt: TNotifyEvent;
    FOnInsertSchedule: TNotifyEvent;
    FOnDeleteAppt: TNotifyEvent;
    FOnDeleteSchedule: TNotifyEvent;
    FOnDateChanging: TJvTFDateChangingEvent;
    FOnDateChanged: TNotifyEvent;
    FOnGranularityChanging: TJvTFGranChangingEvent;
    FOnGranularityChanged: TNotifyEvent;
    FOnFocusedRowChanged: TNotifyEvent;
    FOnFocusedColChanged: TNotifyEvent;
    FShowFocus: Boolean;

    {$IFDEF VCL}
    // internal stuff
    procedure CMCtl3DChanged(var Msg: TMessage); message CM_CTL3DCHANGED;
    procedure WMGetDlgCode(var Msg: TWMGetDlgCode); message WM_GETDLGCODE;
    {$ENDIF VCL}
    procedure SetBorderStyle(Value: TBorderStyle);
    procedure SetTFVisibleScrollBars(Value: TJvTFVisibleScrollBars);
    procedure AlignScrollBars;
    function CheckSBVis: Boolean;
    procedure SetOnShowHint(Value: TJvTFShowHintEvent);
    function GetOnShowHint: TJvTFShowHintEvent;
    {$IFDEF Jv_TIMEBLOCKS}
    // ok
    procedure UpdateWeekendFillPic;
    {$ENDIF Jv_TIMEBLOCKS}

   // row, col layout
    procedure SetGranularity(Value: Integer);
    procedure SetColHdrHeight(Value: Integer);
    procedure SetRowHdrWidth(Value: Integer);
    procedure SetRowHeight(Value: Integer);
    procedure SetMinRowHeight(Value: Integer);
    procedure SetMinColWidth(Value: Integer);
    procedure SetAutoSizeCols(Value: Boolean);
    procedure SetTFColTitleStyle(Value: TJvTFColTitleStyle);

    procedure SetCols(Value: TJvTFDaysCols);

    procedure SetTopRow(Value: Integer);
    procedure SetFocusedRow(Value: Integer);
    function GetFocusedRow: Integer;
    procedure SetLeftCol(Value: Integer);
    procedure SetFocusedCol(Value: Integer);
    function GetFocusedCol: Integer;
    procedure SetGrouping(Value: TJvTFDaysGrouping);
    procedure SetGroupHdrHeight(Value: Integer);

    procedure SetGridStartTime(Value: TTime);
    procedure SetGridEndTime(Value: TTime);

    {$IFDEF Jv_TIMEBLOCKS}
   // ok
    procedure SetTimeBlockProps(Value: TJvTFDaysBlockProps);
   // ok
    procedure SetTimeBlocks(Value: TJvTFDaysTimeBlocks);
    {$ENDIF Jv_TIMEBLOCKS}

   // visual appearance attr's
    procedure SetHdrAttr(Value: TJvTFDaysHdrAttr);
    procedure SetSelHdrAttr(Value: TJvTFDaysHdrAttr);
    procedure SetApptAttr(Value: TJvTFDaysApptAttr);
    procedure SetSelApptAttr(Value: TJvTFDaysApptAttr);
    procedure SetFancyRowHdrAttr(Value: TJvTFDaysFancyRowHdrAttr);
    procedure SetSelFancyRowHdrAttr(Value: TJvTFDaysFancyRowHdrAttr);
    procedure SetTFRowHdrType(Value: TJvTFRowHdrType);
    procedure SetTFSelCellAttr(Value: TJvTFSelCellAttr);
    procedure SetApptBar(Value: TJvTFDaysApptBar);
    procedure SetApptBuffer(Value: Integer);
    procedure SetGridLineColor(Value: TColor);
    procedure SetGrabHandles(Value: TJvTFDaysGrabHandles);
    procedure SetGroupHdrAttr(Value: TJvTFDaysHdrAttr);
    procedure SetSelGroupHdrAttr(Value: TJvTFDaysHdrAttr);

    procedure SetOptions(Value: TJvTFDaysOptions);
    procedure SetTFHintProps(Value: TJvTFHintProps);
    procedure DrawDither(ACanvas: TCanvas; ARect: TRect; Color1, Color2: TColor);

    {$IFDEF Jv_TIMEBLOCKS}
   // ok
    procedure SetWeekend(Value: TTFDaysOfWeek);
   // ok
    procedure SetWeekendColor(Value: TColor);
    procedure SetDitheredBackground(const Value: Boolean);
    procedure SetShowFocus(const Value: Boolean);
    {$ENDIF Jv_TIMEBLOCKS}
  protected
    FState: TJvTFDaysState;
    FHint: TJvTFHint;
    FNeedCheckSBParams: Boolean;
    PaintBuffer: TBitmap;
    {$IFDEF Jv_TIMEBLOCKS}
   // ok
    FWeekendFillPic: TBitmap;
    {$ENDIF Jv_TIMEBLOCKS}

    FBeginDraggingCoord: TJvTFDaysCoord;
    FDraggingCoord: TJvTFDaysCoord;

    FSelAppt: TJvTFAppt;
    FSelStart: TPoint;
    FSelEnd: TPoint;
    FFromToSel: Boolean;
    FSaveFocCol: Integer;

    FHScrollBar: TJvTFDaysScrollBar;
    FVScrollBar: TJvTFDaysScrollBar;

    FAutoScrollDir: TJvTFAutoScrollDir;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -