Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Toolkit User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

4.7 Calendar Control

SECCalendar implements a standard calendar control for date entry and date representation. You can invoke methods to highlight and select days on the calendar. You can embed an SECCalendar instance into a dialog or implement it as a pop-up control through the derived class SECPopupCalendar. SECPopupCalendar allows the user to view the calendar control as a drop-down window, which saves screen space.

The calendar class hierarchy is as follows:

Figure 17: Objective Toolkit Calendar Class Hierarchy

Figure 18: SECCalendar Display

4.7.1 To incorporate the SECCalendar class into your code

  1. Create an instance of SECCalendar or SECPopupCalendar.

  2. Call the SetPage() method to display the appropriate month for a given date. For 32-bit versions of Objective Toolkit, pass in either a COleDateTime reference or a CTime reference. For example:


    The CTime class encapsulates the run-time time_t data type. it represents absolute time values only in the range January 1, 1970 to January 18, 2038, inclusive.

  3. Call the SetBehaviorMode() and SetDrawMode() methods. For example:


    You can override these methods to customize the behavior mode and drawing mode.

  4. Call the Create() method. For example:


    If you are using SECPopupCalendar, WS_POPUP is a valid window style.

4.7.2 SECCalendar Key Methods

4.7.3 Customizing SECCalendar

Most of the SECCalendar operation methods (AdvanceDay(), AdvanceWeek(), AdvanceMonth(), and more) are virtual functions that you can override to add custom behavior to a derived class. In addition, you can override the InitColors() method to specify colors for the various parts of the calendar. The default implementation initializes the colors based on the current system colors.

4.7.4 SECCalendar Sample

The use of SECCalendar and SECPopupCalendar is demonstrated in the caltest sample in the Samples\Toolkit\MFC\Controls\calendar directory. This sample is not shipped with the product. For information on how to obtain this sample, see Section 3.6.1, "Location of Sample Code," in the Stingray Studio Getting Started Guide.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.