Unicode compilation fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-11-09 00:26:54 +00:00
parent 867be82e3a
commit 6fb39fe84b
20 changed files with 51 additions and 51 deletions

View File

@@ -151,10 +151,10 @@ enum wxStockCursor
#ifdef __WXMSW__
// Load from a resource
#define wxICON(X) wxIcon("" #X "")
#define wxICON(X) wxIcon(wxT(#X))
#elif defined(__WXPM__)
// Load from a resource
#define wxICON(X) wxIcon("" #X "")
#define wxICON(X) wxIcon(wxT(#X))
#elif defined(__WXMGL__)
// Initialize from an included XPM
#define wxICON(X) wxIcon( (const char**) X##_xpm )
@@ -172,7 +172,7 @@ enum wxStockCursor
#define wxICON(X) wxIcon( X##_xpm )
#else
// This will usually mean something on any platform
#define wxICON(X) wxIcon("" #X "")
#define wxICON(X) wxIcon(wxT(#X))
#endif // platform
/* Another macro: this one is for portable creation of bitmaps. We assume that
@@ -180,7 +180,7 @@ enum wxStockCursor
*/
#if defined(__WXMSW__) || defined(__WXPM__)
#define wxBITMAP(name) wxBitmap(#name, wxBITMAP_TYPE_RESOURCE)
#define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) || defined(__WXMAC__) || defined(__WXMGL__)
// Initialize from an included XPM
#define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )

View File

@@ -40,14 +40,14 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = "notebook");
const wxString& name = wxT("notebook"));
// Create() function
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = "notebook");
const wxString& name = wxT("notebook"));
// accessors
// ---------

View File

@@ -40,7 +40,7 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
wxTabCtrl();
inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "tabCtrl")
long style = 0, const wxString& name = wxT("tabCtrl"))
{
Create(parent, id, pos, size, style, name);
}
@@ -99,7 +99,7 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
// Operations
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "tabCtrl");
long style = 0, const wxString& name = wxT("tabCtrl"));
// Delete all items
bool DeleteAllItems();

View File

@@ -33,7 +33,7 @@ public:
inline bool IsIconInstalled() const { return m_iconAdded; }
// Operations
bool SetIcon(const wxIcon& icon, const wxString& tooltip = "");
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString);
bool RemoveIcon(void);
bool PopupMenu(wxMenu *menu); //, int x, int y);

View File

@@ -76,7 +76,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = "wxTreeCtrl")
const wxString& name = wxT("wxTreeCtrl"))
{
Create(parent, id, pos, size, style, validator, name);
}
@@ -88,7 +88,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = "wxTreeCtrl");
const wxString& name = wxT("wxTreeCtrl"));
// accessors
// ---------

View File

@@ -426,7 +426,7 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
// VZ: should we do this?
// chris elliott : only makes sense in MS windows
if ( sTmp.empty() )
GetOpenCommand(&sTmp, wxFileType::MessageParameters("", ""));
GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxT(""), wxT("")));
#endif
wxCHECK_MSG( !sTmp.empty(), FALSE, _T("need the icon file") );

View File

@@ -132,7 +132,7 @@ wxString wxRegExImpl::GetErrorMsg(int errorcode) const
(void)regerror(errorcode, &m_RegEx, (char *)buf.data(), len);
msg = buf.data();
msg = wxString(buf.data(), wxConvLibc);
#else // !Unicode
(void)regerror(errorcode, &m_RegEx, msg.GetWriteBuf(len), len);

View File

@@ -136,7 +136,7 @@ bool wxIPV4address::Hostname(unsigned long addr)
if (rv)
m_origHostname = Hostname();
else
m_origHostname = "";
m_origHostname = wxEmptyString;
return rv;
}
@@ -166,7 +166,7 @@ wxString wxIPV4address::Hostname()
hostname[0] = 0;
GAddress_INET_GetHostName(m_address, hostname, 1024);
return wxString(hostname);
return wxString::FromAscii(hostname);
}
unsigned short wxIPV4address::Service()

View File

@@ -2093,40 +2093,40 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
lastStyle = Style;
lastWeight = Weight;
const char *name = NULL;
const wxChar *name = NULL;
switch (Family)
{
case wxMODERN:
case wxTELETYPE:
{
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = "CourBoO.afm";
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = "CourBo.afm";
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = "CourO.afm";
else name = "Cour.afm";
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = wxT("CourBoO.afm");
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = wxT("CourBo.afm");
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = wxT("CourO.afm");
else name = wxT("Cour.afm");
break;
}
case wxROMAN:
{
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = "TimesBoO.afm";
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = "TimesBo.afm";
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = "TimesO.afm";
else name = "TimesRo.afm";
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = wxT("TimesBoO.afm");
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = wxT("TimesBo.afm");
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = wxT("TimesO.afm");
else name = wxT("TimesRo.afm");
break;
}
case wxSCRIPT:
{
name = "Zapf.afm";
name = wxT("Zapf.afm");
Style = wxNORMAL;
Weight = wxNORMAL;
}
case wxSWISS:
default:
{
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = "HelvBoO.afm";
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = "HelvBo.afm";
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = "HelvO.afm";
else name = "Helv.afm";
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = wxT("HelvBoO.afm");
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = wxT("HelvBo.afm");
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = wxT("HelvO.afm");
else name = wxT("Helv.afm");
break;
}
}

