// for all others, include the necessary headers (this file is usually all you
-// need because it includes almost all "standard" wxWindows headers
+// need because it includes almost all "standard" wxWidgets headers
#ifndef WX_PRECOMP
{
-m_done=FALSE;
+m_done=false;
m_controlid=6000;
void rc2wxr::Convert(wxString wxrfile, wxString rcfile)
-
{
+ m_rc.Open(rcfile);
+ m_filesize=m_rc.Length();
+ if( (m_wxr = wxFopen( wxrfile, _T("wt") )) == NULL )
+ {
+ return;
+ }
-m_rc.Open(rcfile);
-
-m_filesize=m_rc.Length();
-
-if( (m_wxr = wxFopen( wxrfile, _T("wt") )) == NULL )
-
-{
-
- return;
-
-}
-
+ wxString tok,prevtok;
+ while (!m_done)
+ {
+ tok=GetToken();
+ if (tok==_T("DIALOG"))
+ {
+ ParseDialog(prevtok);
+ }
+ if (tok==_T("MENU"))
+ {
+ ParseMenu(prevtok);
+ }
-wxString tok,prevtok;
-
-
-
-
-
-while (!m_done)
-
-{
-
-
-
-tok=GetToken();
-
-
-
-if (tok==_T("DIALOG"))
-
-{
-
-ParseDialog(prevtok);
-
-}
-
-
-
-
-
-if (tok==_T("MENU"))
-
-{
-
-ParseMenu(prevtok);
-
-}
-
-
-
-prevtok=tok;
-
-}
-
-
-
-fclose(m_wxr);
-
-//fclose(m_rc);
-
-m_rc.Close();
-
+ prevtok=tok;
+ }
+ fclose(m_wxr);
+ m_rc.Close();
}
if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|'))
- return TRUE;
+ return true;
{
-m_done=TRUE;
+m_done=true;
-return TRUE;
+return true;
}
-return FALSE;
+return false;
}
{
-m_done=TRUE;
+m_done=true;
return tok;
{
-m_done=TRUE;
+m_done=true;
return tok;
{
-m_done=TRUE;
+m_done=true;
if (ch==EOF)
- m_done=TRUE;
+ m_done=true;
void rc2wxr::ReadChar(int &ch)
-
{
+ wxFileOffset result = m_rc.Tell();
- int result;
-
-result=m_rc.Tell();
-
-
-
-if((result>=m_filesize))
-
- m_done=TRUE;
-
-
+ if ( result >= m_filesize )
+ m_done=true;
-result=m_rc.Read(&ch,1);
+ result = m_rc.Read(&ch,1);
+ if ( result==wxInvalidOffset )
+ m_done=true;
-
-if((result==-1))
-
- m_done=TRUE;
-
-
-
-if(ch==EOF)
-
- m_done=TRUE;
-
+ if(ch==EOF)
+ m_done=true;
}
void rc2wxr::ParseComboBox()
-
{
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
if (tok==_T("POPUP"))
- {
+ {
ParsePopupMenu();
- wxFprintf(m_wxr,_T(" ],\\\n"));
+ wxFprintf(m_wxr,_T(" ],\\\n"));
- }
+ }
}
wxString tok;
-while (ReadOrs(tok));
+while (ReadOrs(tok))
+ ;
wxFprintf(m_wxr,_T(" control = [%i,wxSlider,'','wxSL_HORIZONTAL','%s',"),m_controlid,varname.c_str());
wxString tok;
-while (ReadOrs(tok));
+while (ReadOrs(tok))
+ ;
wxFprintf(m_wxr,_T(" control = [%i,wxGauge,'','wxGA_HORIZONTAL','%s',"),m_controlid,varname.c_str());
w=GetToken();
-return TRUE;
+return true;
}
wxFprintf(m_wxr,_T(" control = [%i,wxCheckBox,'%s','0','%s',"),m_controlid,label.c_str(),varname.c_str());
- while (ReadOrs(tok));
+ while (ReadOrs(tok))
+ ;
ReadRect(x,y,width,height);
wxFprintf(m_wxr,_T(" control = [%i,wxRadioButton,'%s','0','%s',"),m_controlid,label.c_str(),varname.c_str());
- while(ReadOrs(tok));
+ while(ReadOrs(tok))
+ ;
ReadRect(x,y,width,height);