Print Page | Close Window

Get column title

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=15137
Printed Date: 16 November 2024 at 10:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get column title
Posted By: gmail
Subject: Get column title
Date Posted: 08 September 2009 at 6:55pm
How can I set my own custom title name for e.g. first day in the week (i.e. on week view instead of 'Monday' I want to set 'Christmas')? Thanks for replying.



Replies:
Posted By: mdoubson
Date Posted: 14 September 2009 at 6:40pm

You can use: GetCalendarCtrl().m_bFullDateMode = TRUE;

CXTPCalendarDayView* pDayView = DYNAMIC_DOWNCAST(CXTPCalendarDayView, GetCalendarCtrl().GetDayView() );

if (pDayView) { pDayView->SetDayHeaderFormat(_T("Holiday %A, %B %d, %Y")); } - but it give you custom title for DayView or multi-column week view and every day will be Holiday (!). May be in next version we will make something for special title string for different days

Still you can use any combination of date-related C-format (%a %b ...)
But this is static (same for all days) custom text


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


Posted By: mdoubson
Date Posted: 18 September 2009 at 9:53am
You can use notification - e.g.
VB Calendar Sample notification handler:
Private Sub CalendarControl_GetItemText(ByVal Params As XtremeCalendarControl.CalendarGetItemTextParams)
.............................................................................................
If Params.Item = xtpCalendarItemText_DayViewDayHeaderRight Or _
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderRight Or _
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderRight _
        Then
        Params.Text = Year(Params.ViewDay.Date) & " - Your happy day"
.............................................................................................   
End Sub

you need to add subscription to notification in your Form load function call

CalendarControl.AskItemTextFlags.SetFlag xtpCalendarItemText_DayViewDayHeaderRight
Samething you can use in MFC -

CString CXTPCalendarDayViewDay::GetCaption() {

COleDateTime dt(m_dtDate);

SYSTEMTIME st;

GETASSYSTEMTIME_DT(dt, st);

CString strHeaderFormat = GetView() ? GetView()->GetDayHeaderFormat() : _T("");

CString strResult = CXTPCalendarUtils::GetDateFormat(&st, strHeaderFormat);

if (strHeaderFormat.Find(_T("%")) > -1) //C-format used

strResult = dt.Format(strHeaderFormat);

DWORD dwFlags = XTP_SAFE_GET2(GetView(), GetCalendarControl(), GetAskItemTextFlags(), 0);

if (dwFlags & xtpCalendarItemText_DayViewDayHeader)

{

XTP_CALENDAR_GETITEMTEXT_PARAMS objRequest;

::ZeroMemory(&objRequest, sizeof(objRequest));

objRequest.nItem = (int)xtpCalendarItemText_DayViewDayHeader;

objRequest.pstrText = &strResult;

objRequest.pViewDay = this;

XTP_SAFE_CALL2(GetView(), GetCalendarControl(), SendNotificationAlways(

XTP_NC_CALENDAR_GETITEMTEXT, (WPARAM)&objRequest, 0));

}

return strResult;

}

Just use nofification XTP_NC_CALENDAR_GETITEMTEXT


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



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