![]() |
Holydays |
Post Reply
|
| Author | |
zaksoft
Senior Member
Joined: 05 June 2003 Location: Italy Status: Offline Points: 163 |
Post Options
Thanks(0)
Quote Reply
Topic: HolydaysPosted: 05 April 2009 at 6:24am |
|
All views change colors accordingly to working days specs. But how can I tell that a specif date is to be considered not working even if the day a working day (ie Xmas or monday after Easter) ? It is possible also the opposite (in Italy shops are normally open the sunday before XMas) ?
TIA.
|
|
|
VS2022 - MFC MBCS Statically linked
XTP 23.1 Static Link --------------------------------------------------------- Davide Zaccanti - ZakSoft - www.zaksoft.com |
|
![]() |
|
mdoubson
Senior Member
Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 April 2009 at 4:21pm |
|
You can use BeforeDrawThemeObject notification and some code like this
void CCalendarDemoView::OnBeforeDrawThemeObject(XTP_NOTIFY_CODE Event, WPARAM wParam , LPARAM lParam)
{ ASSERT(Event == XTP_NC_CALENDAR_BEFORE_DRAW_THEMEOBJECT); if (Event != XTP_NC_CALENDAR_BEFORE_DRAW_THEMEOBJECT) return;
CXTPCalendarThemeOffice2007* pTheme2007 = DYNAMIC_DOWNCAST(CXTPCalendarThemeOffice2007, GetCalendarCtrl().GetTheme());
ASSERT(pTheme2007); if (!pTheme2007) return; static CFont s_fntStriked; if (s_fntStriked.m_hObject == NULL){ LOGFONT lfIcon; VERIFY(::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfIcon), &lfIcon, 0));lfIcon.lfWeight = FW_BOLD; lfIcon.lfHeight = 80; lfIcon.lfStrikeOut = 1; s_fntStriked.CreateFontIndirect(&lfIcon); } if (wParam == xtpCalendarBeforeDraw_DayViewEvent){ CXTPCalendarDayViewEvent* pViewEvent = (CXTPCalendarDayViewEvent*)lParam; if (pViewEvent && pViewEvent->GetEvent()->GetSubject().Left(1) == _T("*")){ pTheme2007->GetDayViewPartX()->GetDayPartX()->GetGroupPartX()->GetSingleDayEventPartX()->m_fcsetNormal.fcsetSubject.fntFont.SetCustomValue(&s_fntStriked); pTheme2007->GetDayViewPartX()->GetDayPartX()->GetGroupPartX()->GetMultiDayEventPartX()->m_fcsetNormal.fcsetSubject.fntFont.SetCustomValue(&s_fntStriked); pTheme2007->GetDayViewPartX()->GetDayPartX()->GetGroupPartX()->GetSingleDayEventPartX()->m_fcsetSelected.fcsetSubject.fntFont.SetCustomValue(&s_fntStriked); pTheme2007->GetDayViewPartX()->GetDayPartX()->GetGroupPartX()->GetMultiDayEventPartX()->m_fcsetSelected.fcsetSubject.fntFont.SetCustomValue(&s_fntStriked); } } if (wParam == xtpCalendarBeforeDraw_MonthViewDay){ CXTPCalendarMonthViewDay* pDay = (CXTPCalendarMonthViewDay*)lParam; if (pDay->GetDayDate().GetDayOfWeek() == 3) == make your weekend case!{ pTheme2007->GetMonthViewPartX()->GetDayPartX()->m_clrBackgroundDark = RGB(196, 128, 128); pTheme2007->GetMonthViewPartX()->GetDayPartX()->m_clrBackgroundLight = RGB(230, 128, 128); pTheme2007->GetMonthViewPartX()->GetDayPartX()->m_clrBackgroundSelected = RGB(128, 228, 228); //pTheme2007->GetMonthViewPartX()->GetDayPartX()->GetHeaderPartX()->} } |
|
![]() |
|
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 |