|  | 
| How to properly remember calendar's state? | 
| Post Reply   | 
| Author | |
| dennisV   Senior Member     Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |  Post Options  Thanks(0)  Quote  Reply  Topic: How to properly remember calendar's state? Posted: 28 September 2009 at 6:05pm | 
| 
   Hello, What is the proper way to remember what state the control was in, so that it can be restored to the same view type when re-starting the app? Currently, I get the view type (GetCalendarCtrl().GetActiveView()->GetViewType()) and store it in the registry and in OnInitialUpdate I get that value and change the view type, however, that only works for Month. If I had Day or Full Week selected and stored, it will reset to Week view for some reason. Any advice appreciated... Thanks. | |
| 
     // W7 64 Ultimate SP1 // VS 2008 // CodeJock 16.2.3 (MFC) | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 28 September 2009 at 8:11pm | 
| DayView and WorkWeekView should be similar to MonthView. For WeekView and FullWeekView you need to store and retrive flag MultiColumn mode and use it before switch. To switch to desired ViewType follow CalendarDemoView.cpp code: 
void OnCalendarViewDay();
void OnCalendarViewWorkWeek();
void OnCalendarViewWeek();
void OnCalendarViewMonth(); | |
|  | |
| dennisV   Senior Member     Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |  Post Options  Thanks(0)  Quote  Reply  Posted: 29 September 2009 at 9:10am | 
| 
   Not quite there yet - once I started strong the MultiColumn mode, I've moved a bit forward, however, if I try to store Day or any Week that's not 5 days, it resets to a 5 day week (work week). I'll investigate a bit more, but there're places in the code like the following that make me a bit confused: void CXTPCalendarControl::SwitchActiveView(XTPCalendarViewType eViewType) { if (eViewType == xtpCalendarFullWeekView) eViewType = xtpCalendarWeekView; m_eViewType = eViewType; | |
| 
     // W7 64 Ultimate SP1 // VS 2008 // CodeJock 16.2.3 (MFC) | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 29 September 2009 at 7:19pm | 
| 
   This is proper as FullWeekView IS WeekView and adjustments for MultiColumn mode - in next piece of same function code:
 ........................ else if (eViewType == xtpCalendarWeekView) { if (m_bMultiColumnWeekMode) {..... | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |