Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Color Schemes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Color Schemes

 Post Reply Post Reply
Author
Message
RolandoE. View Drop Down
Groupie
Groupie
Avatar

Joined: 19 May 2003
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote RolandoE. Quote  Post ReplyReply Direct Link To This Post Topic: Color Schemes
    Posted: 08 September 2005 at 7:53am

Hi,

I would like to know what I need to do in order to change the colors used within the Calendar Control. It is not very obvious by just reading the online documentation and the Demo does not touch on that subject.

Default colors are nice but users want the ability to change the colors displayed on thier calendars.

Any help will be apreciated.

Rolando

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 September 2005 at 9:32am
Hi Rolando,

Look below for a few customization examples:

GetPaintManager()->GetDayViewHeaderPart()->SetTextColo r(RGB(255, 155, 55));
GetPaintManager()->GetDayViewHeaderPart()->SetBackgrou ndColor(RGB(5, 155, 5));

GetPaintManager()->m_clrFreeColor = RGB(55, 55, 155);
GetPaintManager()->m_clrBusyColor = RGB(255, 55, 155);

GetPaintManager()->RefreshMetrics();


Please see CXTPCalendarPaintManager class for more details.
Also you can create your own PaintManager class derived from the existing one and override some methods for customization.

We are also planning to make more flexible customization in future versions.

--
WBR,
Serge
Back to Top
RolandoE. View Drop Down
Groupie
Groupie
Avatar

Joined: 19 May 2003
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote RolandoE. Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2005 at 8:38pm

Hi,

Thanks for the code this has pointed me in the right direction!!

COLORREF clrBkg = pApp->GetProfileInt("Options", "BackgroundColor", RGB(255,244,188));
COLORREF clrWD = pApp->GetProfileInt(
"Options", "WorkDayColor", RGB(255, 255, 213));

// Change Color
m_wndCalendar.GetPaintManager()->GetDayViewWorkCellPart() ->SetBackgroundColor(clrWD);
m_wndCalendar.GetPaintManager()->GetDayViewNonworkCellPar t()->SetBackgroundColor(clrBkg);

Thanks for your help.

Rolando

Rolando E. Cruz-Marshall
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.109 seconds.