Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changing WorkDay settings in TimeTableView (Read 4597 times)
ADBDesigner
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Apr 14th, 2006
Changing WorkDay settings in TimeTableView
Apr 14th, 2006 at 8:06pm
Print Post  
Hey, I just purchased Planner.NET for a application that I want to create, and I'm worried that there isn't a way to do this afterall.

In the Timetable view, I want to configure the range of worktime start and end to be different on multiple days, and if possible to be non-current.  The app needs to be able to deal with people who have flexible work schedules and work, perhaps on Mondays from 8-12, Tuesdays 9-11 and again from 4-6.  Is it possible to get the work day settings to apply to a range of dates and times rather then having only a single "work day" set from 8-5?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Changing WorkDay settings in TimeTableView
Reply #1 - Apr 16th, 2006 at 8:05pm
Print Post  
Hi,

You cannot specify different work time ranges for different days but, since the only thing affected by the work time settings is the way cells are drawn, you can use custom painting to achieve the same result. A sample application that demonstrates this technique can be downloaded from the following link:

https://mindfusion.org/_samples/cwt.zip

Meppy
  
Back to top
 
IP Logged
 
ADBDesigner
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Apr 14th, 2006
Re: Changing WorkDay settings in TimeTableView
Reply #2 - Apr 16th, 2006 at 8:58pm
Print Post  
Cool.  I'm going to try and muddle through that a bit, but if you had a VB.NET sample, that would be even better.  (I probably should have mentioned that, sorry) Thanks!
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Changing WorkDay settings in TimeTableView
Reply #3 - Apr 17th, 2006 at 6:56am
Print Post  
Here is how the Draw event handler from the attached sample would look like in VB.NET:

Code
Select All
Private Sub Calendar1_Draw(ByVal sender As Object, ByVal e As MindFusion.Scheduling.WinForms.CustomDrawArgs) Handles Calendar1.Draw

 If e.Element = CustomDrawElements.TimetableCell Then

  ' Check if it is worktime and color appropriately
  Dim workTime As Boolean = False
  Dim mins As Integer = CType(e.StartTime.TotalMinutes, Integer)

  If e.Date.DayOfWeek = DayOfWeek.Monday Then
   If mins >= 8 * 60 And mins < 12 * 60 Then workTime = True
  End If

  If e.Date.DayOfWeek = DayOfWeek.Tuesday Then
   If mins >= 9 * 60 And mins < 11 * 60 Or mins >= 16 * 60 And mins < 18 * 60 Then workTime = True
  End If

  If workTime Then
   Dim b As Brush = New SolidBrush(Color.PaleGoldenrod)
   Dim bounds As Rectangle = e.Bounds
   bounds.Inflate(-1, -1)

   e.Graphics.FillRectangle(b, bounds)

   b.Dispose()
  End If

 End If

End Sub 



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