Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Planner Questions (Read 12003 times)
SAI
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Planner Questions
Apr 28th, 2008 at 6:04pm
Print Post  
Hello, I’ve got a few questions about your Planner/Calendar control.

1. When I’m using the control with the CurrentView set to MonthRange I can’t seem to get the DaysOfWeek headers to not show. I have set the ShowDayOfWeek property to disabled within MonthSettings, but they still show. When I switch to SingleMonth view the days of the week disappear. Playing with the control I have come to find that that particular header is considered a MonthSubHeader, but I can’t find any docuementation on it. How do I go about making the days of the week be invisible in the MonthRange view, or set the MonthSubHeader invisible?

2. Reviewing your tutorials I see that you use CustomDrawElements.DayHeader, however in 4.4 I do not have this enum as an option. Did CustomDrawElements.CellHeader take it’s place?

3. In 4.4 I have found a way to custom draw into each day cell. When you test for CustomDrawElements.CellContents within the draw function, the e.Bounds matches the full day cell. I’m curious if it is possible to have such a thing for MonthRangeView for the MonthContents, or if it is already available? It would be handy to have this so I can access the bounds of the MonthCell when you’re in MonthRange view and use this to draw a summary string for how many items exist within that month. In this case the e.bounds would be the bounds of the MonthCell.

Ex:

