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

📄 jvtfdays.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    property TimeBlockProps: TJvTFDaysBlockProps read FTimeBlockProps write SetTimeBlockProps;
    {$ENDIF Jv_TIMEBLOCKS}

   // visual appearance properties
    property ApptAttr: TJvTFDaysApptAttr read FApptAttr write SetApptAttr;
    property SelApptAttr: TJvTFDaysApptAttr read FSelApptAttr write SetSelApptAttr;
    property HdrAttr: TJvTFDaysHdrAttr read FHdrAttr write SetHdrAttr;
    property SelHdrAttr: TJvTFDaysHdrAttr read FSelHdrAttr write SetSelHdrAttr;
    property FancyRowHdrAttr: TJvTFDaysFancyRowHdrAttr read FFancyRowHdrAttr
      write SetFancyRowHdrAttr;
    property SelFancyRowHdrAttr: TJvTFDaysFancyRowHdrAttr
      read FSelFancyRowHdrAttr write SetSelFancyRowHdrAttr;
    property SelCellAttr: TJvTFSelCellAttr read FSelCellAttr write SetTFSelCellAttr;

    property ApptBar: TJvTFDaysApptBar read FApptBar write SetApptBar;
    property ApptBuffer: Integer read FApptBuffer write SetApptBuffer default 5;
    property ColTitleStyle: TJvTFColTitleStyle read FColTitleStyle
      write SetTFColTitleStyle default ctsSingleEllipsis;
    property GrabHandles: TJvTFDaysGrabHandles read FGrabHandles
      write SetGrabHandles;
    property GridLineColor: TColor read FGridLineColor write SetGridLineColor
      default clGray;
    property PrimeTime: TJvTFDaysPrimeTime read FPrimeTime write FPrimeTime;
    property RowHdrType: TJvTFRowHdrType read FRowHdrType write SetTFRowHdrType
      default rhFancy;
    property Thresholds: TJvTFDaysThresholds read FThresholds write FThresholds;
    property HintProps: TJvTFHintProps read FHintProps
      write SetTFHintProps;
    property GroupHdrAttr: TJvTFDaysHdrAttr read FGroupHdrAttr
      write SetGroupHdrAttr;
    property SelGroupHdrAttr: TJvTFDaysHdrAttr read FSelGroupHdrAttr
      write SetSelGroupHdrAttr;

    {$IFDEF Jv_TIMEBLOCKS}
   // ok
    property Weekend: TTFDaysOfWeek read FWeekend write SetWeekend
      default [dowSunday, dowSaturday];
    property WeekendColor: TColor read FWeekendColor write SetWeekendColor default clSilver;
    {$ENDIF Jv_TIMEBLOCKS}

   // navigation/selection properties
    property LeftCol: Integer read FLeftCol write SetLeftCol;
    property TopRow: Integer read FTopRow write SetTopRow default 0;

   // Drag/Drop events
    property OnDropAppt: TJvTFDropApptEvent read FOnDropAppt write FOnDropAppt;
    property OnSizeAppt: TJvTFSizeApptEvent read FOnSizeAppt write FOnSizeAppt;

   // Grid Layout events
    property OnSizeCol: TJvTFDragRowColEvent read FOnSizeCol write FOnSizeCol;
    property OnSizeRow: TJvTFDragRowColEvent read FOnSizeRow write FOnSizeRow;
    property OnSizeColHdr: TJvTFDragRowColEvent read FOnSizeColHdr write FOnSizeColHdr;
    property OnSizeRowHdr: TJvTFDragRowColEvent read FOnSizeRowHdr write FOnSizeRowHdr;
    property OnMoveCol: TJvTFDragRowColEvent read FOnMoveCol write FOnMoveCol;

    property OnDateChanging: TJvTFDateChangingEvent read FOnDateChanging
      write FOnDateChanging;
    property OnDateChanged: TNotifyEvent read FOnDateChanged write FOnDateChanged;
    property OnGranularityChanging: TJvTFGranChangingEvent read FOnGranularityChanging
      write FOnGranularityChanging;
    property OnGranularityChanged: TNotifyEvent read FOnGranularityChanged
      write FOnGranularityChanged;

   // Custom draw events
    property OnDrawAppt: TJvTFDrawApptEvent read FOnDrawAppt write FOnDrawAppt;
    property OnDrawApptBar: TJvTFDrawApptBarEvent read FOnDrawApptBar
      write FOnDrawApptBar;
    property OnDrawColHdr: TJvTFDrawHdrEvent read FOnDrawColHdr write FOnDrawColHdr;
    property OnDrawCorner: TJvTFDrawCornerEvent read FOnDrawCorner
      write FOnDrawCorner;
    property OnDrawDataCell: TJvTFDrawDataCellEvent read FOnDrawDataCell
      write FOnDrawDataCell;
    property OnDrawGrabHandle: TJvTFDrawGrabHandleEvent read FOnDrawGrabHandle
      write FOnDrawGrabHandle;
    property OnDrawMajorRowHdr: TJvTFDrawHdrEvent read FOnDrawMajorRowHdr
      write FOnDrawMajorRowHdr;
    property OnDrawMinorRowHdr: TJvTFDrawHdrEvent read FOnDrawMinorRowHdr
      write FOnDrawMinorRowHdr;
    property OnDrawRowHdr: TJvTFDrawHdrEvent read FOnDrawRowHdr write FOnDrawRowHdr;
    property OnDrawGroupHdr: TJvTFDrawHdrEvent read FOnDrawGroupHdr
      write FOnDrawGroupHdr;
    property OnShadeCell: TJvTFShadeCellEvent read FOnShadeCell write FOnShadeCell;
    property OnGetApptDrawInfo: TJvTFGetDaysApptDrawInfoEvent read FOnGetApptDrawInfo
      write FOnGetApptDrawInfo;

   // Input events
    property OnFailEditor: TJvTFFailEditorEvent read FOnFailEditor write FOnFailEditor;
    property OnInsertAppt: TNotifyEvent read FOnInsertAppt write FOnInsertAppt;
    property OnInsertSchedule: TNotifyEvent read FOnInsertSchedule
      write FOnInsertSchedule;
    property OnDeleteAppt: TNotifyEvent read FOnDeleteAppt write FOnDeleteAppt;
    property OnDeleteSchedule: TNotifyEvent read FOnDeleteSchedule
      write FOnDeleteSchedule;
    property OnCreateQuickEntry: TJvTFCreateQuickEntryEvent read FOnCreateQuickEntry
      write FOnCreateQuickEntry;
    property OnQuickEntry: TNotifyEvent read FOnQuickEntry write FOnQuickEntry;
    property OnBeginEdit: TJvTFBeginEditEvent read FOnBeginEdit write FOnBeginEdit;

   // Help and Hint events
    property OnShowHint: TJvTFShowHintEvent read GetOnShowHint
      write SetOnShowHint;

   // Misc events
    property OnSelectingAppt: TJvTFVarApptEvent read FOnSelectingAppt
      write FOnSelectingAppt;
    property OnSelectAppt: TJvTFSelecTJvTFApptEvent read FOnSelectAppt
      write FOnSelectAppt;
    property OnSelectedAppt: TNotifyEvent read FOnSelectedAppt
      write FOnSelectedAppt;
   //property OnUpdateColTitle: TJvTFUpdateTitleEvent read FOnUpdateColTitle
    //write FOnUpdateColTitle;
    property OnUpdateColTitles: TJvTFUpdateTitlesEvent read FOnUpdateColTitles
      write FOnUpdateColTitles;
    property OnFocusedRowChanged: TNotifyEvent read FOnFocusedRowChanged
      write FOnFocusedRowChanged;
    property OnFocusedColChanged: TNotifyEvent read FOnFocusedColChanged
      write FOnFocusedColChanged;

   //Inherited properties
    property DateFormat; // from TJvTFControl
    property TimeFormat; // from TJvTFControl
//     property Navigator; // from TJvTFControl
//     property OnNavigate; // from TJvTFControl

    property Align;
    property Color default clSilver;
    property ParentColor default False;
    property Font;
    property ParentFont;
    property TabStop;
    property TabOrder;
    property Anchors;
    property Constraints;
    property DragKind;
    property DragCursor;
    property DragMode;
    property Enabled;
    property ParentShowHint;
    property PopupMenu;
    property ShowHint;
    property Visible;

    property OnClick;
    property OnDblClick;
    property OnDragDrop;
    property OnDragOver;
    property OnEndDrag;
    property OnEnter;
    property OnExit;
    property OnKeyDown;
    property OnKeyPress;
    property OnKeyUp;
    property OnMouseDown;
    property OnMouseMove;
    property OnMouseUp;
    property OnMouseWheelDown;
    property OnMouseWheelUp;
    property OnEndDock;
    property OnStartDock;
    property OnStartDrag;
  end;

  TJvTFDaysPrinterPageLayout = class(TJvTFPrinterPageLayout)
  private
    FColsPerPage: Integer;
    FRowsPerPage: Integer;
    FAlwaysShowColHdr: Boolean;
    FAlwaysShowRowHdr: Boolean;
    procedure SetColsPerPage(Value: Integer);
    procedure SetRowsPerPage(Value: Integer);
    procedure SetAlwaysShowColHdr(Value: Boolean);
    procedure SetAlwaysShowRowHdr(Value: Boolean);
  public
    procedure Assign(Source: TPersistent); override;
  published
    property ColsPerPage: Integer read FColsPerPage write SetColsPerPage;
    property RowsPerPage: Integer read FRowsPerPage write SetRowsPerPage;
    property AlwaysShowColHdr: Boolean read FAlwaysShowColHdr
      write SetAlwaysShowColHdr;
    property AlwaysShowRowHdr: Boolean read FAlwaysShowRowHdr
      write SetAlwaysShowRowHdr;
  end;

  TJvTFDaysPageInfo = class
  private
    FPageNum: Integer;
    FStartRow: Integer;
    FEndRow: Integer;
    FStartCol: Integer;
    FEndCol: Integer;
    FRowHeight: Integer;
    FColWidth: Integer;
    FShowRowHdr: Boolean;
    FShowColHdr: Boolean;
  public
    property PageNum: Integer read FPageNum write FPageNum;
    property StartRow: Integer read FStartRow write FStartRow;
    property EndRow: Integer read FEndRow write FEndRow;
    property StartCol: Integer read FStartCol write FStartCol;
    property EndCol: Integer read FEndCol write FEndCol;
    property RowHeight: Integer read FRowHeight write FRowHeight;
    property ColWidth: Integer read FColWidth write FColWidth;
    property ShowRowHdr: Boolean read FShowRowHdr write FShowRowHdr;
    property ShowColHdr: Boolean read FShowColHdr write FShowColHdr;
  end;

  TJvTFDaysPrinter = class(TJvTFPrinter)
  private
    FApptCount: Integer;
    FApptAttr: TJvTFDaysApptAttr;
    FApptBar: TJvTFDaysApptBar;
    FApptBuffer: Integer;
    FColHdrHeight: Integer;
    FColor: TColor;
    FCols: TJvTFDaysCols;
    FColTitleStyle: TJvTFColTitleStyle;
    FFancyRowHdrAttr: TJvTFDaysFancyRowHdrAttr;
    FGranularity: Integer;
    FGridLineColor: TColor;
    FGroupHdrAttr: TJvTFDaysHdrAttr;
    FGroupHdrHeight: Integer;
    FGrouping: TJvTFDaysGrouping;
    FHdrAttr: TJvTFDaysHdrAttr;
    FMinColWidth: Integer;
    FMinRowHeight: Integer;
    FPrimeTime: TJvTFDaysPrimeTime;
    FRowHdrType: TJvTFRowHdrType;
    FRowHdrWidth: Integer;
    FRowHeight: Integer;
    FShowPics: Boolean;
    FShowText: Boolean;
    FFormattedDesc: Boolean;
    FThresholds: TJvTFDaysThresholds;
    FOnDrawCorner: TJvTFDrawCornerEvent;
   //FOnUpdateColTitle: TJvTFUpdateTitleEvent;
    FOnUpdateColTitles: TJvTFUpdateTitlesEvent;
    FOnDrawColHdr: TJvTFDrawHdrEvent;
    FOnDrawGroupHdr: TJvTFDrawHdrEvent;
    FOnDrawRowHdr: TJvTFDrawHdrEvent;
    FOnDrawMinorRowHdr: TJvTFDrawHdrEvent;
    FOnDrawMajorRowHdr: TJvTFDrawHdrEvent;
    FOnDrawDataCell: TJvTFDrawDataCellEvent;
    FOnDrawAppt: TJvTFDrawApptEvent;
    FOnDrawApptBar: TJvTFDrawApptBarEvent;
    FOnGetApptDrawInfo: TJvTFGetDaysApptDrawInfoEvent;
    FOnShadeCell: TJvTFShadeCellEvent;
    FOnApptProgress: TJvTFProgressEvent;
    FGridStartTime: TTime;
    FGridEndTime: TTime;
    procedure SetApptAttr(Value: TJvTFDaysApptAttr);
    procedure SetApptBar(Value: TJvTFDaysApptBar);
    procedure SetApptBuffer(Value: Integer);
    procedure SetColHdrHeight(Value: Integer);
    procedure SetColor(Value: TColor);
    procedure SetCols(Value: TJvTFDaysCols);
    procedure SetTFColTitleStyle(Value: TJvTFColTitleStyle);
    procedure SetFancyRowHdrAttr(Value: TJvTFDaysFancyRowHdrAttr);
    procedure SetGranularity(Value: Integer);
    procedure SetGridLineColor(Value: TColor);
    procedure SetGroupHdrAttr(Value: TJvTFDaysHdrAttr);
    procedure SetGroupHdrHeight(Value: Integer);
    procedure SetGrouping(Value: TJvTFDaysGrouping);
    procedure SetHdrAttr(Value: TJvTFDaysHdrAttr);
    procedure SetMinColWidth(Value: Integer);
    procedure SetMinRowHeight(Value: Integer);
    procedure SetPrimeTime(Value: TJvTFDaysPrimeTime);
    procedure SetTFRowHdrType(Value: TJvTFRowHdrType);
    procedure SetRowHdrWidth(Value: Integer);
    procedure SetRowHeight(Value: Integer);
    procedure SetShowPics(Value: Boolean);
    procedure SetShowText(Value: Boolean);
    procedure SetThresholds(Value: TJvTFDaysThresholds);
    procedure SetFormattedDesc(Value: Boolean);
    function GetApptCount: Integer;
    procedure SetGridStartTime(Value: TTime);
    procedure SetGridEndTime(Value: TTime);
  protected
    FPageInfoList: TStringList;
    FApptsDrawn: Integer;
    FValidPageInfo: Boolean;
    procedure SetMeasure(Value: TJvTFPrinterMeasure); override;
    procedure DrawBody(ACanvas: TCanvas; ARect: TRect; PageNum: Integer); override;

    procedure Loaded; override;

   // Drawing routines
    procedure DrawCorner(ACanvas: TCanvas);
    procedure DrawFrame(ACanvas: TCanvas; ARect: TRect; Draw3D: Boolean);
    procedure DrawEmptyColHdr(ACanvas: TCanvas; PageInfo: TJvTFDaysPageInfo);
   //procedure DrawColHdr(ACanvas: TCanvas; Index: Integer;
    //PageInfo: TJvTFDaysPageInfo);
    procedure DrawColGroupHdr(ACanvas: TCanvas; Index: Integer;
      PageInfo: TJvTFDaysPageInfo; IsGroupHdr: Boolean);
    procedure DrawRowHdr(ACanvas: TCanvas; Index: Integer;
      PageInfo: TJvTFDaysPageInfo);
    procedure DrawGroupHdrs(ACanvas: TCanvas; PageInfo: TJvTFDaysPageInfo);

    procedure DrawFancyRowHdrs(ACanvas: TCanvas; PageInfo: TJvTFDaysPageInfo);
    procedure DrawMinor(ACanvas: TCanvas; ARect: TRect; RowNum: Integer;
      const LabelStr: string; TickLength: Integer);
    function GetMinorLabel(RowNum: Integer; PageInfo: TJvTFDaysPageInfo): string;
    function GetMinorTickLength(ACanvas: TCanvas): Integer; virtual;
    function GetMajorTickLength: Integer; virtual;

    procedure DrawDataCell(ACanvas: TCanvas; ColIndex, RowIndex: Integer;
      PageInfo: TJvTFDaysPageInfo);
    procedure DrawAppts(ACanvas: TCanvas; DrawAll: Boolean;
      PageInfo: TJvTFDaysPageInfo);
    procedure PrintBitmap(ACanvas: TCanvas; SourceRect, DestRect: TRect;
      aBitmap: TBitmap);
    procedure DrawAppt(ACanvas: TCanvas; Col: Integer; Appt: TJvTFAppt;
      StartRow, EndRow: Integer; PageInfo: TJvTFDaysPageInfo);
    procedure DrawApptDetail(ACanvas: TCanvas; ARect: TRect; Appt: TJvTFAppt;
      Col, StartRow, EndRow: Integer);
    procedure DrawApptBar(ACanvas: TCanvas; Appt: TJvTFAppt; BarRect: TRect;
      Col, StartRow, EndRow: Integer);
    function CalcTimeStampRect(Appt: TJvTFAppt; BarRect: TRect;
      Col, StartRow, EndRow: Integer): TRect;
    procedure DrawTimeStamp(ACanvas: TCanvas; TimeStampRect: TRect);
    procedure GetApptDrawInfo(DrawInfo: TJvTFDaysApptDrawInfo; Appt: TJvTFAppt);

    procedure CreatePicDrawList(ARect: TRect; Appt: TJvTFAppt; DrawList: TList);
    procedure FilterPicDrawList(ARect: TRect; DrawList: TList;
      var PicsHeight: Integer);
    procedure CanDrawWhat(ACanvas: TCanvas; ApptRect: TRect;
      PicsHeight: Integer; var CanDrawText, CanDrawPics: Boolean);
    procedure DrawListPics(ACanvas: TCanvas; var ARect: TRect; DrawList: TList);
    procedure ClearPicDrawList(DrawList: T

⌨️ 快捷键说明

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