Fix wxMSW build when wxUSE_INTL==0.
Don't use wxLocaleInfo in this case as it's not defined. Closes #15599. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -54,7 +54,9 @@ public:
|
|||||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#if wxUSE_INTL
|
||||||
virtual wxLocaleInfo MSWGetFormat() const;
|
virtual wxLocaleInfo MSWGetFormat() const;
|
||||||
|
#endif // wxUSE_INTL
|
||||||
virtual bool MSWAllowsNone() const { return HasFlag(wxDP_ALLOWNONE); }
|
virtual bool MSWAllowsNone() const { return HasFlag(wxDP_ALLOWNONE); }
|
||||||
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch);
|
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch);
|
||||||
|
|
||||||
|
@@ -55,12 +55,14 @@ protected:
|
|||||||
// override these methods anyhow, it does work -- but is definitely ugly
|
// override these methods anyhow, it does work -- but is definitely ugly
|
||||||
// and need to be changed (but how?) in the future.
|
// and need to be changed (but how?) in the future.
|
||||||
|
|
||||||
|
#if wxUSE_INTL
|
||||||
// Override to return the date/time format used by this control.
|
// Override to return the date/time format used by this control.
|
||||||
virtual wxLocaleInfo MSWGetFormat() const /* = 0 */
|
virtual wxLocaleInfo MSWGetFormat() const /* = 0 */
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( "Unreachable" );
|
wxFAIL_MSG( "Unreachable" );
|
||||||
return wxLOCALE_TIME_FMT;
|
return wxLOCALE_TIME_FMT;
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_INTL
|
||||||
|
|
||||||
// Override to indicate whether we can have no date at all.
|
// Override to indicate whether we can have no date at all.
|
||||||
virtual bool MSWAllowsNone() const /* = 0 */
|
virtual bool MSWAllowsNone() const /* = 0 */
|
||||||
|
@@ -50,7 +50,9 @@ public:
|
|||||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#if wxUSE_INTL
|
||||||
virtual wxLocaleInfo MSWGetFormat() const;
|
virtual wxLocaleInfo MSWGetFormat() const;
|
||||||
|
#endif // wxUSE_INTL
|
||||||
virtual bool MSWAllowsNone() const { return false; }
|
virtual bool MSWAllowsNone() const { return false; }
|
||||||
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch);
|
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch);
|
||||||
|
|
||||||
|
@@ -91,11 +91,15 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
|||||||
|
|
||||||
// TODO: handle WM_WININICHANGE
|
// TODO: handle WM_WININICHANGE
|
||||||
|
|
||||||
|
#if wxUSE_INTL
|
||||||
|
|
||||||
wxLocaleInfo wxDatePickerCtrl::MSWGetFormat() const
|
wxLocaleInfo wxDatePickerCtrl::MSWGetFormat() const
|
||||||
{
|
{
|
||||||
return wxLOCALE_SHORT_DATE_FMT;
|
return wxLOCALE_SHORT_DATE_FMT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_INTL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxDatePickerCtrl operations
|
// wxDatePickerCtrl operations
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -110,8 +110,12 @@ wxSize wxDateTimePickerCtrl::DoGetBestSize() const
|
|||||||
{
|
{
|
||||||
wxClientDC dc(const_cast<wxDateTimePickerCtrl *>(this));
|
wxClientDC dc(const_cast<wxDateTimePickerCtrl *>(this));
|
||||||
|
|
||||||
// Use the same native format as this as the underlying native control.
|
// Use the same native format as the underlying native control.
|
||||||
|
#if wxUSE_INTL
|
||||||
wxString s = wxDateTime::Now().Format(wxLocale::GetInfo(MSWGetFormat()));
|
wxString s = wxDateTime::Now().Format(wxLocale::GetInfo(MSWGetFormat()));
|
||||||
|
#else // !wxUSE_INTL
|
||||||
|
wxString s("XXX-YYY-ZZZZ");
|
||||||
|
#endif // wxUSE_INTL/!wxUSE_INTL
|
||||||
|
|
||||||
// the best size for the control is bigger than just the string
|
// the best size for the control is bigger than just the string
|
||||||
// representation of the current value because the control must accommodate
|
// representation of the current value because the control must accommodate
|
||||||
|
@@ -45,11 +45,15 @@ WXDWORD wxTimePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
|||||||
return styleMSW;
|
return styleMSW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_INTL
|
||||||
|
|
||||||
wxLocaleInfo wxTimePickerCtrl::MSWGetFormat() const
|
wxLocaleInfo wxTimePickerCtrl::MSWGetFormat() const
|
||||||
{
|
{
|
||||||
return wxLOCALE_TIME_FMT;
|
return wxLOCALE_TIME_FMT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_INTL
|
||||||
|
|
||||||
bool wxTimePickerCtrl::MSWOnDateTimeChange(const NMDATETIMECHANGE& dtch)
|
bool wxTimePickerCtrl::MSWOnDateTimeChange(const NMDATETIMECHANGE& dtch)
|
||||||
{
|
{
|
||||||
m_date.SetFromMSWSysTime(dtch.st);
|
m_date.SetFromMSWSysTime(dtch.st);
|
||||||
|
Reference in New Issue
Block a user