DateTime Picker Control. More...
#include <SDateTimePicker.h>
Public Types | |
| enum | EnDateType { eDT_NULL = 0 , eDT_Year , eDT_Month , eDT_Day , eDT_Hour , eDT_Minute , eDT_Second } |
| Enumeration for date types. More... | |
Public Member Functions | |
| SDateTimePicker () | |
| Constructor. | |
| ~SDateTimePicker () | |
| Destructor. | |
| void | SetTime (WORD wYear, WORD wMonth, WORD wDay, WORD wHour, WORD wMinute, WORD wSecond) OVERRIDE |
| Set the time. | |
| void | GetTime (WORD *wYear, WORD *wMonth, WORD *wDay, WORD *wHour, WORD *wMinute, WORD *wSecond) SCONST OVERRIDE |
| Get the time. | |
| void | CloseUp () OVERRIDE |
| Close the dropdown. | |
| void | DropDown () OVERRIDE |
| Drop down the list. | |
| void | Clear () OVERRIDE |
| Clear the selected date and time. | |
| SStringT | GetWindowText (BOOL bRawText=FALSE) |
| Get the window text. | |
| void | SetTime (const SYSTEMTIME &sysTime) |
| Set the time using SYSTEMTIME structure. | |
| void | GetTime (SYSTEMTIME &sysTime) |
| Get the time using SYSTEMTIME structure. | |
Protected Member Functions | |
| virtual SWindow * | GetDropDownOwner () |
| Get the owner window for the dropdown. | |
| virtual void | OnCreateDropDown (SDropDownWnd *pDropDown) |
| Handle creation of the dropdown window. | |
| virtual void | OnDestroyDropDown (SDropDownWnd *pDropDown) |
| Handle destruction of the dropdown window. | |
| EnDateType | HitTest (CPoint pt) |
| Hit test to determine the date type at a given point. | |
| virtual BOOL | CreateChildren (SXmlNode xmlNode) |
| Create child controls. | |
| BOOL | OnDateChanged (EventCalendarExChanged *pEvt) |
| Handle date change event. | |
| BOOL | OnDateCmd (EventCmd *pEvt) |
| Handle date command event. | |
| void | GetDropBtnRect (LPRECT pBtnRc, LPRECT pSkinRc=NULL) |
| Get the rectangle of the dropdown button. | |
| SStringT | ToFormatText (EnDateType eType, WORD wNum) |
| Convert a number to formatted text based on the date type. | |
| bool | CalcPopupRect (int nHeight, CRect &rcPopup) |
| Calculate the popup rectangle. | |
| void | Draw (EnDateType eType, IRenderTarget *pRT, WORD wNum, CRect &rcText) |
| Draw the date/time component. | |
| void | OnPaint (IRenderTarget *pRT) |
| Paint the control. | |
| void | OnLButtonDown (UINT nFlags, CPoint pt) |
| Handle left mouse button down event. | |
| void | OnMouseMove (UINT nFlags, CPoint pt) |
| Handle mouse move event. | |
| void | OnMouseLeave () |
| Handle mouse leave event. | |
| BOOL | OnMouseWheel (UINT nFlags, short zDelta, CPoint pt) |
| Handle mouse wheel event. | |
| void | OnKeyDown (TCHAR nChar, UINT nRepCnt, UINT nFlags) |
| Handle key down event. | |
| void | OnChar (UINT nChar, UINT nRepCnt, UINT nFlags) |
| Handle character input event. | |
| void | OnDestroy () |
| Handle destroy event. | |
| void | OnSetFocus (SWND wndOld) |
| Handle set focus event. | |
| void | OnKillFocus (SWND wndFocus) |
| Handle kill focus event. | |
| void | TimeWheel (bool bUp) |
| Handle time wheel event. | |
| void | CircluNum (bool bUp, WORD &wNum, WORD wMin, WORD wMax) |
| Handle circular number increment/decrement. | |
| HRESULT | OnAttrCueText (const SStringW &strValue, BOOL bLoading) |
| Handle custom attribute "cueText". | |
| virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
Protected Attributes | |
| DWORD | m_dwBtnState |
| SAutoRefPtr< ISkinObj > | m_pSkinBtn |
| SDropDownWnd * | m_pDropDownWnd |
| EnDateType | m_eSelDateType |
| int | m_nNumWidth |
| int | m_nNumHeight |
| int | m_nCharWidth |
| COLORREF | m_crSelBg |
| COLORREF | m_crSelText |
| SYSTEMTIME | m_sysTime |
| SStringT | m_sKey |
| int | m_nDropWidth |
| bool | m_bTimeEnable |
| SCalendar * | m_pCalendar |
| WORD | m_wCharNum |
| STrText | m_strCue |
| COLORREF | m_crCue |
DateTime Picker Control.
A DateTime picker control that allows users to select a date and optionally time.
Definition at line 17 of file SDateTimePicker.h.
Enumeration for date types.
Definition at line 27 of file SDateTimePicker.h.
| SNSBEGIN SDateTimePicker::SDateTimePicker | ( | ) |
Constructor.
Definition at line 6 of file SDateTimePicker.cpp.
| SDateTimePicker::~SDateTimePicker | ( | ) |
Destructor.
Definition at line 34 of file SDateTimePicker.cpp.
|
protected |
Calculate the popup rectangle.
| nHeight | Height of the popup |
| rcPopup | Output rectangle for the popup |
Definition at line 288 of file SDateTimePicker.cpp.
|
protected |
Handle circular number increment/decrement.
| bUp | Whether to increment |
| wNum | Current number |
| wMin | Minimum number |
| wMax | Maximum number |
Definition at line 526 of file SDateTimePicker.cpp.
| void SDateTimePicker::Clear | ( | ) |
Clear the selected date and time.
Definition at line 676 of file SDateTimePicker.cpp.
| void SDateTimePicker::CloseUp | ( | ) |
Close the dropdown.
Definition at line 664 of file SDateTimePicker.cpp.
|
protectedvirtual |
Create child controls.
| xmlNode | XML node for the child controls |
Reimplemented from SWindow.
Definition at line 44 of file SDateTimePicker.cpp.
|
protected |
Draw the date/time component.
| eType | Date type |
| pRT | Rendering target handle |
| wNum | Number to draw |
| rcText | Rectangle for the text |
Definition at line 178 of file SDateTimePicker.cpp.
| void SDateTimePicker::DropDown | ( | ) |
Drop down the list.
Definition at line 690 of file SDateTimePicker.cpp.
|
protected |
Get the rectangle of the dropdown button.
| pBtnRc | Output rectangle for the button |
| pSkinRc | Output rectangle for the skin |
Definition at line 121 of file SDateTimePicker.cpp.
|
protectedvirtual |
Get the owner window for the dropdown.
Implements ISDropDownOwner.
Definition at line 87 of file SDateTimePicker.cpp.
| void SDateTimePicker::GetTime | ( | SYSTEMTIME & | sysTime | ) |
Get the time using SYSTEMTIME structure.
| sysTime | SYSTEMTIME structure |
Definition at line 375 of file SDateTimePicker.cpp.
| void SDateTimePicker::GetTime | ( | WORD * | wYear, |
| WORD * | wMonth, | ||
| WORD * | wDay, | ||
| WORD * | wHour, | ||
| WORD * | wMinute, | ||
| WORD * | wSecond ) |
Get the time.
| wYear | Output year |
| wMonth | Output month |
| wDay | Output day |
| wHour | Output hour |
| wMinute | Output minute |
| wSecond | Output second |
|
virtual |
Get the window text.
| bRawText | Whether to get raw text |
Reimplemented from SWindow.
Definition at line 396 of file SDateTimePicker.cpp.
|
protected |
Hit test to determine the date type at a given point.
| pt | Mouse coordinates |
Definition at line 322 of file SDateTimePicker.cpp.
|
protected |
Handle custom attribute "cueText".
| strValue | Attribute value |
| bLoading | Loading flag |
Definition at line 682 of file SDateTimePicker.cpp.
|
protected |
Handle character input event.
| nChar | Character code |
| nRepCnt | Repeat count |
| nFlags | Flags |
Definition at line 570 of file SDateTimePicker.cpp.
|
protectedvirtual |
Handle creation of the dropdown window.
| pDropDown | Dropdown window pointer |
Implements ISDropDownOwner.
Definition at line 92 of file SDateTimePicker.cpp.
|
protected |
Handle date change event.
| pEvt | Event object |
Definition at line 63 of file SDateTimePicker.cpp.
|
protected |
Handle date command event.
| pEvt | Event object |
Definition at line 81 of file SDateTimePicker.cpp.
|
protected |
Handle destroy event.
Definition at line 641 of file SDateTimePicker.cpp.
|
protectedvirtual |
Handle destruction of the dropdown window.
| pDropDown | Dropdown window pointer |
Implements ISDropDownOwner.
Definition at line 110 of file SDateTimePicker.cpp.
|
protected |
Handle key down event.
| nChar | Key code |
| nRepCnt | Repeat count |
| nFlags | Flags |
Definition at line 544 of file SDateTimePicker.cpp.
|
protected |
Handle kill focus event.
| wndFocus | New focus window handle |
Definition at line 652 of file SDateTimePicker.cpp.
|
protected |
Handle left mouse button down event.
| nFlags | Flags |
| pt | Mouse coordinates |
Definition at line 407 of file SDateTimePicker.cpp.
|
protected |
Handle mouse leave event.
Definition at line 455 of file SDateTimePicker.cpp.
|
protected |
Handle mouse move event.
| nFlags | Flags |
| pt | Mouse coordinates |
Definition at line 433 of file SDateTimePicker.cpp.
|
protected |
Handle mouse wheel event.
| nFlags | Flags |
| zDelta | Wheel delta |
| pt | Mouse coordinates |
Definition at line 473 of file SDateTimePicker.cpp.
|
protected |
Paint the control.
| pRT | Rendering target handle |
Definition at line 196 of file SDateTimePicker.cpp.
|
protected |
Handle set focus event.
| wndOld | Previous focus window handle |
Definition at line 647 of file SDateTimePicker.cpp.
|
inlineprotectedvirtual |
Reimplemented from SWindow.
Definition at line 279 of file SDateTimePicker.h.
| void SDateTimePicker::SetTime | ( | const SYSTEMTIME & | sysTime | ) |
Set the time using SYSTEMTIME structure.
| sysTime | SYSTEMTIME structure |
Definition at line 358 of file SDateTimePicker.cpp.
| void SDateTimePicker::SetTime | ( | WORD | wYear, |
| WORD | wMonth, | ||
| WORD | wDay, | ||
| WORD | wHour, | ||
| WORD | wMinute, | ||
| WORD | wSecond ) |
Set the time.
| wYear | Year |
| wMonth | Month |
| wDay | Day |
| wHour | Hour |
| wMinute | Minute |
| wSecond | Second |
Definition at line 364 of file SDateTimePicker.cpp.
|
protected |
Handle time wheel event.
| bUp | Whether the wheel is scrolled up |
Definition at line 479 of file SDateTimePicker.cpp.
|
protected |
Convert a number to formatted text based on the date type.
| eType | Date type |
| wNum | Number to format |
Definition at line 139 of file SDateTimePicker.cpp.
|
protected |
Whether time (hour, minute, second) is enabled
Definition at line 314 of file SDateTimePicker.h.
|
protected |
Cue text color
Definition at line 318 of file SDateTimePicker.h.
|
protected |
Selection background color
Definition at line 308 of file SDateTimePicker.h.
|
protected |
Selection text color
Definition at line 309 of file SDateTimePicker.h.
|
protected |
Button state
Definition at line 301 of file SDateTimePicker.h.
|
protected |
Selected date type
Definition at line 304 of file SDateTimePicker.h.
|
protected |
Width of character display
Definition at line 307 of file SDateTimePicker.h.
|
protected |
Dropdown width
Definition at line 313 of file SDateTimePicker.h.
|
protected |
Height of number display
Definition at line 306 of file SDateTimePicker.h.
|
protected |
Width of number display
Definition at line 305 of file SDateTimePicker.h.
|
protected |
Calendar pointer
Definition at line 315 of file SDateTimePicker.h.
|
protected |
Dropdown window pointer
Definition at line 303 of file SDateTimePicker.h.
|
protected |
Button skin object
Definition at line 302 of file SDateTimePicker.h.
|
protected |
Key string
Definition at line 311 of file SDateTimePicker.h.
|
protected |
Cue text
Definition at line 317 of file SDateTimePicker.h.
|
protected |
System time
Definition at line 310 of file SDateTimePicker.h.
|
protected |
Character number
Definition at line 316 of file SDateTimePicker.h.