added and implemented for MSW wxDP_SHOWCENTURY flag
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,6 +42,9 @@ calendar drop down part from which the user can select a date.}
|
||||
\twocolitem{\windowstyle{wxDP\_DEFAULT}}{Creates a control with default style
|
||||
which is the best supported for the current platform (currently wxDP\_SPIN
|
||||
under Windows and wxDP\_DROPDOWN elsewhere).}
|
||||
\twocolitem{\windowstyle{wxDP\_SHOWCENTURY}}{Forces display of the century in
|
||||
the default date format. Without this flas the century could be displayed or
|
||||
not depending on the default date representation in the system.}
|
||||
\end{twocollist}
|
||||
|
||||
\wxheading{Event handling}
|
||||
@@ -67,7 +70,7 @@ changes the current selection in the control.}
|
||||
\param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
|
||||
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
||||
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
||||
\param{long}{ style = wxDP\_DEFAULT},\rtfsp
|
||||
\param{long}{ style = wxDP\_DEFAULT | wxDP\_SHOWCENTURY},\rtfsp
|
||||
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
||||
\param{const wxString\& }{name = ``datectrl"}}
|
||||
|
||||
@@ -82,7 +85,7 @@ all the parameters.
|
||||
\param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
|
||||
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
||||
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
||||
\param{long}{ style = wxDP\_DEFAULT},\rtfsp
|
||||
\param{long}{ style = wxDP\_DEFAULT | wxDP\_SHOWCENTURY},\rtfsp
|
||||
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
||||
\param{const wxString\& }{name = ``datectrl"}}
|
||||
|
||||
|
@@ -27,7 +27,11 @@ enum
|
||||
wxDP_SPIN = 1,
|
||||
|
||||
// a combobox-like date picker (not supported in mac version)
|
||||
wxDP_DROPDOWN = 2
|
||||
wxDP_DROPDOWN = 2,
|
||||
|
||||
// always show century in the default date display (otherwise it depends on
|
||||
// the system date format which may include the century or not)
|
||||
wxDP_SHOWCENTURY = 4
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -46,7 +50,7 @@ public:
|
||||
const wxDateTime& dt = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDP_DEFAULT,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDatePickerCtrlNameStr);
|
||||
*/
|
||||
|
@@ -26,16 +26,16 @@ public:
|
||||
const wxDateTime& date = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxString& name = wxDatePickerCtrlNameStr);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& date,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name=wxDatePickerCtrlNameStr);
|
||||
wxWindowID id,
|
||||
const wxDateTime& date = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxString& name = wxDatePickerCtrlNameStr);
|
||||
|
||||
// wxDatePickerCtrl methods
|
||||
void SetValue(const wxDateTime& date);
|
||||
|
@@ -27,7 +27,7 @@ public:
|
||||
const wxDateTime& dt = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDatePickerCtrlNameStr)
|
||||
{
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
const wxDateTime& dt = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDatePickerCtrlNameStr);
|
||||
|
||||
|
@@ -146,7 +146,12 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
styleMSW |= DTS_UPDOWN;
|
||||
//else: drop down by default
|
||||
|
||||
styleMSW |= DTS_SHORTDATEFORMAT;
|
||||
#ifdef DTS_SHORTDATECENTURYFORMAT
|
||||
if ( style & wxDP_SHOWCENTURY )
|
||||
styleMSW |= DTS_SHORTDATECENTURYFORMAT;
|
||||
else
|
||||
#endif // DTS_SHORTDATECENTURYFORMAT
|
||||
styleMSW |= DTS_SHORTDATEFORMAT;
|
||||
|
||||
return styleMSW;
|
||||
}
|
||||
|
Reference in New Issue
Block a user