Applied patch [ 651713 ] changes to convertrc
David J. Cooke (davidjcooke) amendments to convertrc: add support for CONTROL... syntax for static, edit, combobox, buttons, but NOT scrollbar; add support for embedded quotes in stringtable; other minor changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,6 +101,8 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile)
|
|||||||
m_xmlfile.Write("</resource>\n");
|
m_xmlfile.Write("</resource>\n");
|
||||||
m_xmlfile.Close();
|
m_xmlfile.Close();
|
||||||
m_rc.Close();
|
m_rc.Close();
|
||||||
|
wxMessageBox(_("Conversion complete."), _("Done"),
|
||||||
|
wxOK | wxICON_INFORMATION);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -116,7 +118,8 @@ microsoft reuses the keyword DIALOG for other things
|
|||||||
*/
|
*/
|
||||||
token=PeekToken();
|
token=PeekToken();
|
||||||
//Microsoft notation?
|
//Microsoft notation?
|
||||||
if (token=="DISCARDABLE")
|
while ((token=="DISCARDABLE")
|
||||||
|
||(token=="LOADONCALL")||(token=="MOVEABLE"))
|
||||||
{
|
{
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
token=PeekToken();
|
token=PeekToken();
|
||||||
@@ -177,32 +180,60 @@ END
|
|||||||
void rc2xml::ParseControls()
|
void rc2xml::ParseControls()
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
|
wxString label,varname;
|
||||||
|
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
while ((token!="END")&(token!="}"))
|
while ((token!="END")&(token!="}"))
|
||||||
{
|
{
|
||||||
if (token=="AUTOCHECKBOX")
|
if (token=="AUTOCHECKBOX")
|
||||||
ParseCheckBox();
|
{
|
||||||
|
label=GetQuoteField();
|
||||||
|
varname=GetToken();
|
||||||
|
ParseCheckBox(label,varname);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (token=="AUTORADIOBUTTON")
|
if (token=="AUTORADIOBUTTON")
|
||||||
ParseRadioButton();
|
{
|
||||||
|
label=GetQuoteField();
|
||||||
|
varname=GetToken();
|
||||||
|
ParseRadioButton(label,varname);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (token=="LTEXT")
|
if (token=="LTEXT")
|
||||||
ParseStaticText();
|
{
|
||||||
|
label=GetQuoteField();
|
||||||
|
varname=GetToken();
|
||||||
|
ParseStaticText(label,varname);
|
||||||
|
}
|
||||||
else if (token=="EDITTEXT")
|
else if (token=="EDITTEXT")
|
||||||
ParseTextCtrl();
|
{
|
||||||
else if (token=="PUSHBUTTON")
|
varname=GetToken();
|
||||||
ParsePushButton();
|
ParseTextCtrl(varname);
|
||||||
else if (token=="DEFPUSHBUTTON")
|
}
|
||||||
ParsePushButton();
|
else if ((token=="PUSHBUTTON")||(token=="DEFPUSHBUTTON"))
|
||||||
|
{
|
||||||
|
label=GetQuoteField();
|
||||||
|
varname=GetToken();
|
||||||
|
ParsePushButton(label,varname);
|
||||||
|
}
|
||||||
else if (token=="GROUPBOX")
|
else if (token=="GROUPBOX")
|
||||||
ParseGroupBox();
|
{
|
||||||
|
label=GetQuoteField();
|
||||||
|
varname=GetToken();
|
||||||
|
ParseGroupBox(label,varname);
|
||||||
|
}
|
||||||
else if (token=="COMBOBOX")
|
else if (token=="COMBOBOX")
|
||||||
ParseComboBox();
|
{
|
||||||
|
varname=GetToken();
|
||||||
|
ParseComboBox(varname);
|
||||||
|
}
|
||||||
else if (token=="CONTROL")
|
else if (token=="CONTROL")
|
||||||
ParseControlMS();
|
ParseControlMS();
|
||||||
else if (token=="LISTBOX")
|
else if (token=="LISTBOX")
|
||||||
ParseListBox();
|
{
|
||||||
|
varname=GetToken();
|
||||||
|
ParseListBox(varname);
|
||||||
|
}
|
||||||
else if (token=="ICON")
|
else if (token=="ICON")
|
||||||
ParseIconStatic();
|
ParseIconStatic();
|
||||||
else if (token=="SCROLLBAR")
|
else if (token=="SCROLLBAR")
|
||||||
@@ -212,12 +243,15 @@ void rc2xml::ParseControls()
|
|||||||
|
|
||||||
}
|
}
|
||||||
//LTEXT "Radius",IDC_STATIC,9,67,23,8
|
//LTEXT "Radius",IDC_STATIC,9,67,23,8
|
||||||
void rc2xml::ParseStaticText()
|
void rc2xml::ParseStaticText(wxString phrase, wxString varname)
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString phrase,varname;
|
token=PeekToken();
|
||||||
phrase=GetQuoteField();
|
while (!token.IsNumber())
|
||||||
varname=GetToken();
|
{
|
||||||
|
token=GetToken();
|
||||||
|
token=PeekToken();
|
||||||
|
}
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
|
|
||||||
@@ -227,11 +261,16 @@ void rc2xml::ParseStaticText()
|
|||||||
|
|
||||||
}
|
}
|
||||||
//EDITTEXT IDC_RADIUS,36,65,40,14,ES_AUTOHSCROLL
|
//EDITTEXT IDC_RADIUS,36,65,40,14,ES_AUTOHSCROLL
|
||||||
void rc2xml::ParseTextCtrl()
|
void rc2xml::ParseTextCtrl(wxString varname)
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString varname,style;
|
wxString style;
|
||||||
varname=GetToken();
|
token=PeekToken();
|
||||||
|
while (!token.IsNumber())
|
||||||
|
{
|
||||||
|
token=GetToken();
|
||||||
|
token=PeekToken();
|
||||||
|
}
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
//TODO
|
//TODO
|
||||||
@@ -242,13 +281,15 @@ void rc2xml::ParseTextCtrl()
|
|||||||
|
|
||||||
}
|
}
|
||||||
//AUTOCHECKBOX "&log.", ID_XLOG, 25, 24, 21, 12
|
//AUTOCHECKBOX "&log.", ID_XLOG, 25, 24, 21, 12
|
||||||
void rc2xml::ParseCheckBox()
|
void rc2xml::ParseCheckBox(wxString phrase, wxString varname)
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString phrase,varname;
|
token=PeekToken();
|
||||||
phrase=GetQuoteField();
|
while (!token.IsNumber())
|
||||||
varname=GetToken();
|
{
|
||||||
|
token=GetToken();
|
||||||
|
token=PeekToken();
|
||||||
|
}
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
|
|
||||||
@@ -259,15 +300,14 @@ void rc2xml::ParseCheckBox()
|
|||||||
|
|
||||||
}
|
}
|
||||||
//AUTORADIOBUTTON "&text", ID_SW10, 13, 12, 68, 10, BS_AUTORADIOBUTTON | WS_GROUP
|
//AUTORADIOBUTTON "&text", ID_SW10, 13, 12, 68, 10, BS_AUTORADIOBUTTON | WS_GROUP
|
||||||
void rc2xml::ParseRadioButton()
|
void rc2xml::ParseRadioButton(wxString phrase, wxString varname)
|
||||||
{
|
{
|
||||||
wxString token,style;
|
wxString token,style;
|
||||||
wxString phrase,varname;
|
|
||||||
phrase=GetQuoteField();
|
|
||||||
varname=GetToken();
|
|
||||||
|
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
|
bool GotOrs;
|
||||||
|
GotOrs = ReadOrs(token);
|
||||||
if (ReadRect(x,y,width,height))
|
if (ReadRect(x,y,width,height))
|
||||||
|
if (GotOrs==FALSE)
|
||||||
ReadOrs(token);
|
ReadOrs(token);
|
||||||
if (token.Find("WS_GROUP") != -1)
|
if (token.Find("WS_GROUP") != -1)
|
||||||
style += "wxRB_GROUP";
|
style += "wxRB_GROUP";
|
||||||
@@ -281,13 +321,16 @@ void rc2xml::ParseRadioButton()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//PUSHBUTTON "Create/Update",IDC_CREATE,15,25,53,13,NOT WS_TABSTOP
|
//PUSHBUTTON "Create/Update",IDC_CREATE,15,25,53,13,NOT WS_TABSTOP
|
||||||
void rc2xml::ParsePushButton()
|
void rc2xml::ParsePushButton(wxString phrase, wxString varname)
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString phrase,varname;
|
|
||||||
phrase=GetQuoteField();
|
|
||||||
varname=GetToken();
|
|
||||||
|
|
||||||
|
token=PeekToken();
|
||||||
|
while (!token.IsNumber())
|
||||||
|
{
|
||||||
|
token=GetToken();
|
||||||
|
token=PeekToken();
|
||||||
|
}
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
|
|
||||||
@@ -314,13 +357,16 @@ bool rc2xml::Seperator(int ch)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc2xml::ParseGroupBox()
|
void rc2xml::ParseGroupBox(wxString phrase, wxString varname)
|
||||||
{
|
{
|
||||||
// GROUPBOX "Rotate",IDC_STATIC,1,1,71,79
|
// GROUPBOX "Rotate",IDC_STATIC,1,1,71,79
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString phrase,varname;
|
token=PeekToken();
|
||||||
phrase=GetQuoteField();
|
while (!token.IsNumber())
|
||||||
varname=GetToken();
|
{
|
||||||
|
token=GetToken();
|
||||||
|
token=PeekToken();
|
||||||
|
}
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
|
|
||||||
@@ -395,7 +441,6 @@ wxString rc2xml::GetQuoteField()
|
|||||||
|
|
||||||
while (ch!=34)
|
while (ch!=34)
|
||||||
ReadChar(ch);
|
ReadChar(ch);
|
||||||
|
|
||||||
ReadChar(ch);
|
ReadChar(ch);
|
||||||
|
|
||||||
while (ch!=34)
|
while (ch!=34)
|
||||||
@@ -406,6 +451,49 @@ wxString rc2xml::GetQuoteField()
|
|||||||
return phrase;
|
return phrase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// string in stringtable may contain embedded quotes
|
||||||
|
// escape characters retained to allow strings to be rewritten
|
||||||
|
wxString rc2xml::GetStringQuote()
|
||||||
|
{
|
||||||
|
wxString phrase;
|
||||||
|
//ASCII code 34 "
|
||||||
|
bool done=FALSE;
|
||||||
|
int p,ch=0,lastch=0;
|
||||||
|
ReadChar(ch);
|
||||||
|
|
||||||
|
while (ch!=34)
|
||||||
|
ReadChar(ch);
|
||||||
|
ReadChar(ch);
|
||||||
|
while (done==FALSE)
|
||||||
|
{
|
||||||
|
if ((ch==34)&&(lastch!='\\'))
|
||||||
|
{
|
||||||
|
p=m_rc.Tell();
|
||||||
|
ReadChar(ch);
|
||||||
|
// RC supports "", for embedded quote, as well as \"
|
||||||
|
if (ch==34)
|
||||||
|
phrase+='\\';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_rc.Seek(p);
|
||||||
|
done = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (done==TRUE)
|
||||||
|
break;
|
||||||
|
if (ch=='\r')
|
||||||
|
ReadChar(ch); // skip
|
||||||
|
if ((ch=='\n')&&(lastch=='\\')) // lastch <should> be this
|
||||||
|
phrase+='n'; // escape
|
||||||
|
else
|
||||||
|
phrase+=(char)ch;
|
||||||
|
lastch=ch;
|
||||||
|
ReadChar(ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
return phrase;
|
||||||
|
}
|
||||||
|
|
||||||
void rc2xml::ReadChar(int &ch)
|
void rc2xml::ReadChar(int &ch)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
@@ -423,15 +511,16 @@ void rc2xml::ReadChar(int &ch)
|
|||||||
m_done=TRUE;
|
m_done=TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc2xml::ParseComboBox()
|
void rc2xml::ParseComboBox(wxString varname)
|
||||||
{
|
{
|
||||||
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
|
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
|
||||||
WS_VSCROLL | WS_TABSTOP */
|
WS_VSCROLL | WS_TABSTOP */
|
||||||
wxString token,style;
|
wxString token,style;
|
||||||
wxString varname;
|
|
||||||
varname=GetToken();
|
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
|
bool GotOrs;
|
||||||
|
GotOrs = ReadOrs(token);
|
||||||
if (ReadRect(x,y,width,height))
|
if (ReadRect(x,y,width,height))
|
||||||
|
if (GotOrs==FALSE)
|
||||||
ReadOrs(token);
|
ReadOrs(token);
|
||||||
|
|
||||||
m_xmlfile.Write("\t\t<object class=\"wxComboBox\"");
|
m_xmlfile.Write("\t\t<object class=\"wxComboBox\"");
|
||||||
@@ -463,6 +552,8 @@ void rc2xml::ParseMenu(wxString varname)
|
|||||||
while ((token!="END")&(token!="}"))
|
while ((token!="END")&(token!="}"))
|
||||||
{
|
{
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
|
token.MakeUpper();
|
||||||
|
|
||||||
if (token=="POPUP")
|
if (token=="POPUP")
|
||||||
{
|
{
|
||||||
ParsePopupMenu();
|
ParsePopupMenu();
|
||||||
@@ -497,6 +588,8 @@ void rc2xml::ParsePopupMenu()
|
|||||||
while ((token!="END")&(token!="}"))
|
while ((token!="END")&(token!="}"))
|
||||||
{
|
{
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
|
token.MakeUpper();
|
||||||
|
|
||||||
if (token=="POPUP")
|
if (token=="POPUP")
|
||||||
ParsePopupMenu();
|
ParsePopupMenu();
|
||||||
|
|
||||||
@@ -589,34 +682,27 @@ bool rc2xml::ReadOrs(wxString & orstring)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Is it a check button or a radio button
|
//Is it a checkbutton or a radiobutton or a pushbutton or a groupbox
|
||||||
void rc2xml::ParseCtrlButton(wxString label, wxString varname)
|
void rc2xml::ParseCtrlButton(wxString label, wxString varname)
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
|
int p;
|
||||||
|
p=m_rc.Tell();
|
||||||
ReadOrs(token);
|
ReadOrs(token);
|
||||||
int x,y,width,height;
|
m_rc.Seek(p);
|
||||||
|
|
||||||
if (token.Find("BS_AUTOCHECKBOX")!=-1)
|
if (token.Find("BS_AUTOCHECKBOX")!=-1)
|
||||||
{
|
ParseCheckBox(label, varname);
|
||||||
ReadRect(x,y,width,height);
|
else if ((token.Find("BS_AUTORADIOBUTTON")!=-1)||
|
||||||
m_xmlfile.Write("\t\t<object class=\"wxCheckBox\"");
|
(token.Find("BS_RADIOBUTTON")!=-1))
|
||||||
WriteBasicInfo(x,y,width,height,varname);
|
ParseRadioButton(label, varname);
|
||||||
WriteLabel(label);
|
else if (token.Find("BS_GROUPBOX")!=-1)
|
||||||
m_xmlfile.Write("\t\t</object>\n");
|
ParseGroupBox(label, varname);
|
||||||
|
else // if ((token.Find("BS_PUSHBUTTON")!=-1)||
|
||||||
|
// (token.Find("BS_DEFPUSHBUTTON")!=-1))
|
||||||
|
ParsePushButton(label, varname); // make default case
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token.Find("BS_AUTORADIOBUTTON")!=-1)
|
|
||||||
{
|
|
||||||
ReadRect(x,y,width,height);
|
|
||||||
m_xmlfile.Write("\t\t<object class=\"wxRadioButton\"");
|
|
||||||
WriteBasicInfo(x,y,width,height,varname);
|
|
||||||
WriteLabel(label);
|
|
||||||
m_xmlfile.Write("\t\t</object>\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void rc2xml::WriteSize(int width, int height)
|
void rc2xml::WriteSize(int width, int height)
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
@@ -713,11 +799,15 @@ void rc2xml::WriteStyle(wxString style)
|
|||||||
LISTBOX IDC_LIST1,16,89,48,40,LBS_SORT | LBS_MULTIPLESEL |
|
LISTBOX IDC_LIST1,16,89,48,40,LBS_SORT | LBS_MULTIPLESEL |
|
||||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||||
*/
|
*/
|
||||||
void rc2xml::ParseListBox()
|
void rc2xml::ParseListBox(wxString varname)
|
||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString varname;
|
token=PeekToken();
|
||||||
varname=GetToken();
|
while (!token.IsNumber())
|
||||||
|
{
|
||||||
|
token=GetToken();
|
||||||
|
token=PeekToken();
|
||||||
|
}
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
|
|
||||||
@@ -811,7 +901,7 @@ void rc2xml::SecondPass()
|
|||||||
while (!m_done)
|
while (!m_done)
|
||||||
{
|
{
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
if (token=="DIALOG")
|
if ((token=="DIALOG")||(token=="DIALOGEX"))
|
||||||
ParseDialog(prevtok);
|
ParseDialog(prevtok);
|
||||||
else if (token=="MENU")
|
else if (token=="MENU")
|
||||||
ParseMenu(prevtok);
|
ParseMenu(prevtok);
|
||||||
@@ -855,7 +945,7 @@ void rc2xml::ParseToolBar(wxString varname)
|
|||||||
int c=0;
|
int c=0;
|
||||||
wxString buttonname,msg,tip,longhelp;
|
wxString buttonname,msg,tip,longhelp;
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
while ((token!="BEGIN"))
|
while ((token!="BEGIN")&(token!="{"))
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
|
|
||||||
while ((token!="END")&(token!="}"))
|
while ((token!="END")&(token!="}"))
|
||||||
@@ -905,7 +995,7 @@ void rc2xml::ParseStringTable(wxString varname)
|
|||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
while ((token!="BEGIN"))
|
while ((token!="BEGIN")&(token!="{"))
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
wxString *msg;
|
wxString *msg;
|
||||||
@@ -913,7 +1003,7 @@ void rc2xml::ParseStringTable(wxString varname)
|
|||||||
while ((token!="END")&(token!="}"))
|
while ((token!="END")&(token!="}"))
|
||||||
{
|
{
|
||||||
msg=new wxString;
|
msg=new wxString;
|
||||||
*msg=GetQuoteField();
|
*msg=GetStringQuote();
|
||||||
m_stringtable->Append(token,msg);
|
m_stringtable->Append(token,msg);
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
}
|
}
|
||||||
@@ -969,7 +1059,8 @@ void rc2xml::ParseMenuItem()
|
|||||||
m_xmlfile.Write(">\n");
|
m_xmlfile.Write(">\n");
|
||||||
WriteLabel(token);
|
WriteLabel(token);
|
||||||
//Look up help if any listed in stringtable
|
//Look up help if any listed in stringtable
|
||||||
if (LookUpString(name,msg))
|
//can't assume numbers correlate, restrict to string identifiers
|
||||||
|
if ((!name.IsNumber())&&(LookUpString(name,msg)))
|
||||||
{
|
{
|
||||||
SplitHelp(msg,tip,longhelp);
|
SplitHelp(msg,tip,longhelp);
|
||||||
m_xmlfile.Write("\t\t\t<help>"
|
m_xmlfile.Write("\t\t\t<help>"
|
||||||
@@ -978,9 +1069,11 @@ void rc2xml::ParseMenuItem()
|
|||||||
//look for extra attributes like checked and break
|
//look for extra attributes like checked and break
|
||||||
wxString ptoken;
|
wxString ptoken;
|
||||||
ptoken=PeekToken();
|
ptoken=PeekToken();
|
||||||
|
ptoken.MakeUpper();
|
||||||
while ((ptoken!="MENUITEM")&(ptoken!="POPUP")&(ptoken!="END"))
|
while ((ptoken!="MENUITEM")&(ptoken!="POPUP")&(ptoken!="END"))
|
||||||
{
|
{
|
||||||
token=GetToken();
|
token=GetToken();
|
||||||
|
ptoken.MakeUpper();
|
||||||
if (token=="CHECKED")
|
if (token=="CHECKED")
|
||||||
m_xmlfile.Write("\t\t\t<checkable>1</checkable>\n");
|
m_xmlfile.Write("\t\t\t<checkable>1</checkable>\n");
|
||||||
else if (token=="MENUBREAK");
|
else if (token=="MENUBREAK");
|
||||||
@@ -990,6 +1083,7 @@ void rc2xml::ParseMenuItem()
|
|||||||
wxLogError("Unknown Menu Item token:"+token);
|
wxLogError("Unknown Menu Item token:"+token);
|
||||||
|
|
||||||
ptoken=PeekToken();
|
ptoken=PeekToken();
|
||||||
|
ptoken.MakeUpper();
|
||||||
}
|
}
|
||||||
m_xmlfile.Write("\t\t\t</object>\n");
|
m_xmlfile.Write("\t\t\t</object>\n");
|
||||||
|
|
||||||
@@ -1000,6 +1094,10 @@ void rc2xml::ParseIconStatic()
|
|||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
wxString varname,iconname;
|
wxString varname,iconname;
|
||||||
|
token = PeekToken();
|
||||||
|
if (token.Contains("\""))
|
||||||
|
iconname = GetQuoteField();
|
||||||
|
else
|
||||||
iconname=GetToken();
|
iconname=GetToken();
|
||||||
//Look up icon
|
//Look up icon
|
||||||
varname=GetToken();
|
varname=GetToken();
|
||||||
@@ -1046,8 +1144,7 @@ void rc2xml::ParseStaticBitmap(wxString bitmapname, wxString varname)
|
|||||||
{
|
{
|
||||||
wxString token;
|
wxString token;
|
||||||
//Grab SS_BITMAP
|
//Grab SS_BITMAP
|
||||||
token=GetToken();
|
ReadOrs(token);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
@@ -1085,6 +1182,23 @@ kindctrl.MakeUpper();
|
|||||||
ParseCtrlButton(label,varname);
|
ParseCtrlButton(label,varname);
|
||||||
if (kindctrl=="RICHEDIT")
|
if (kindctrl=="RICHEDIT")
|
||||||
ParseRichEdit(label,varname);
|
ParseRichEdit(label,varname);
|
||||||
|
if (kindctrl=="STATIC")
|
||||||
|
{
|
||||||
|
wxString token;
|
||||||
|
int p=m_rc.Tell();
|
||||||
|
ReadOrs(token);
|
||||||
|
m_rc.Seek(p);
|
||||||
|
if (token.Find("SS_BITMAP")!=-1)
|
||||||
|
ParseStaticBitmap(label,varname);
|
||||||
|
else
|
||||||
|
ParseStaticText(label,varname);
|
||||||
|
}
|
||||||
|
if (kindctrl=="EDIT")
|
||||||
|
ParseTextCtrl(varname);
|
||||||
|
if (kindctrl=="LISTBOX")
|
||||||
|
ParseListBox(varname);
|
||||||
|
if (kindctrl=="COMBOBOX")
|
||||||
|
ParseComboBox(varname);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,19 +52,20 @@ protected:
|
|||||||
void ParseRichEdit(wxString label, wxString varname);
|
void ParseRichEdit(wxString label, wxString varname);
|
||||||
void ParseDialog(wxString dlgname);
|
void ParseDialog(wxString dlgname);
|
||||||
void ParseControls();
|
void ParseControls();
|
||||||
void ParseListBox();
|
void ParseListBox(wxString varname);
|
||||||
void ParseStaticText();
|
void ParseStaticText(wxString phrase,wxString varname);
|
||||||
void ParseTextCtrl();
|
void ParseTextCtrl(wxString varname);
|
||||||
void ParseRadioButton();
|
void ParseRadioButton(wxString phrase,wxString varname);
|
||||||
void ParseCheckBox();
|
void ParseCheckBox(wxString phrase,wxString varname);
|
||||||
void ParsePushButton();
|
void ParsePushButton(wxString phrase, wxString varname);
|
||||||
bool Seperator(int ch);
|
bool Seperator(int ch);
|
||||||
void ParseGroupBox();
|
void ParseGroupBox(wxString phrase, wxString varname);
|
||||||
bool ReadRect(int & x, int & y, int & width, int & height);
|
bool ReadRect(int & x, int & y, int & width, int & height);
|
||||||
wxString GetToken(bool *listseperator = 0);
|
wxString GetToken(bool *listseperator = 0);
|
||||||
wxString GetQuoteField();
|
wxString GetQuoteField();
|
||||||
|
wxString GetStringQuote();
|
||||||
void ReadChar(int &ch);
|
void ReadChar(int &ch);
|
||||||
void ParseComboBox();
|
void ParseComboBox(wxString varname);
|
||||||
void ParseMenu(wxString varname);
|
void ParseMenu(wxString varname);
|
||||||
void ParsePopupMenu();
|
void ParsePopupMenu();
|
||||||
wxString PeekToken();
|
wxString PeekToken();
|
||||||
|
Reference in New Issue
Block a user