Recent

Author Topic: TvPlanIt - customize font event  (Read 480 times)

Nicola Gorlandi

  • Full Member
  • ***
  • Posts: 132
TvPlanIt - customize font event
« on: December 31, 2022, 08:48:25 am »
Hi all,

At the momenti it is possibile to have different background color using event category.

I would like to set event font color based on an userfield value on month and week view.

Is this possible or I have to customize component code ?

I check OwnerDrawCells event but is too "in dept", it requires to draw everything from the scratch.

Many thanks,

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: TvPlanIt - customize font event
« Reply #1 on: December 31, 2022, 01:59:54 pm »
In the new commit r8667, the controls TVpDayView, TVpWeekView and TVpMonthView have a new event OnPrepareEventFont(Sender: TObject; AEvent: TVpEvent; AFont: TFont) which fires immediately before the event text is painted. In its handler, you can change font parameters depending on other parameter, e.g. on properties of AEvent. Note, however, that the size of the event rectangle already has been calculated, therefore it is not recommended to change the font size.

Nicola Gorlandi

  • Full Member
  • ***
  • Posts: 132
Re: TvPlanIt - customize font event
« Reply #2 on: January 01, 2023, 11:13:29 am »
Many thanks, this sound real good. I will check it asap.

 

TinyPortal © 2005-2018