Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Single month view - long titles and visible dates (Read 5834 times)
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Single month view - long titles and visible dates
Nov 8th, 2007 at 9:17pm
Print Post  
Hi,

1. How do I get the actual first and last date displayed in the SingleMonth view? If I have for example, the november 2007 displayed in the calendar, the first displayed date is actually  29. november and the last one is 9. december.

2. Is it possible to set the number of weeks displayed in single month view? Currently there are 6 rows/weeks displayed, which means there is always an entire week of the next month displayed there. I'd rather have larger days instead of one extra week.

3. If appointment's header text is too long to fit inside the actual item, it doesn't get displayed at all in SingleMonth view (instead of appending "..." at the end and shortening the title, as it is done for example in Timeline). Any ideas how to prevent this?

Thanks,
Darko
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Single month view - long titles and visible da
Reply #1 - Nov 9th, 2007 at 5:59am
Print Post  
Hi, here are the answers to your questions:

1. The actual first date displayed is the first day of the selected month (as specified in Calendar.Date). If Calendar.MonthSettings.ShowPaddingDays is enabled the empty cells before the first day of the month and those after the last day are filled with the days from the previous and the next month respectively. The first displayed day of the week is specified vie Calendar.DateTimeFormat.FirstDayOfWeek.

2. Unfortunately, no. You can increase the number of displayed week but cannot make it less than 6.

3. I am testing this here with long item headers in a SingleMonth view and it appends the "...". What is the exact string you are having problems with?

Regards,
Meppy
  
Back to top
 
IP Logged
 
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Re: Single month view - long titles and visible da
Reply #2 - Nov 9th, 2007 at 10:15am
Print Post  
1. I know that, however I was wondering if it's possible to retrieve the date of the first empty (displayed) cell from the previous month and the last empty cell from the next month.
For example, if I change the current month to "november 2007", I'd like to get the date of the first empty cell drawn (29. november) and last empty cell (9. december). Is it possible?

2. Any chance of adding this option in future release? Any extra space for additional items would come in handy :)

3. This appears to happen when I try to use another font for the item:
[code]

MindFusion.Scheduling.Appointment app = new MindFusion.Scheduling.Appointment();
app.HeaderText = "Lorem ipsum dolor sit amet, consectetuer adipiscing.";
app.Style.HeaderFont = new Font("Tahoma", 11f);
app.StartTime = DateTime.Now;
app.EndTime = DateTime.Now.AddHours(1);
calendar1.Schedule.Items.Add(app);
[/code]
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Single month view - long titles and visible da
Reply #3 - Nov 9th, 2007 at 1:18pm
Print Post  
1. It seems that I have misunderstood your question. The answer of your actual question is 'No'. However, you can calculate those dates yourself. The following code demonstrates how.

Code
Select All
int diff = ((int)calendar1.GetFirstVisibleDate().DayOfWeek -
	(int)calendar1.DateTimeFormat.FirstDayOfWeek + 7) % 7;

DateTime firstDate = calendar1.GetFirstVisibleDate();
if (diff > 0)
{
	int prevMonth = calendar1.Date.Month;
	int prevYear = calendar1.Date.Year;

	prevMonth = prevMonth - 1;
	if (prevMonth == 0)
	{
		prevMonth = 12;
		prevYear -= 1;
	}

	int daysInMonth = DateTime.DaysInMonth(prevYear, prevMonth);
	firstDate = new DateTime(prevYear, prevMonth, daysInMonth - diff + 1);
}

DateTime lastDate = firstDate + TimeSpan.FromDays(6 * 7 - 1); 


The dates of interest are contained in firstDate and lastDate respectively. Keep in mind that the code will work properly only if you are not using leading and trailing weeks. Otherwise you have to perform the necessary modifications.

2. We can do that. I will let you know when we are ready.

3. It appears that the height of the item is not sufficient to fit a text of this size. Increasing the size of the items to, say, 20 seems to be fixing the problem (the item size is controlled through the Calendar.ItemSettings.Size property). As a side note, I will recommend settings Item.SelectedStyle.Font to the same font as the one specified in Item.Style.Font in order to keep the item appearance consistent when the item is selected.

Meppy
  
Back to top
 
IP Logged
 
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Re: Single month view - long titles and visible da
Reply #4 - Nov 9th, 2007 at 4:58pm
Print Post  
Meppy wrote on Nov 9th, 2007 at 1:18pm:
3. It appears that the height of the item is not sufficient to fit a text of this size. Increasing the size of the items to, say, 20 seems to be fixing the problem (the item size is controlled through the Calendar.ItemSettings.Size property). As a side note, I will recommend settings Item.SelectedStyle.Font to the same font as the one specified in Item.Style.Font in order to keep the item appearance consistent when the item is selected.


Hmm, what does the height of the text have to with its length, though? If the string is shorter, it gets displayed properly with the same font.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Single month view - long titles and visible da
Reply #5 - Nov 12th, 2007 at 6:03am
Print Post  
This happens because Planner.NET uses the StringFormatFlags.LineLimit value for the FormatFlags property of the StringFormat object used when rendering texts.

Meppy
  
Back to top
 
IP Logged
 
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Re: Single month view - long titles and visible da
Reply #6 - Nov 18th, 2007 at 10:45am
Print Post  
Thanks for all the answers.

I have another question about the DayRange view. Is it possible to change the size (height) of each item separately?

Thanks,
Darko
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Single month view - long titles and visible da
Reply #7 - Nov 19th, 2007 at 6:01am
Print Post  
Unfortunately - no. If we want to implement this we have to make considerable modifications to the collision resolving algorithm so that it can handle items with different sizes.

Meppy
  
Back to top
 
IP Logged
 
tomk
YaBB Newbies
*
Offline


Yaos!

Posts: 29
Joined: Apr 25th, 2006
Re: Single month view - long titles and visible da
Reply #8 - Dec 5th, 2007 at 1:08pm
Print Post  
Have you guys been able to decide if/when you may be able to implement programmatically controlling the number of weeks displayed in SingleMonth mode as suggested by the poster in point #2?  If so, we would also be very happy to see this new feature, and would certainly use it.

Thanks again!
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Single month view - long titles and visible da
Reply #9 - Dec 5th, 2007 at 1:51pm
Print Post  
I have to finish some other things first and I will look into this.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint