Print Page | Close Window

Questions on using the calendar control

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=6565
Printed Date: 04 May 2024 at 9:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Questions on using the calendar control
Posted By: mgampi
Subject: Questions on using the calendar control
Date Posted: 05 March 2007 at 6:54pm
Hi;
I'm completely new to the calendar control, so I have a lot of questions about the control and its usage:
 
I want to use the calendar control to create an interface for shift definition manipulation in a MES application. So I want to create a work week calendar view to input all the shifts available within a work week. This leads to following problems when starting with the general calendar control:
 
1. How could I prevent scrolling the general work week view to other dates then the general dates visible at startup?
2. How can I disable the 'current date' indicator (not to mix with 'current time of day')?
3. How to adapt the header description when using the Office 2007 theme to display only weekday names without any precise date?
 
Thanks in advance


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: sserge
Date Posted: 08 March 2007 at 3:18pm
Hi Martin,

1) See details for CXTPCalendarView::EnableHScroll() method:

pDayView->EnableHScroll(FALSE);


2)  As I understand you mean Office 2007 theme. For the next version of the Toolkit a header background customization will be enhanced (changed) and this will be easy to do. For the current version this is nearly not possible.

3) Use CXTPCalendarView methods:

SetDayHeaderFormatLong
SetDayHeaderFormatMiddle
SetDayHeaderFormatShort
SetDayHeaderFormatShortest

Or if you want some other text (not a date part) use XTP_NC_CALENDAR_GETITEMTEXT notification. See our sample how to catch XTP_NC_CALENDAR_xxx notifications.
 
--
WBR,
Serge


Posted By: mgampi
Date Posted: 13 March 2007 at 3:01pm
Hi Serge;
 
Thanks for your help! My first question is completely answered, but the other two are still pending.
I'm able to use a trick to not display the current date indicator - just select a week prior to the one containing the current date.
But the third question can't be solved.
All I want to achieve is, that the caption of the work week view only contains the names of the individual days, no other information - especially no precise date:
 
I tried this part of code:
 
GetCalendarCtrl().SetWorkWeekMask(xtpCalendarDayAllWeek);
GetCalendarCtrl().GetActiveView()->EnableHScroll(FALSE);
CXTPCalendarThemeOffice2007* pTheme =
new CXTPCalendarThemeOffice2007();
GetCalendarCtrl().SetTheme(pTheme);
GetCalendarCtrl().SwitchActiveView(xtpCalendarWorkWeekView);
GetCalendarCtrl().GetActiveView()->SetDayHeaderFormatLong(_T("dddd"));
GetCalendarCtrl().GetActiveView()->SetDayHeaderFormatMiddle(_T("dddd"));
GetCalendarCtrl().GetActiveView()->SetDayHeaderFormatShort(_T("dddd"));
GetCalendarCtrl().GetActiveView()->SetDayHeaderFormatShortest(_T("dddd"));
 
But the result is always the same:
On the left side I see the precise date, in the middle the two chars day name and the right side is blank (see screenshot).
 


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: mgampi
Date Posted: 13 March 2007 at 3:55pm
Hi Serge;
 
I posted to fast! After checking the XTP_NC_CALENDAR_GETITEMTEXT event and solving a few problems on how to enable the event when using Office 2007 theme and accessing the curent date informations within the event handler, I got it to work.
Once again thanks for your hints!


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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