added wxDP_SPIN/DROPDOWN styles (only Win32 native version implements the former)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -30,6 +30,19 @@ the platform.
|
|||||||
|
|
||||||
(only available if \texttt{wxUSE\_DATEPICKCTRL} is set to $1$)
|
(only available if \texttt{wxUSE\_DATEPICKCTRL} is set to $1$)
|
||||||
|
|
||||||
|
\wxheading{Window styles}
|
||||||
|
|
||||||
|
\twocolwidtha{5cm}%
|
||||||
|
\begin{twocollist}\itemsep=0pt
|
||||||
|
\twocolitem{\windowstyle{wxDP\_SPIN}}{Creates a control without month calendar
|
||||||
|
drop down but with spin control-like arrows to change individual date
|
||||||
|
components. This style is not supported by the generic version.}
|
||||||
|
\twocolitem{\windowstyle{wxDP\_DROPDOWN}}{Creates a control with a month
|
||||||
|
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.}
|
||||||
|
\end{twocollist}
|
||||||
|
|
||||||
\wxheading{Event handling}
|
\wxheading{Event handling}
|
||||||
|
|
||||||
\twocolwidtha{7cm}%
|
\twocolwidtha{7cm}%
|
||||||
@@ -53,7 +66,7 @@ changes the current selection in the control.}
|
|||||||
\param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
|
\param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
|
||||||
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
||||||
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
||||||
\param{long}{ style = 0},\rtfsp
|
\param{long}{ style = wxDP\_DEFAULT},\rtfsp
|
||||||
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
||||||
\param{const wxString\& }{name = ``datectrl"}}
|
\param{const wxString\& }{name = ``datectrl"}}
|
||||||
|
|
||||||
@@ -68,7 +81,7 @@ all the parameters.
|
|||||||
\param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
|
\param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
|
||||||
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
||||||
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
||||||
\param{long}{ style = 0},\rtfsp
|
\param{long}{ style = wxDP\_DEFAULT},\rtfsp
|
||||||
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
||||||
\param{const wxString\& }{name = ``datectrl"}}
|
\param{const wxString\& }{name = ``datectrl"}}
|
||||||
|
|
||||||
|
@@ -17,6 +17,19 @@
|
|||||||
|
|
||||||
#define wxDatePickerCtrlNameStr _T("datectrl")
|
#define wxDatePickerCtrlNameStr _T("datectrl")
|
||||||
|
|
||||||
|
// wxDatePickerCtrl styles
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
// default style on this platform, either wxDP_SPIN or wxDP_DROPDOWN
|
||||||
|
wxDP_DEFAULT = 0,
|
||||||
|
|
||||||
|
// a spin control-like date picker (not supported in generic version)
|
||||||
|
wxDP_SPIN = 1,
|
||||||
|
|
||||||
|
// a combobox-like date picker (not supported in mac version)
|
||||||
|
wxDP_DROPDOWN = 2
|
||||||
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxDatePickerCtrl: allow the user to enter the date
|
// wxDatePickerCtrl: allow the user to enter the date
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -33,7 +46,7 @@ public:
|
|||||||
const wxDateTime& dt = wxDefaultDateTime,
|
const wxDateTime& dt = wxDefaultDateTime,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = wxDP_DEFAULT,
|
||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxDatePickerCtrlNameStr);
|
const wxString& name = wxDatePickerCtrlNameStr);
|
||||||
*/
|
*/
|
||||||
|
@@ -79,6 +79,9 @@ bool wxDatePickerCtrl::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
|
wxASSERT_MSG( !(style & wxDP_SPIN),
|
||||||
|
_T("wxDP_SPIN style not supported, use wxDP_DEFAULT") );
|
||||||
|
|
||||||
wxString txt;
|
wxString txt;
|
||||||
if (date.IsValid())
|
if (date.IsValid())
|
||||||
txt = date.FormatDate();
|
txt = date.FormatDate();
|
||||||
|
@@ -100,9 +100,11 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
|||||||
{
|
{
|
||||||
WXDWORD styleMSW = wxDatePickerCtrlBase::MSWGetStyle(style, exstyle);
|
WXDWORD styleMSW = wxDatePickerCtrlBase::MSWGetStyle(style, exstyle);
|
||||||
|
|
||||||
// for now this is unconditional, but we should support drop down control
|
if ( style & wxDP_SPIN )
|
||||||
// style as well later
|
styleMSW |= DTS_UPDOWN;
|
||||||
styleMSW |= DTS_UPDOWN | DTS_SHORTDATEFORMAT;
|
//else: drop down by default
|
||||||
|
|
||||||
|
styleMSW |= DTS_SHORTDATEFORMAT;
|
||||||
|
|
||||||
return styleMSW;
|
return styleMSW;
|
||||||
}
|
}
|
||||||
@@ -226,3 +228,4 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_DATEPICKCTRL
|
#endif // wxUSE_DATEPICKCTRL
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user