#ifndef XML_FORM_CALENDAR_CONTROL_H_INCLUDED
#define XML_FORM_CALENDAR_CONTROL_H_INCLUDED
/*****************************************************************************/
/* HEADER FILE */
/*****************************************************************************/
/*
$Archive: $
$Revision: $
$Date: $
$Author: $
Description: This class implements date edit window with ability
to visually pick a date from a calendar
To use it in resouce (for example, in CFormView or
CDialog-derived classes you just place CStatic or CEdit
control with apropriate ID (rather than -1) on your form
and replace ClassWizard-provided member variable type to
CCalendar (don't forget include CCalendar.h header file)
Use Create member function to create it dynamically
When CCalendar receives input focus, it looks like drop-
down combo box showing current date in edit field. When
user clicks the down arrow, a calendar window appears.
It shows the days of the week on top. Then 6 lines to show
the days of the month. The days of current month are shown
in black. The days of the previous and next month are shown
in a lighter color
Now user can select a date by mouse clicking and jump to
the previous or next month.Also he can select the date of
today using button with same name. Other button can be used
to select no date. In the latter case the combo box will also
shows "None".
If user type a date in text field and click down arrow,
calendar window initially will show a month contained this date.
If no text has been typed, it will show current month.
TOOL And XML FORMS License
==========================
Except where otherwise noted, all of the documentation
and software included in the TOOL package is
copyrighted by Michael Swartzendruber.
Copyright (C) 2005 Michael John Swartzendruber.
All rights reserved.
Access to this code, whether intentional or accidental,
does NOT IMPLY any transfer of rights.
This software is provided "as-is," without any express
or implied warranty. In no event shall the author be held
liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for
any purpose, including commercial applications, and to
alter and redistribute it, provided that the following
conditions are met:
1. All redistributions of source code files must retain
all copyright notices that are currently in place,
and this list of conditions without modification.
2. The origin of this software must not be misrepresented;
you must not claim that you wrote the original software.
3. If you use this software in another product, an acknowledgment
in the product documentation would be appreciated but is
not required.
4. Modified versions in source or binary form must be plainly
marked as such, and must not be misrepresented as being
the original software.
*/
/*****************************************************************************/
#include <vector>
#include "XMLFormControls.h"
class CXMLFormCalendarControl : public CDateTimeCtrl, CXMLFormControl
{
public:
virtual void CreateToolTip( void );
virtual void SetDDVHandler( P_FORM_CONTROL_DDV_TYPE pxMyDDV )
{
m_pxMyDDV = pxMyDDV;
};
virtual void SetDDXHandler( P_FORM_CONTROL_DDX_TYPE pxMyDDX )
{
m_pxMyDDX = pxMyDDX;
};
//{{AFX_VIRTUAL( CXMLFormCalendarControl )
//}}AFX_VIRTUAL
protected:
COLORREF m_xTextFocusColor;
COLORREF m_xBackFocusColor;
COLORREF m_xTextColor;
COLORREF m_xBackColor;
CBrush m_oBackBrush;
CBrush m_oBackFocusBrush;
bool m_bHasFocus;
// 0=Monday, 1=Tuesday, ... 6=Sunday
public:
CXMLFormCalendarControl( void );
bool SetTextFocusColor( COLORREF xColor );
bool SetBackFocusColor( COLORREF xColor );
bool SetTextColor( COLORREF xColor );
bool SetBackColor( COLORREF xColor );
public:
virtual ~CXMLFormCalendarControl( void );
protected:
//{{AFX_MSG( CXMLFormCalendarControl )
afx_msg void OnKillFocus( CWnd* poNewWnd );
afx_msg void OnSetFocus( CWnd* pOldWnd );
afx_msg HBRUSH CtlColor( CDC* pDC, UINT nCtlColor );
//}}AFX_MSG
afx_msg LONG OnValidateNow( WPARAM wParam, LPARAM lParam );
afx_msg LONG OnDropToolTip( WPARAM wParam, LPARAM lParam );
afx_msg LONG OnShowToolTip( WPARAM wParam, LPARAM lParam );
DECLARE_MESSAGE_MAP()
};
#endif
/*****************************************************************************/
/* Check-in history */
/*
*$Log: $
*/
/*****************************************************************************/