Add wxLocale::GetOSInfo() and use it in MSW wxDateTimePickerCtrl.

This fixes the size of wxDateTimePickerCtrl in programs that don't set any
specific locale: previously, the standard "%m/%d/%y" format was used for
computing the best size of the control in this case, but this could have been
significantly shorter than the format actually used (compare with the default
"%d %b, %Y"), resulting in the control contents being truncated by default.

GetOSInfo() is currently different from GetInfo() only under MSW, but we might
need to make the same distinction under OS X too, so do make this function
public instead of keeping it MSW-specific.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-05 22:17:13 +00:00
parent 8a00553fda
commit 9fc78c8167
4 changed files with 105 additions and 55 deletions

View File

@@ -112,7 +112,7 @@ wxSize wxDateTimePickerCtrl::DoGetBestSize() const
// 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::GetOSInfo(MSWGetFormat()));
#else // !wxUSE_INTL
wxString s("XXX-YYY-ZZZZ");
#endif // wxUSE_INTL/!wxUSE_INTL