Calendar multiple events does not showing

Hello


I'm using Delphi XE 10.3.1 with latest Pack for Firemonkey components.

I'm not able to see multiple events on the same day as you claim on your PDF documentacion Why?

Your text said: 
"Events The calendar has the capability of displaying multiple events per day which show a popup on hovering. The calendar events are displayed with a customizeable indicator that can be set to a square, triangle, diamond or ellipse shape. To add an event to the calendar use"

I create multiple events on the same day but I only see one of them (the last one).

Also is there possible to draw a custom image (png, bmp or jpeg) instead of the: ekTriangle, ekRectangle, ekDiamond, ekEllipse???????
I use the next code.


               While Not DataSet.Eof do
               Begin
                    For X := 0 to DaysBetween(DataSet.FieldByName('FechaInicio').AsDateTime, DataSet.FieldByName('FechaFin').AsDateTime) -1 do
                    Begin
                         Evento := Calendario.Events.Add;
                         Evento.Date := DataSet.FieldByName('FechaInicio').AsDateTime + X;
                         Evento.Text := DataSet.FieldByName('Titulo').AsString;
                         case Y of
                              0: Evento.Kind := ekTriangle;
                              1: Evento.Kind := ekRectangle;
                              2: Evento.Kind := ekDiamond;
                              3: Evento.Kind := ekEllipse;
                         end;
                    End;

                    // Avanzamos el registro
                    DataSet.Next;
                    Inc(Y);
               End;


The code works, but your component does not show multiple events as you lie on your documentacion why???

You can add multiple events, but they are all stacked at the same position, in the top right corner. If you want to visualize the events you can use the following code:


procedure TForm1.TMSFMXCalendar1CustomizeEvent(Sender: TObject;
  AEvent: TTMSFMXCalendarEvent; AEventObject: TTMSFMXCalendarDateEventShape);
begin
  AEventObject.Position.X := AEventObject.Position.X - 10 * AEvent.Index;
end;


It works, thanks.

However you must update your documentation in order to let this know to all commmunity

Regards

Pieter

I need also to show my user the events from specific month with his shape and color in a control like TListView or something, let me explain with the next sample:

1) Assume I create the next three events with the TTMSFMXCalendar procedures
a) event from 01 January 2019 to 31 August 2019 (The first 8 Months of 2019)
b) event from 01 January 2019 to 31 Jan 2019
c) event from 28 Jan 2019 to 01 April 2019

2) If my user enter for the first time into the Application I will must to display all September 2019 wich must NOT to show any event.

3) If my user after enter the application select the month January 2019 the application will paint two different events from day 1 to 27 corresponding to events "a" and "b", the rest of the month will paint three different events "a", "b" and "c".

In this step I need to display a "legend" with the caption of each different event and shape and color too.

I was thinking to use a TListView in order to create the 3 different caption events obtaining from some code line:

----------------
For X := 0  to TMSFMXCalendar.Events.Count -1 do
IF TListView.ItemIndex(TMSFMXCalendar.Events[X].Text) = -1 then TListView.Item.Add(TMSFMXCalendar.Events[X].Text)
----------------

Can you please point me in the right direction of how to paint the same shape and color used in the TMSFMXCalendar event at the upper right corner of every day?????

So the idea is to bring "legends" at my user at the botton of the TMSFMXCalendar so he must see description for events instead pressing the shapes.


Thanks

Hi,


Perhaps it is more suitable to use the TTMSFMXPlanner instead, which has more features to show multiple items/events to the user. The sole purpose of the events collection in the TTMSFMXCalendar was to show a single-day indication that something is planned that day. It is currently not possible to have complex events that cover multiple days, or you will have to manually calculate the number of days between 2 dates and add an equivalent number of events for those days.

I selected the TTMSFMXCalendar  because my end user request a view month only as TTMSFMXCalendar  does.

You TTMSFMXPlanner  can display entire months as TTMSFMXCalendar  ???

Unfortunately no, it is on our todolist to create a month view for the planner.


Pieter

Just tell me how to draw the same event kind into a TlistView the rest is a piece of cake for me, I already have the necessary code except for the 4 types of shapes used in your calendar events.

The four types of shapes are Rectangle, Diamond, Triangle and Ellipse. It's unclear however if the TListView allows custom drawing, as we have no insight on what happens internally. The code that draws the shapes is in the TTMSFMXCalendarDateEventShape.Painting; routine.