Questions on using the calendar control |
Post Reply |
Author | ||
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
||
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
|
Hi Martin,
1) See details for CXTPCalendarView::EnableHScroll() method:
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:
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 |
||
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
|
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
||
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
|
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
||
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 |