View File

@@ -76,18 +76,18 @@ wxString wxBestHelpController::GetValidFilename( const wxString& filename ) cons
switch( m_helpControllerType )
{
case wxUseChmHelp:
if( ::wxFileExists( tmp + ".chm" ) )
return tmp + ".chm";
if( ::wxFileExists( tmp + wxT(".chm") ) )
return tmp + wxT(".chm");
return filename;
case wxUseHtmlHelp:
if( ::wxFileExists( tmp + ".htb" ) )
return tmp + ".htb";
if( ::wxFileExists( tmp + ".zip" ) )
return tmp + ".zip";
if( ::wxFileExists( tmp + ".hhp" ) )
return tmp + ".hhp";
if( ::wxFileExists( tmp + wxT(".htb") ) )
return tmp + wxT(".htb");
if( ::wxFileExists( tmp + wxT(".zip") ) )
return tmp + wxT(".zip");
if( ::wxFileExists( tmp + wxT(".hhp") ) )
return tmp + wxT(".hhp");
return filename;

View File

@@ -42,10 +42,10 @@
#ifndef UNICODE
typedef HWND ( WINAPI * HTMLHELP )( HWND, LPCSTR, UINT, DWORD );
#define HTMLHELP_NAME "HtmlHelpA"
#define HTMLHELP_NAME wxT("HtmlHelpA")
#else // ANSI
typedef HWND ( WINAPI * HTMLHELP )( HWND, LPCWSTR, UINT, DWORD );
#define HTMLHELP_NAME "HtmlHelpW"
#define HTMLHELP_NAME wxT("HtmlHelpW")
#endif
// dll symbol handle

View File

@@ -306,7 +306,7 @@ wxString wxJoystick::GetProductName() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return wxString("");
return wxEmptyString;
else
return wxString(joyCaps.szPname);
}

View File

@@ -93,7 +93,7 @@
class wxListBoxItem : public wxOwnerDrawn
{
public:
wxListBoxItem(const wxString& str = "");
wxListBoxItem(const wxString& str = wxEmptyString);
};
wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE)
@@ -272,7 +272,7 @@ void wxListBox::Delete(int N)
SendMessage(GetHwnd(), LB_DELETESTRING, N, 0);
m_noItems--;
SetHorizontalExtent("");
SetHorizontalExtent(wxEmptyString);
}
int wxListBox::DoAppend(const wxString& item)
@@ -502,7 +502,7 @@ int wxListBox::GetSelection() const
// Find string for position
wxString wxListBox::GetString(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, "",
wxCHECK_MSG( N >= 0 && N < m_noItems, wxEmptyString,
wxT("invalid index in wxListBox::GetClientData") );
int len = ListBox_GetTextLen(GetHwnd(), N);

View File

@@ -925,7 +925,7 @@ wxString wxListCtrl::GetItemText(long item) const
info.m_itemId = item;
if (!GetItem(info))
return wxString("");
return wxEmptyString;
return info.m_text;
}

View File

@@ -88,7 +88,7 @@ void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext)
m_strFileType = strFileType;
if ( !strFileType ) {
m_strFileType = m_ext.AfterFirst('.') + "_auto_file";
m_strFileType = m_ext.AfterFirst('.') + _T("_auto_file");
}
}

View File

@@ -43,7 +43,7 @@
// ----------------------------------------------------------------------------
// we put our data in HKLM\SOFTWARE_KEY\appname
#define SOFTWARE_KEY wxString("Software\\")
#define SOFTWARE_KEY wxString(wxT("Software\\"))
// ----------------------------------------------------------------------------
// global functions
@@ -696,7 +696,7 @@ bool wxRegConfig::DeleteEntry(const wxString& value, bool WXUNUSED(bGroupIfEmpty
if ( m_keyLocal.IsEmpty() ) {
wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR);
SetPath(".."); // changes m_keyLocal
SetPath(_T("..")); // changes m_keyLocal
return LocalKey().DeleteKey(strKey);
}
}

View File

@@ -303,7 +303,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const
wxString str = bShortPrefix ? aStdKeys[key].szShortName
: aStdKeys[key].szName;
if ( !m_strKey.IsEmpty() )
str << "\\" << m_strKey;
str << _T("\\") << m_strKey;
return str;
}

View File

@@ -180,7 +180,7 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y);
wxGetMousePosition(&x, &y);
// is wxFrame the best window type to use???
win = new wxFrame(NULL, -1, "", wxPoint(x,y), wxSize(-1,-1), 0);
win = new wxFrame(NULL, -1, wxEmptyString, wxPoint(x,y), wxSize(-1,-1), 0);
win->PushEventHandler(this);
// Remove from record of top-level windows, or will confuse wxWindows

View File

@@ -199,7 +199,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
if ( pHostEnt )
{
host = pHostEnt->h_name;
host = wxString::FromAscii(pHostEnt->h_name);
}
}
}

View File

@@ -422,7 +422,7 @@ wxArrayString wxFSVolume::GetVolumes(int flagsSet, int flagsUnset)
{
#ifdef UNICODE
s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(_T("WNetOpenEnumW"));
s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol("WNetEnumResourceW");
s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(_T("WNetEnumResourceW"));
#else
s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(_T("WNetOpenEnumA"));
s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(_T("WNetEnumResourceA"));