Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Questions on using the calendar control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Questions on using the calendar control

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Questions on using the calendar control
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.