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

CXTPCalendarCaptionBarControl

 Post Reply Post Reply
Author
Message
haime View Drop Down
Newbie
Newbie
Avatar

Joined: 23 April 2013
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote haime Quote  Post ReplyReply Direct Link To This Post Topic: CXTPCalendarCaptionBarControl
    Posted: 23 April 2013 at 3:16am
Hi,
 
I've just started to use the toolkit, and specifically the Calendar control, in an MFC environment (VS2010).
 
I embeded the Calendar control object (CXTPCalendarControl) in a popup dialog (not using CView), but I don't see the CaptionBar control.
 
According to the docs:
CXTPCalendarCaptionBarControl represents CalendarCaptionBar control and used as a part of CXTPCalendarControl object. They looks and works as a single control but separated on 2 objects for customization possibilities.
How can I make it visible?
 
How can I access the CXTPCalendarCaptionBarControl members?
 
Thanks.
Back to Top
etiennepaquette View Drop Down
Newbie
Newbie


Joined: 06 May 2013
Location: Canada
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote etiennepaquette Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2013 at 2:45pm
Hi,

do you figure how to show the Calendar Caption bar in a dialog without using the CView. I try to do exactly the same thing as you and i don't find the way to do it.

Thanks for any hints


Back to Top
haime View Drop Down
Newbie
Newbie
Avatar

Joined: 23 April 2013
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote haime Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2013 at 3:14pm
1. In Resouce View, select "Custom Control" and position it on the dialog.
2. Go to the control properties and in the "Class Name" put "XTPCalendar"
3. Right click on the control + "Add variable"
4. Add a control variable with type "CXTPCalendarControl"
5. Call member functions by using the member variable
 
Do the above sequance for the "CXTPCalendarCaptionBarControl" (use "XTPCalendarCaptionBar" for "Class Name".
 
Now connect the two by using the following code:
 

      // Connect between the calendar control and the caption bar

      m_CaptionBar.GetTheme()->AttachCalendar(&m_Calendar);

 

      // Position CaptionBar at the top of the Calendar control

      CRect rcCalendar, rcCaptionBar;

      m_Calendar.GetWindowRect(&rcCalendar);

      ScreenToClient(&rcCalendar);

      rcCaptionBar = m_CaptionBar.CalcMinRect(FALSE);

      rcCaptionBar.MoveToXY(rcCalendar.TopLeft());

      rcCaptionBar.right = rcCalendar.right;

      rcCalendar.top = rcCaptionBar.bottom + 1;

      m_Calendar.MoveWindow(&rcCalendar);

      m_CaptionBar.MoveWindow(&rcCaptionBar);

 

 
Enjoy.
 
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.125 seconds.