added wxConvUI which determines the conversion used for the UI elements and can be changed from the user code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,6 +32,11 @@ There are several predefined instances of this class:
|
|||||||
current locale.}
|
current locale.}
|
||||||
\twocolitem{\textbf{wxConvLocal}}{Another conversion corresponding to the
|
\twocolitem{\textbf{wxConvLocal}}{Another conversion corresponding to the
|
||||||
current locale but this one uses the best available conversion.}
|
current locale but this one uses the best available conversion.}
|
||||||
|
\twocolitem{\textbf{wxConvUI}}{The conversion used for hte standard UI elements
|
||||||
|
such as menu items and buttons. This is a pointer which is initially set to
|
||||||
|
\texttt{wxConvLocal} as the program uses the current locale by default but can
|
||||||
|
be set to some specific conversion if the program needs to use a specific
|
||||||
|
encoding for its UI.}
|
||||||
\twocolitem{\textbf{wxConvISO8859\_1}}{Conversion to and from ISO-8859-1 (Latin I)
|
\twocolitem{\textbf{wxConvISO8859\_1}}{Conversion to and from ISO-8859-1 (Latin I)
|
||||||
encoding.}
|
encoding.}
|
||||||
\twocolitem{\textbf{wxConvUTF8}}{Conversion to and from UTF-8 encoding.}
|
\twocolitem{\textbf{wxConvUTF8}}{Conversion to and from UTF-8 encoding.}
|
||||||
|
@@ -438,6 +438,12 @@ extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent;
|
|||||||
// the conversion corresponding to the current locale
|
// the conversion corresponding to the current locale
|
||||||
extern WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvLocal;
|
extern WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvLocal;
|
||||||
|
|
||||||
|
// the conversion corresponding to the encoding of the standard UI elements
|
||||||
|
//
|
||||||
|
// by default this is the same as wxConvLocal but may be changed if the program
|
||||||
|
// needs to use a fixed encoding
|
||||||
|
extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvUI;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// endianness-dependent conversions
|
// endianness-dependent conversions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -3395,6 +3395,7 @@ WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvISO8859_1 = wxConvISO8859_1Obj;
|
|||||||
WXDLLIMPEXP_DATA_BASE(wxMBConvUTF7&) wxConvUTF7 = wxConvUTF7Obj;
|
WXDLLIMPEXP_DATA_BASE(wxMBConvUTF7&) wxConvUTF7 = wxConvUTF7Obj;
|
||||||
WXDLLIMPEXP_DATA_BASE(wxMBConvUTF8&) wxConvUTF8 = wxConvUTF8Obj;
|
WXDLLIMPEXP_DATA_BASE(wxMBConvUTF8&) wxConvUTF8 = wxConvUTF8Obj;
|
||||||
WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent = &wxConvLibcObj;
|
WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent = &wxConvLibcObj;
|
||||||
|
WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvUI = &wxConvLocal;
|
||||||
WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvFileName = &
|
WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvFileName = &
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
wxConvUTF8Obj;
|
wxConvUTF8Obj;
|
||||||
@@ -3402,7 +3403,6 @@ WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvFileName = &
|
|||||||
wxConvLibcObj;
|
wxConvLibcObj;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#else // !wxUSE_WCHAR_T
|
#else // !wxUSE_WCHAR_T
|
||||||
|
|
||||||
// stand-ins in absence of wchar_t
|
// stand-ins in absence of wchar_t
|
||||||
|
@@ -193,7 +193,7 @@ wxCharBuffer wxConvertToGTK(const wxString& s, wxFontEncoding enc)
|
|||||||
wxWCharBuffer wbuf;
|
wxWCharBuffer wbuf;
|
||||||
if ( enc == wxFONTENCODING_SYSTEM || enc == wxFONTENCODING_DEFAULT )
|
if ( enc == wxFONTENCODING_SYSTEM || enc == wxFONTENCODING_DEFAULT )
|
||||||
{
|
{
|
||||||
wbuf = wxConvLocal.cMB2WC(s);
|
wbuf = wxConvUI->cMB2WC(s);
|
||||||
}
|
}
|
||||||
else // another encoding, use generic conversion class
|
else // another encoding, use generic conversion class
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user