Recent

Author Topic: CalendarLite  (Read 1233 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 446
CalendarLite
« on: August 15, 2020, 08:59:12 pm »
Hi i don't some body still support calendarlite or some body using that can help me, I don't know if is possible to add text to dates or some state....

   for example  date: 20/08/2020
         text or status:   Approbe or Denied   

thanks.
Fernando

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: CalendarLite
« Reply #1 on: August 15, 2020, 09:13:40 pm »
You can use the OnGetDayText event to write any text into the day cells, e.g:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.CalendarLite1GetDayText(Sender: TObject; AYear, AMonth,
  2.   ADay: Word; var AText: String);
  3. begin
  4.   AText := IntToStr(ADay);
  5.   if EncodeDate(AYear, AMonth, ADay) = EncodeDate(2020, 8, 18) then
  6.     AText := AText + LineEnding + 'Meeting';
  7. end;

eldonfsr

  • Sr. Member
  • ****
  • Posts: 446
Re: CalendarLite
« Reply #2 on: August 15, 2020, 09:34:36 pm »
Thanks for replay soon is working, one more question hope you know we can select several days or dates but when you click on date thats clear other date when we have multi selected must give change to change or unselect a date and keep others....

you can see on the picts first show dates selected, and second show you date was click and lose the rest.

 

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: CalendarLite
« Reply #3 on: August 15, 2020, 11:49:21 pm »
The multi-selection feature of CalLite was not designed for persistent selection. I suppose you want to highlight the dates for which you added special labels. Since you must store date and text outside the calendar anyway I'd propose you draw these "event days" by using the OnPrepareCanvas event.

See attached basic demo. Double-click on a day in the calendar to define an event for it. Specify the name of the event. Date and event name are listed in the listbox, and these dates with events will be highlighted with yellow background color and show the event name in the calendar.

 

TinyPortal © 2005-2018