Unicode fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,7 +31,7 @@ wxResourceCache *wxTheResourceCache = (wxResourceCache *) NULL;
|
|||||||
XrmDatabase wxResourceDatabase;
|
XrmDatabase wxResourceDatabase;
|
||||||
|
|
||||||
/* Useful buffer, initialized in wxCommonInit */
|
/* Useful buffer, initialized in wxCommonInit */
|
||||||
char *wxBuffer = (char *) NULL;
|
wxChar *wxBuffer = (wxChar *) NULL;
|
||||||
|
|
||||||
/* Windows List */
|
/* Windows List */
|
||||||
wxWindowList wxTopLevelWindows;
|
wxWindowList wxTopLevelWindows;
|
||||||
|
@@ -401,7 +401,7 @@ GdkAtom wxDropTarget::GetMatchingPair()
|
|||||||
wxDataFormat format( formatAtom );
|
wxDataFormat format( formatAtom );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
wxLogDebug("Drop target: drag has format: %s", format.GetId().c_str() );
|
wxLogDebug( wxT("Drop target: drag has format: %s"), format.GetId().c_str() );
|
||||||
#endif // Debug
|
#endif // Debug
|
||||||
|
|
||||||
if (m_dataObject->IsSupportedFormat( format ))
|
if (m_dataObject->IsSupportedFormat( format ))
|
||||||
|
@@ -165,7 +165,7 @@ void wxSpinCtrl::SetValue( const wxString& value )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// invalid number - set text as is (wxMSW compatible)
|
// invalid number - set text as is (wxMSW compatible)
|
||||||
gtk_entry_set_text( GTK_ENTRY(m_widget), value.c_str() );
|
gtk_entry_set_text( GTK_ENTRY(m_widget), value.mbc_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ wxResourceCache *wxTheResourceCache = (wxResourceCache *) NULL;
|
|||||||
XrmDatabase wxResourceDatabase;
|
XrmDatabase wxResourceDatabase;
|
||||||
|
|
||||||
/* Useful buffer, initialized in wxCommonInit */
|
/* Useful buffer, initialized in wxCommonInit */
|
||||||
char *wxBuffer = (char *) NULL;
|
wxChar *wxBuffer = (wxChar *) NULL;
|
||||||
|
|
||||||
/* Windows List */
|
/* Windows List */
|
||||||
wxWindowList wxTopLevelWindows;
|
wxWindowList wxTopLevelWindows;
|
||||||
|
@@ -401,7 +401,7 @@ GdkAtom wxDropTarget::GetMatchingPair()
|
|||||||
wxDataFormat format( formatAtom );
|
wxDataFormat format( formatAtom );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
wxLogDebug("Drop target: drag has format: %s", format.GetId().c_str() );
|
wxLogDebug( wxT("Drop target: drag has format: %s"), format.GetId().c_str() );
|
||||||
#endif // Debug
|
#endif // Debug
|
||||||
|
|
||||||
if (m_dataObject->IsSupportedFormat( format ))
|
if (m_dataObject->IsSupportedFormat( format ))
|
||||||
|
@@ -165,7 +165,7 @@ void wxSpinCtrl::SetValue( const wxString& value )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// invalid number - set text as is (wxMSW compatible)
|
// invalid number - set text as is (wxMSW compatible)
|
||||||
gtk_entry_set_text( GTK_ENTRY(m_widget), value.c_str() );
|
gtk_entry_set_text( GTK_ENTRY(m_widget), value.mbc_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -212,7 +212,7 @@ public:
|
|||||||
{ m_started = TRUE; return wxTimer::Start(millisecs, FALSE); }
|
{ m_started = TRUE; return wxTimer::Start(millisecs, FALSE); }
|
||||||
|
|
||||||
virtual void Notify()
|
virtual void Notify()
|
||||||
{ wxLogTrace("Checking dial up network status."); m_dupman->CheckStatus(); }
|
{ wxLogTrace(wxT("Checking dial up network status.")); m_dupman->CheckStatus(); }
|
||||||
|
|
||||||
virtual void Stop()
|
virtual void Stop()
|
||||||
{ if ( m_started ) wxTimer::Stop(); }
|
{ if ( m_started ) wxTimer::Stop(); }
|
||||||
@@ -281,7 +281,7 @@ wxDialUpManagerImpl::Dial(const wxString &isp,
|
|||||||
m_IsOnline = -1;
|
m_IsOnline = -1;
|
||||||
m_ISPname = isp;
|
m_ISPname = isp;
|
||||||
wxString cmd;
|
wxString cmd;
|
||||||
if(m_ConnectCommand.Find("%s"))
|
if(m_ConnectCommand.Find(wxT("%s")))
|
||||||
cmd.Printf(m_ConnectCommand,m_ISPname.c_str());
|
cmd.Printf(m_ConnectCommand,m_ISPname.c_str());
|
||||||
else
|
else
|
||||||
cmd = m_ConnectCommand;
|
cmd = m_ConnectCommand;
|
||||||
@@ -315,7 +315,7 @@ wxDialUpManagerImpl::HangUp(void)
|
|||||||
}
|
}
|
||||||
m_IsOnline = -1;
|
m_IsOnline = -1;
|
||||||
wxString cmd;
|
wxString cmd;
|
||||||
if(m_HangUpCommand.Find("%s"))
|
if(m_HangUpCommand.Find(wxT("%s")))
|
||||||
cmd.Printf(m_HangUpCommand,m_ISPname.c_str(), m_DialProcess);
|
cmd.Printf(m_HangUpCommand,m_ISPname.c_str(), m_DialProcess);
|
||||||
else
|
else
|
||||||
cmd = m_HangUpCommand;
|
cmd = m_HangUpCommand;
|
||||||
@@ -361,11 +361,11 @@ void
|
|||||||
wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno)
|
wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno)
|
||||||
{
|
{
|
||||||
/// does hostname contain a port number?
|
/// does hostname contain a port number?
|
||||||
wxString port = hostname.After(':');
|
wxString port = hostname.After(wxT(':'));
|
||||||
if(port.Length())
|
if(port.Length())
|
||||||
{
|
{
|
||||||
m_BeaconHost = hostname.Before(':');
|
m_BeaconHost = hostname.Before(wxT(':'));
|
||||||
m_BeaconPort = atoi(port);
|
m_BeaconPort = wxAtoi(port);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -470,7 +470,7 @@ wxDialUpManagerImpl::CheckStatusInternal(void)
|
|||||||
struct sockaddr_in serv_addr;
|
struct sockaddr_in serv_addr;
|
||||||
|
|
||||||
m_IsOnline = 0; // assume false
|
m_IsOnline = 0; // assume false
|
||||||
if((hp = gethostbyname(m_BeaconHost)) == NULL)
|
if((hp = gethostbyname(m_BeaconHost.mb_str())) == NULL)
|
||||||
return; // no DNS no net
|
return; // no DNS no net
|
||||||
|
|
||||||
serv_addr.sin_family = hp->h_addrtype;
|
serv_addr.sin_family = hp->h_addrtype;
|
||||||
|
@@ -62,7 +62,7 @@ static char **CreateFontList(wxChar spacing, int *nFonts)
|
|||||||
pattern.Printf(wxT("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing);
|
pattern.Printf(wxT("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing);
|
||||||
|
|
||||||
// get the list of all fonts
|
// get the list of all fonts
|
||||||
return XListFonts((Display *)wxGetDisplay(), pattern, 32767, nFonts);
|
return XListFonts((Display *)wxGetDisplay(), pattern.mb_str(), 32767, nFonts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ProcessFamiliesFromFontList(wxFontEnumerator *This,
|
static bool ProcessFamiliesFromFontList(wxFontEnumerator *This,
|
||||||
@@ -74,7 +74,7 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This,
|
|||||||
for ( int n = 0; n < nFonts; n++ )
|
for ( int n = 0; n < nFonts; n++ )
|
||||||
{
|
{
|
||||||
char *font = fonts[n];
|
char *font = fonts[n];
|
||||||
if ( !wxString(font).Matches("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") )
|
if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) )
|
||||||
{
|
{
|
||||||
// it's not a full font name (probably an alias)
|
// it's not a full font name (probably an alias)
|
||||||
continue;
|
continue;
|
||||||
@@ -84,16 +84,17 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This,
|
|||||||
char *family = dash + 1;
|
char *family = dash + 1;
|
||||||
dash = strchr(family, '-');
|
dash = strchr(family, '-');
|
||||||
*dash = '\0'; // !NULL because Matches() above succeeded
|
*dash = '\0'; // !NULL because Matches() above succeeded
|
||||||
|
wxString fam(family);
|
||||||
|
|
||||||
if ( families.Index(family) == wxNOT_FOUND )
|
if ( families.Index(fam) == wxNOT_FOUND )
|
||||||
{
|
{
|
||||||
if ( !This->OnFontFamily(family) )
|
if ( !This->OnFontFamily(fam) )
|
||||||
{
|
{
|
||||||
// stop enumerating
|
// stop enumerating
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
families.Add(family);
|
families.Add(fam);
|
||||||
}
|
}
|
||||||
//else: already seen
|
//else: already seen
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
|
|||||||
|
|
||||||
// get the list of all fonts
|
// get the list of all fonts
|
||||||
int nFonts;
|
int nFonts;
|
||||||
char **fonts = XListFonts((Display *)wxGetDisplay(), pattern,
|
char **fonts = XListFonts((Display *)wxGetDisplay(), pattern.mb_str(),
|
||||||
32767, &nFonts);
|
32767, &nFonts);
|
||||||
|
|
||||||
if ( !fonts )
|
if ( !fonts )
|
||||||
@@ -173,7 +174,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
|
|||||||
for ( int n = 0; n < nFonts; n++ )
|
for ( int n = 0; n < nFonts; n++ )
|
||||||
{
|
{
|
||||||
char *font = fonts[n];
|
char *font = fonts[n];
|
||||||
if ( !wxString(font).Matches("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") )
|
if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) )
|
||||||
{
|
{
|
||||||
// it's not a full font name (probably an alias)
|
// it's not a full font name (probably an alias)
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user