private void calendar_Draw(object sender, CustomDrawArgs e)
{
if (e.Element == CustomDrawElements.MonthRangeMonthContents)
{
System.Drawing.Font f = new System.Drawing.Font("Microsoft
Sans Serif", 8F);

SizeF strLength = e.Graphics.MeasureString("Summary




//Gets the x location based on the month’s content width.
int x = (e.Bounds.Width - (int)strLength.Width) / 2;



//Gets the ylocation based on the month’s content height
int y = (e.Bounds.Height - (int)strLength.Height) / 2;

e.Graphics.DrawString("Summarynew
SolidBrush(Color.Black), x, y;

}
}

If this isn’t clear, please let me know and I’ll try and explain it better.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #1 - Apr 29th, 2008 at 6:55am
Print Post  
Hello,

Here are the answers to your questions:

1. This appears to be a bug. It is fixed now.

2. Your assumption is correct. Since the DayRange view was replaced by the more general List view, certain names were changed in order to correspond to this new naming.

3. We will add a new value to the CustomDrawElement enumeration, which will represent the contents of a Month cell. A custom draw event for this new value will be fired right after the day cells of the Month cell have been drawn.

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


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Re: Planner Questions
Reply #2 - Apr 29th, 2008 at 2:27pm
Print Post  
Mippy, thanks for the answers really appreciate you guys looking at this. I have 1 more question/possible request.

I’m using your control in MonthRange view and I’m having it show 3 rows of 4 months each. On each month it displays the total number of items that will happen within the month as I described in the above post. I then want the user to be able to double click on a particular month and it will drill down to a SingleMonth view. Currently I have tapped into DateClick event, and tested the clicks property for 2. This works fine as long as the user clicks on a cell that contains a date. Problem is if they click on an empty cell (Ex: Where padding days would be) no event fires. I’m curious if I’m missing an event or if it’s possible to add a click/double click event for the entire month cell.

Thanks again for your time.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #3 - Apr 30th, 2008 at 7:54am
Print Post  
You can download a preliminary build of Planner.NET from the following link:

https://mindfusion.eu/_planner/_Planner.NET_442pre_trial.zip

The DateClick event is now fired for month cells as well. Additionally a new MonthContents value has been added to the CustomDrawElements enumeration to allow you to custom draw the contents of a month cell. The bug with the sub-headers always showing in a MonthRange view should have been fixed as well.

Meppy
  
Back to top
 
IP Logged
 
SAI
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Re: Planner Questions
Reply #4 - Apr 30th, 2008 at 2:59pm
Print Post  
Meppy,

Thanks again for the quick response, and getting a build out with these fixes. I’ve got a few more things for you and your development team. I’ll list them out here since we already have an ongoing thread instead of creating a new one. If in the future you would like me to split the suggestions and bugs up in their respective forums let me know.

1. The DateClick event is working how you described it, however this isn’t quite the correct fix. Problem I’m having now is my code within the click event is being fired twice. There isn’t a flag for the event specifying how I got into the event (Ex: MonthCell or DateCell click). This means I have no way of determining how I got into it, so I can’t test to make sure my code doesn’t get fired twice. It would be ideal if the developers could give us 2 separate events. One that fires for the date cell clicked, and one that fires for the month cell clicked. That way I can decide which I want to tap into depending on the view I’m currently looking at.

I believe this next one to be a bug, and I’ll try and describe it best as possible.

2. I’m currently looking at the calendar control in the MonthRange view. I have it setup to show 3 rows of 4 months each. I have set the ScrollInterval property to 12. I then set the calendar’s date property to 01/01/ {year I want to view}. This allows for me to view from Jan-Dec of the year I’m interested in. When you click the next button to jump to the next year it actually goes to Dec. of the year you were looking at to Nov. of the next year, instead of Jan. to Dec. of the next year. It behaves this way through 01/03/{year}, however at 01/04/{year} it works the way you would expect it to. One more interesting thing is on a leap year it is broken for only 01/01/{year} and 01/02/{year}, 01/03/{year} works fine.

After doing some testing and looking at the properties these are some examples. The dates below is what the calendar returned for the Date property.

01/01/2007 -> Click next -> 12/29/2007
01/02/2007 -> Click next -> 12/30/2007
01/03/2007 -> Click next -> 12/31/2007
01/04/2007 -> Click next -> 01/04/2008

Leap Years
01/01/2008 -> Click next -> 12/30/2007
01/02/2008 -> Click next -> 12/31/2007
01/03/2008 -> Click next -> 01/03/2007
01/04/2008 -> Click next -> 01/04/2008

01/01/2012 -> Click next -> 12/30/2007
01/02/2012 -> Click next -> 12/31/2007
01/03/2012 -> Click next -> 01/03/2007
01/04/2012 -> Click next -> 01/04/2008

Overall great control, and we will be buying it as soon as I can verify to my boss that it works the way we need it. Thanks once again for the timely responses.



  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #5 - May 1st, 2008 at 7:18am
Print Post  
Here is a new build of Planner.NET:

https://mindfusion.eu/_planner/_Planner.NET_442pre_trial2.zip

The scrolling bug you discovered should be fixed now. Also, there is a new event now, MonthCellClicked, which gets fired when the user clicks on a month cell, but not over a day cell.

Meppy
  
Back to top
 
IP Logged
 
SAI
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Re: Planner Questions
Reply #6 - May 14th, 2008 at 8:08pm
Print Post  
It's me again got another one for you.

I'm currently viewing the calendar in MonthRangeView and there are 2 buttons at the top that allow you to scroll forward or backward. When I hover my mouse over one of these buttons it forces the Draw event to fire for the Calendar. I'm curious as to why this is.

I noticed this problem when I put calculations within the draw code for CustomDrawElements.MonthContents. The problem I was seeing was that the draw event being fired was preventing me from scrolling to the next set of months I wanted to view. Granted my current calculations are not optimized for testing purposes, but I don't understand why the event would be fired.

Further testing shows that at times your Draw event is being fired twice as many times as it needs to be. Example is I currently am viewing 12 months at a time, and the draw code gets fired 24 times. Also moving your mouse off of the scroll button fires the draw event as well. This could essentially result in numerous Draw calls if the user was to move their mouse rapidly on and off the scroll buttons.

Thanks again.

  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #7 - May 15th, 2008 at 7:15am
Print Post  
I am testing with various CustomDraw values here and the Draw event never fires when the user moves the mouse on and off the scroll button. Can you let me know what values do you use for the Calendar.CustomDraw property?

Meppy
  
Back to top
 
IP Logged
 
SAI
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Re: Planner Questions
Reply #8 - May 15th, 2008 at 1:07pm
Print Post  
Hello,

I created a new form and added a calendar control to it to make sure what I'm seeing wasn't caused by some other code. With a very simple form I was able to recreate the draw situation. The following code is what I used.

private void TestDrawCal_Load(object sender, EventArgs e)
{
this.calendar1.CustomDraw = CustomDrawElements.MonthContents;

calendar1.Draw += new CustomDraw(calendar_MonthRangeDraw);
}

private void calendar_MonthRangeDraw(object sender, CustomDrawArgs e)
{
if (e.Element == CustomDrawElements.MonthContents)
{
//Listbox I'm using to display events
this.lbEvents.Items.Add(DateTime.Now.ToShortTimeString() + " - Draw fired");
}
}

I only changed 1 property and that was "this.calendar1.CurrentView = MindFusion.Scheduling.WinForms.CalendarView.MonthRange;"

The event is being fired as soon as I move my mouse over the bounds of the scroll button.

Also have another question, I can't seem to find an event to tap into to know when the user has pressed one of the scroll buttons. In this example they scroll forward 12 months or backwards. I'd like to be able to know when they do this so I can perform calculations on a 12 month range.

Thanks as always.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #9 - May 15th, 2008 at 3:00pm
Print Post  
Oddly enough this doesn't happen here. I am handling the event exactly as you do and it never fires when I am moving the mouse over any of the navigation buttons.

As for the navigation buttons notification, you can handle the Calendar.VisibleDateChanged event.

Meppy
  
Back to top
 
IP Logged
 
SAI
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Re: Planner Questions
Reply #10 - Jul 18th, 2008 at 2:07pm
Print Post  
Hey again. Got pulled off our calendar project for awhile, but now I'm back at it. I was curious if you guys were ever able to recreate my problem from above. I'm still experiencing the problem, and have been trying to debug what's making the call to the draw code. I was curious if there is a way I can make a sample app and send it to you so you can see exactly what I'm doing. Thanks again.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #11 - Jul 21st, 2008 at 7:10am
Print Post  
We have not been able to reproduce this behavior here. Have you tried the latest Planner.NET release and see if it still happen with it? You can download the last Planner.NET trial version from here.

If this bug persists, I will appreciate it if you can send me your test application so that I can check what goes wrong.

Meppy
  
Back to top
 
IP Logged
 
SAI
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Apr 28th, 2008
Re: Planner Questions
Reply #12 - Jul 21st, 2008 at 1:57pm
Print Post  
I am using the newer versions of the control from above that fixed the bugs I reported. I would guess that these builds are tweaks to the build that is released with the file you just linked. With these builds I am seeing the problem persist. What is the best way for you to get my zipped test solution so you can see what I'm refering to?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #13 - Jul 21st, 2008 at 2:40pm
Print Post  
You can send your zipped application to support@mindfusion.eu.

As for the custom changes and fixes we make to our controls, they are all included in the subsequent release - if something is fixed, it will be available in the next official release.

Meppy
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Planner Questions
Reply #14 - Jul 22nd, 2008 at 1:56pm
Print Post  
I received your sample and experimented a bit with it. However, I am trying to move the mouse on and off the navigation buttons, but the event never fires. I welcome any further suggestions about how to reproduce this problem.

Thank you,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint