// wxr2xml.cpp: implementation of the wxr2xml class.
// 8/30/00 Brian Gavin
// only tested on wxMSW so far
-//License: wxWindows Liscense
+// License: wxWindows Liscense
// ////////////////////////////////////////////////////////////////////
/*
wxr2xml trans;
trans->Convert("Myfile.wxr","Myfile.xml");
*/
-#ifdef __GNUG__
-#pragma implementation "wxr2xml.h"
-#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
wxr2xml::wxr2xml()
{
-
}
wxr2xml::~wxr2xml()
{
-
}
bool wxr2xml::Convert(wxString wxrfile, wxString xmlfile)
if (restype == _T("wxDialog"))
{
- if (style & wxDIALOG_MODAL)
- s += _T("wxDIALOG_MODAL|");
if (style & wxDEFAULT_DIALOG_STYLE)
s += _T("wxDEFAULT_DIALOG_STYLE|");
+#if WXWIN_COMPATIBILITY_2_6
+ if (style & wxDIALOG_MODAL)
+ s += _T("wxDIALOG_MODAL|");
if (style & wxDIALOG_MODELESS)
s += _T("wxDIALOG_MODELESS|");
if (style & wxNO_3D)
s += _T("wxNO_3D|");
+#endif // WXWIN_COMPATIBILITY_2_6
if (style & wxTAB_TRAVERSAL)
s += _T("wxTAB_TRAVERSAL|");
if (style & wxWS_EX_VALIDATE_RECURSIVELY)
s += _T("wxSTAY_ON_TOP|");
if (style & wxCAPTION)
s += _T("wxCAPTION|");
- if (style & wxTHICK_FRAME)
- s += _T("wxTHICK_FRAME|");
+ if (style & wxRESIZE_BORDER)
+ s += _T("wxRESIZE_BORDER|");
+#if WXWIN_COMPATIBILITY_2_6
if (style & wxRESIZE_BOX)
s += _T("wxRESIZE_BOX|");
+#endif // WXWIN_COMPATIBILITY_2_6
if (style & wxRESIZE_BORDER)
s += _T("wxRESIZE_BORDER|");
if (style & wxSYSTEM_MENU)
{
if (style & wxCLIP_CHILDREN)
s += _T("wxCLIP_CHILDREN|");
+#if WXWIN_COMPATIBILITY_2_6
if (style & wxNO_3D)
s += _T("wxNO_3D|");
+#endif // WXWIN_COMPATIBILITY_2_6
if (style & wxTAB_TRAVERSAL)
s += _T("wxTAB_TRAVERSAL|");
if (style & wxWS_EX_VALIDATE_RECURSIVELY)
s += _T("wxGA_HORIZONTAL|");
if (style & wxGA_VERTICAL)
s += _T("wxGA_VERTICAL|");
- if (style & wxGA_PROGRESSBAR)
- s += _T("wxGA_PROGRESSBAR|");
// windows only
if (style & wxGA_SMOOTH)
s += _T("wxGA_SMOOTH|");
s += _T("wxSB_VERTICAL|");
}
- int l;
- l = s.Length();
+ int l = s.length();
// No styles defined
if (l == 11)
- return _T("");
+ return wxEmptyString;
// Trim off last |
s = s.Truncate(l - 1);
m_xmlfile.Write(_T(">\n"));
m_xmlfile.Write(_T("\t\t\t\t<label>")
+ FixMenuString(res->GetTitle()) + _T("</label>\n"));
- if (res->GetValue4() != _T(""))
+ if (!res->GetValue4().empty())
m_xmlfile.Write(_T("\t\t\t\t<help>") + res->GetValue4() +
_T("</help>\n"));
// Read in menu items and additional menus
void wxr2xml::ParseMenuItem(wxItemResource * res)
{
// Get Menu Item or Separator
- if (res->GetTitle() == _T("")) {
+ if (res->GetTitle().empty()) {
m_xmlfile.Write(_T("\t\t\t<object class=\"separator\"/>\n"));
} else {
m_xmlfile.Write(_T("\t\t\t\t<object class=\"wxMenuItem\" "));
m_xmlfile.Write(_T(">\n"));
m_xmlfile.Write(_T("\t\t\t<label>")
+ FixMenuString(res->GetTitle()) + _T("</label>\n"));
- if (res->GetValue4() != _T(""))
+ if (!res->GetValue4().empty())
m_xmlfile.Write(_T("\t\t\t<help>") +
res->GetValue4() + _T("</help>\n"));
if (res->GetValue2())