Print Page | Close Window

[solved]How to alter the default date on view?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=15175
Printed Date: 29 April 2024 at 9:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved]How to alter the default date on view?
Posted By: u8702656
Subject: [solved]How to alter the default date on view?
Date Posted: 15 September 2009 at 5:55am
How to alter the default date on view?
Must use CXTPDatePickerControl ?
If it is true, how should I use it?



Replies:
Posted By: mdoubson
Date Posted: 16 September 2009 at 12:40pm
I don't understand that default mean but if you want to use your own init screen date - use e.g.
 

void CCalendarDemoView::OnInitialUpdate()  { ............

GetCalendarCtrl().GetActiveView()->ShowDay(COleDateTime(2009,12,1,0,0,0)); }



-------------
Mark Doubson, Ph.D.


Posted By: u8702656
Date Posted: 16 September 2009 at 11:25pm
I use xtpCalendarWorkWeekView.
 
m_ctrlCalendar.GetActiveView()->ShowDay() is not work on WeekView mode.
 
It will alter the display mode as DayView .


Posted By: mdoubson
Date Posted: 17 September 2009 at 8:48am
So for your case add another line:

void CCalendarDemoView::OnInitialUpdate()  { ............

GetCalendarCtrl().GetActiveView()->ShowDay(COleDateTime(2009,12,1,0,0,0));

OnCalendarViewWeek(); }

and you will have Week View with your date inside visible range


-------------
Mark Doubson, Ph.D.


Posted By: u8702656
Date Posted: 17 September 2009 at 11:10pm
Thank you for reminding, I have solved my problem.
 
I use Calendar on dialog base .
 
The following is my OnInitDialog() code.
 
..........................
m_ctrlCalendar.SetTheme(new CXTPCalendarThemeOffice2007());
 
 int nWWMask = xtpCalendarDayAllWeek;
 m_ctrlCalendar.SetWorkWeekMask(nWWMask);
 
 m_ctrlCalendar.SetWorkWeekMask(nWWMask);
 CXTPCalendarDayView* pDayView = DYNAMIC_DOWNCAST(CXTPCalendarDayView, m_ctrlCalendar.GetDayView());
 if (pDayView)
 {
  // show working days interval
  COleDateTime dtDayViewStart(2009,12,1,0,0,0);
  pDayView->ShowWorkingDays(dtDayViewStart);
 } 
COleDateTimeSpan spHalfHour(0,0,30,0);
 
 COleDateTime dtHour = (double)spHalfHour * (DWORD)0;
 COleDateTime dtEndHour = (double)spHalfHour * (DWORD)47;
         
 m_ctrlCalendar.SetWorkDayStartTime(dtHour.GetHour(), dtHour.GetMinute(), 0);
 m_ctrlCalendar.SetWorkDayEndTime(dtEndHour.GetHour(),dtEndHour.GetMinute(),0);
...............................
 
It is work.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net