X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c9955d147ed92cdd79d795ed94d6e03fca06a52..d4a376ac6c526b51dda4b40bc56e7fedb6c15ff5:/contrib/utils/convertrc/rc2xml.cpp
diff --git a/contrib/utils/convertrc/rc2xml.cpp b/contrib/utils/convertrc/rc2xml.cpp
index fc65fe51b3..371f4aa489 100644
--- a/contrib/utils/convertrc/rc2xml.cpp
+++ b/contrib/utils/convertrc/rc2xml.cpp
@@ -72,7 +72,7 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile)
m_workingpath=wxPathOnly(rcfile);
- m_targetpath=wxPathOnly(xmlfile)+"\\";
+ m_targetpath=wxPathOnly(xmlfile) + _T("\\");
@@ -80,15 +80,15 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile)
bool result;
- result=m_xmlfile.Open(xmlfile.c_str(),"w+t");
- wxASSERT_MSG(result,"Couldn't create XML file");
+ result=m_xmlfile.Open(xmlfile.c_str(),_T("w+t"));
+ wxASSERT_MSG(result,_T("Couldn't create XML file"));
if (!result)
return FALSE;
/* Write Basic header for XML file */
- m_xmlfile.Write("\n");
- m_xmlfile.Write("\n");
+ m_xmlfile.Write(_T("\n"));
+ m_xmlfile.Write(_T("\n"));
//Read resource.h
ParseResourceHeader();
@@ -99,7 +99,7 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile)
//Read in dialogs, toolbars,menus
SecondPass();
- m_xmlfile.Write("\n");
+ m_xmlfile.Write(_T("\n"));
m_xmlfile.Close();
m_rc.Close();
wxMessageBox(_("Conversion complete."), _("Done"),
@@ -119,8 +119,8 @@ microsoft reuses the keyword DIALOG for other things
*/
token=PeekToken();
//Microsoft notation?
- while ((token=="DISCARDABLE")
- ||(token=="LOADONCALL")||(token=="MOVEABLE"))
+ while ((token==_T("DISCARDABLE"))
+ ||(token==_T("LOADONCALL"))||(token==_T("MOVEABLE")))
{
token=GetToken();
token=PeekToken();
@@ -137,37 +137,37 @@ microsoft reuses the keyword DIALOG for other things
wxString title;
wxString ptsize,face;
- m_xmlfile.Write("\t\n");
+ m_xmlfile.Write(_T("\t\n"));
}
/*
@@ -184,60 +184,60 @@ void rc2xml::ParseControls()
wxString label,varname;
token=GetToken();
- while ((token!="END")&(token!="}"))
+ while ((token!=_T("END"))&(token!=_T("}")))
{
- if (token=="AUTOCHECKBOX")
+ if (token==_T("AUTOCHECKBOX"))
{
label=GetQuoteField();
varname=GetToken();
ParseCheckBox(label,varname);
}
else
- if (token=="AUTORADIOBUTTON")
+ if (token==_T("AUTORADIOBUTTON"))
{
label=GetQuoteField();
varname=GetToken();
ParseRadioButton(label,varname);
}
else
- if (token=="LTEXT")
+ if (token==_T("LTEXT"))
{
label=GetQuoteField();
varname=GetToken();
ParseStaticText(label,varname);
}
- else if (token=="EDITTEXT")
+ else if (token==_T("EDITTEXT"))
{
varname=GetToken();
ParseTextCtrl(varname);
}
- else if ((token=="PUSHBUTTON")||(token=="DEFPUSHBUTTON"))
+ else if ((token==_T("PUSHBUTTON"))||(token==_T("DEFPUSHBUTTON")))
{
label=GetQuoteField();
varname=GetToken();
ParsePushButton(label,varname);
}
- else if (token=="GROUPBOX")
+ else if (token==_T("GROUPBOX"))
{
label=GetQuoteField();
varname=GetToken();
ParseGroupBox(label,varname);
}
- else if (token=="COMBOBOX")
+ else if (token==_T("COMBOBOX"))
{
varname=GetToken();
ParseComboBox(varname);
}
- else if (token=="CONTROL")
+ else if (token==_T("CONTROL"))
ParseControlMS();
- else if (token=="LISTBOX")
+ else if (token==_T("LISTBOX"))
{
varname=GetToken();
ParseListBox(varname);
}
- else if (token=="ICON")
+ else if (token==_T("ICON"))
ParseIconStatic();
- else if (token=="SCROLLBAR")
+ else if (token==_T("SCROLLBAR"))
ParseScrollBar();
token=GetToken();
}
@@ -256,9 +256,9 @@ void rc2xml::ParseStaticText(wxString phrase, wxString varname)
int x,y,width,height;
ReadRect(x,y,width,height);
- m_xmlfile.Write("\t\t\n"));
}
//EDITTEXT IDC_RADIUS,36,65,40,14,ES_AUTOHSCROLL
@@ -276,9 +276,9 @@ void rc2xml::ParseTextCtrl(wxString varname)
ReadRect(x,y,width,height);
//TODO
//style=GetToken();
- m_xmlfile.Write("\t\t\n"));
}
//AUTOCHECKBOX "&log.", ID_XLOG, 25, 24, 21, 12
@@ -294,10 +294,10 @@ void rc2xml::ParseCheckBox(wxString phrase, wxString varname)
int x,y,width,height;
ReadRect(x,y,width,height);
- m_xmlfile.Write("\t\t\n"));
}
//AUTORADIOBUTTON "&text", ID_SW10, 13, 12, 68, 10, BS_AUTORADIOBUTTON | WS_GROUP
@@ -310,14 +310,14 @@ void rc2xml::ParseRadioButton(wxString phrase, wxString varname)
if (ReadRect(x,y,width,height))
if (GotOrs==FALSE)
ReadOrs(token);
- if (token.Find("WS_GROUP") != -1)
- style += "wxRB_GROUP";
+ if (token.Find(_T("WS_GROUP")) != -1)
+ style += _T("wxRB_GROUP");
- m_xmlfile.Write("\t\t\n"));
}
@@ -335,10 +335,10 @@ void rc2xml::ParsePushButton(wxString phrase, wxString varname)
int x,y,width,height;
ReadRect(x,y,width,height);
- m_xmlfile.Write("\t\t\n"));
}
@@ -371,26 +371,26 @@ void rc2xml::ParseGroupBox(wxString phrase, wxString varname)
int x,y,width,height;
ReadRect(x,y,width,height);
- m_xmlfile.Write("\t\t\n"));
}
bool rc2xml::ReadRect(int & x, int & y, int & width, int & height)
{
- x=atoi(GetToken());
- y=atoi(GetToken());
- width=atoi(GetToken());
+ x=wxAtoi(GetToken());
+ y=wxAtoi(GetToken());
+ width=wxAtoi(GetToken());
bool ret;
wxString tmp = GetToken(&ret);
- height=atoi(tmp);
+ height=wxAtoi(tmp);
return ret; // check for more parameters
}
wxString rc2xml::GetToken(bool *listseperator)
{
- wxString token="";
+ wxString token=wxEmptyString;
if (m_rc.Eof())
{
@@ -524,43 +524,43 @@ void rc2xml::ParseComboBox(wxString varname)
if (GotOrs==FALSE)
ReadOrs(token);
- m_xmlfile.Write("\t\t\n"));
}
void rc2xml::ParseMenu(wxString varname)
{
- wxString token="";
+ wxString token=wxEmptyString;
//Write menubar to xml file
- m_xmlfile.Write("\t\n");
+ m_xmlfile.Write(_T("\t\n"));
}
void rc2xml::ParsePopupMenu()
@@ -577,27 +577,27 @@ void rc2xml::ParsePopupMenu()
//Write Menu item
//Generate a fake name since RC menus don't have one
- name<<"Menu_"<