Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Appointment connection and contacts background colors (Read 2252 times)
Conzz91
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Aug 30th, 2022
Appointment connection and contacts background colors
Aug 30th, 2022 at 12:46pm
Print Post  
Hi,

I'm trying to achieve the following results:

1) connect with lines (arrows) different appointments inserted in ResourceView, following an order. I've partially achieved this result as indicated in screenshot-1.png, but in case one appointment is not drawn in current calendar view the coordinates of appointment bounds returns 0, 0. Is there any possibility to get the coordinates of an appointment not shown in current view?

2) customize the background color of one or more resources, and customize the background of one or more of the days shown in the calendar.getResourceViewSettings().getBottomTimelineSettings()

Any suggestion?
Thnak you very much!!
  

Screenshot-1.png ( 103 KB | 168 Downloads )
Screenshot-1.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3410
Joined: Oct 19th, 2005
Re: Appointment connection and contacts background colors
Reply #1 - Aug 31st, 2022 at 12:01pm
Print Post  
Hi,

Try this function for finding out-of-view items positions:

Code
Select All
double timeX(DateTime dt)
{
	DateTime start = calendar.getFirstVisibleDate();
	DateTime end = calendar.getLastVisibleDate();
	Rectangle headerRect = calendar.getElementBounds(
		CalendarElement.ResourceViewHeader, 0);
	int width = calendar.getBounds().width - headerRect.width;
	double ticksPerPixel = (end.getTicks() - start.getTicks()) / width;
	double pixels = dt.subtract(start).getTicks() / ticksPerPixel;
	return headerRect.getMaxX() + pixels;
} 



For resource colors, set the ResourceViewRowHeader and ResourceViewTimelineCell flags of CustomDrawElements and fill the headers / cells you need from CalendarListener.draw handler. You can find an example that fills partial dates in header here -
https://mindfusion.eu/Forum/YaBB.pl?num=1659043839

Regards,
Slavcho
Mindfusion
« Last Edit: Sep 1st, 2022 at 7:31am by Slavcho »  
Back to top
 
IP Logged
 
Conzz91
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Aug 30th, 2022
Re: Appointment connection and contacts background colors
Reply #2 - Sep 1st, 2022 at 2:23pm
Print Post  
Hi,

Thank you very much for your suggestions, I've found a way to make it work!

One more question please,

is there a way to completely hide a row of the ResourceView? I've already tried with

Code (Java)
Select All
calendar.collapseResourceRow(resource) 



function but this reduces the resource to a single line, not a complete hide

Thank you very much,
Regards!
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3410
Joined: Oct 19th, 2005
Re: Appointment connection and contacts background colors
Reply #3 - Sep 2nd, 2022 at 6:53am
Print Post  
Hi,

I can't find a dedicated visibility property, but having separate resource collections in the view and model (Calendar / Schedule) kind of serves the same purpose. So you could temporarily remove the resource from respective Calendar collection to hide, and later restore it from Schedule's one.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint