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

Calendar Control Caption buttons

 Post Reply Post Reply
Author
Message
mitcheljh View Drop Down
Groupie
Groupie


Joined: 20 July 2008
Location: United States
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote mitcheljh Quote  Post ReplyReply Direct Link To This Post Topic: Calendar Control Caption buttons
    Posted: 31 August 2009 at 2:36pm
Hi,

I'm guessing this is a simple problem, and I'm probably not performing something in the correct order, or not calling a function that I should be.

In my calendar control, I allow the user to set (in the options) the desired theme. When initializing the calendar view (in OnInitialUpdate), I call the same function to set the theme.

The issue is, when the app is launched, the check/radio buttons for Work Week, Full Week, MultiColumn mode are all 'regular' buttons. But, after manually changing the theme, they properly change to radio/checkbox buttons.

I'm confused because I'm using the same code to set the theme, but for some reason, it's not working when the app starts. The code to set the theme is below.

void CalendarView::setTheme(XTPCalendarTheme theme)
{
if (theme == xtpCalendarThemeOffice2003) {
    GetCalendarCtrl().SetTheme(NULL);
    GetCalendarCtrl().GetPaintManager()->SetPaintTheme(xtpCalendarThemeOffice2003);
} else if (theme == xtpCalendarThemeOffice2007) {
    CXTPCalendarThemeOffice2007* pTheme = new CXTPCalendarThemeOffice2007();
    GetCalendarCtrl().SetTheme(pTheme);
}
GetCalendarCtrl().SetPaintTheme((XTPCalendarTheme)theme);
}


Thanks,

Mitch
Back to Top
mitcheljh View Drop Down
Groupie
Groupie


Joined: 20 July 2008
Location: United States
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote mitcheljh Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2009 at 9:07am
I found out what the problem was, so I thought I'd share for anyone else who might run into the same problem.

The calendar view is placed inside of a docking pane, and I was initializing the calendar before setting the theme of the docking pane manager. If I wait to initialize the calendar, pPane->attach(pCalendarView) after the pane manager has had it's theme set, then the checkboxes/radio buttons show up fine on the calendar caption bar.

Thanks,

Mitch
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.