X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2193517f1b909b834dc6e314acc3b873dc8196d9..a8522481f71a43df96d6322890e9f539c7737993:/contrib/utils/convertrc/wxr2xml.cpp?ds=sidebyside diff --git a/contrib/utils/convertrc/wxr2xml.cpp b/contrib/utils/convertrc/wxr2xml.cpp index 6aa5ad54f7..f2e331ec5c 100644 --- a/contrib/utils/convertrc/wxr2xml.cpp +++ b/contrib/utils/convertrc/wxr2xml.cpp @@ -92,28 +92,24 @@ bool wxr2xml::ParseResources() void wxr2xml::ParsePanel(wxItemResource * res) { - m_xmlfile.Write("\t\n"); ParseControls(res); - m_xmlfile.Write(" \t\t\n"); - m_xmlfile.Write("\t\n\n"); + m_xmlfile.Write("\t\n\n"); } void wxr2xml::ParseDialog(wxItemResource * res) { PanelStuff(res); - m_xmlfile.Write("\t\n"); ParseControls(res); - m_xmlfile.Write("\t\t\n"); - m_xmlfile.Write("\t\n\n"); + m_xmlfile.Write("\t\n\n"); } void wxr2xml::ParseControls(wxItemResource * res) @@ -194,18 +190,18 @@ wxString wxr2xml::GetPosition(wxItemResource * res) void wxr2xml::ParseButton(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::ParseTextCtrl(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } @@ -225,11 +221,11 @@ wxString wxr2xml::GetValue4(wxItemResource * res) void wxr2xml::ParseCheckBox(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } wxString wxr2xml::GetLabel(wxItemResource * res) @@ -239,38 +235,38 @@ wxString wxr2xml::GetLabel(wxItemResource * res) void wxr2xml::ParseRadioBox(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::ParseListBox(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::ParseStaticText(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::ParseStaticBox(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::WriteStringList(wxItemResource * res) @@ -286,20 +282,20 @@ void wxr2xml::WriteStringList(wxItemResource * res) void wxr2xml::ParseChoice(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::ParseGauge(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\n\t\t\t\n"); } wxString wxr2xml::GetValue1(wxItemResource * res) @@ -318,12 +314,12 @@ wxString wxr2xml::GetRange(wxItemResource * res) void wxr2xml::ParseSlider(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\n\t\t\t\n"); } wxString wxr2xml::GetMax(wxItemResource * res) @@ -342,34 +338,34 @@ wxString wxr2xml::GetMin(wxItemResource * res) void wxr2xml::ParseComboBox(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\n\t\t\t\n"); } void wxr2xml::ParseRadioButton(wxItemResource * res) { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::ParseScrollBar(wxItemResource * res) { - m_xmlfile.Write("\t\t\t"+GetValue2(res)+"\n"); m_xmlfile.Write("\t\t\t\t"+GetValue3(res)+"\n"); m_xmlfile.Write("\t\t\t\t"+GetValue5(res)+"\n"); - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } wxString wxr2xml::GetCheckStatus(wxItemResource * res) @@ -584,18 +580,16 @@ void wxr2xml::ParseMenuBar(wxItemResource * res) wxItemResource *child; wxNode *node = res->GetChildren().First(); // Get Menu Bar Name - m_xmlfile.Write("\t\n"); - m_xmlfile.Write("\t\t\n"); while (node) { child = (wxItemResource *) node->Data(); ParseMenu(child); node = node->Next(); } - m_xmlfile.Write("\t\t\n"); - m_xmlfile.Write("\t \n\n"); + m_xmlfile.Write("\t \n\n"); } void wxr2xml::ParseMenu(wxItemResource * res) @@ -603,7 +597,7 @@ void wxr2xml::ParseMenu(wxItemResource * res) wxItemResource *child; wxNode *node = res->GetChildren().First(); // Get Menu - m_xmlfile.Write("\t\t\tGetValue1() << "\""; m_xmlfile.Write(menuname); @@ -613,7 +607,6 @@ void wxr2xml::ParseMenu(wxItemResource * res) if (res->GetValue4() != "") m_xmlfile.Write("\t\t\t\t" + res->GetValue4() + "\n"); - m_xmlfile.Write("\t\t\t\n"); // Read in menu items and additional menus while (node) { child = (wxItemResource *) node->Data(); @@ -623,17 +616,16 @@ void wxr2xml::ParseMenu(wxItemResource * res) ParseMenu(child); node = node->Next(); } - m_xmlfile.Write("\t\t\t\n"); - m_xmlfile.Write("\t\t\t \n"); + m_xmlfile.Write("\t\t\t \n"); } void wxr2xml::ParseMenuItem(wxItemResource * res) { // Get Menu Item or Separator if (res->GetTitle() == "") { - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } else { - m_xmlfile.Write("\t\t\t\tGetValue1() << "\""; m_xmlfile.Write(menuname); @@ -645,7 +637,7 @@ void wxr2xml::ParseMenuItem(wxItemResource * res) res->GetValue4() + "\n"); if (res->GetValue2()) m_xmlfile.Write("\t\t\t\t1\n"); - m_xmlfile.Write("\t\t\t \n"); + m_xmlfile.Write("\t\t\t \n"); } } @@ -657,7 +649,7 @@ wxString wxr2xml::FixMenuString(wxString phrase) void wxr2xml::ParseStaticBitmap(wxItemResource * res) { - m_xmlfile.Write("\t\t\t" + bitmapname + ""); - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); // bitmap5 } //Parse a bitmap resource void wxr2xml::ParseBitmap(wxItemResource * res) { - m_xmlfile.Write("\t"); wxString bitmapname; bitmapname = res->GetName(); @@ -682,7 +674,7 @@ void wxr2xml::ParseBitmap(wxItemResource * res) bitmapname += _T(".bmp"); bitmap.SaveFile(bitmapname, wxBITMAP_TYPE_BMP); m_xmlfile.Write(bitmapname); - m_xmlfile.Write("\n\n"); + m_xmlfile.Write("\n\n"); } void wxr2xml::PanelStuff(wxItemResource * res) @@ -727,7 +719,7 @@ wxString wxr2xml::GetValue5(wxItemResource *res) void wxr2xml::ParseBitmapButton(wxItemResource *res) { - m_xmlfile.Write("\t\t\t" + bitmapname + "\n"); - m_xmlfile.Write("\t\t\t\n"); + m_xmlfile.Write("\t\t\t\n"); } void wxr2xml::WriteFontInfo(wxItemResource *res) @@ -779,19 +771,19 @@ void wxr2xml::GetFontFace(wxFont font) case wxDEFAULT: break; case wxDECORATIVE: - m_xmlfile.Write("\t\t\t\tDecorative\n"); + m_xmlfile.Write("\t\t\t\tdecorative\n"); break; case wxROMAN: - m_xmlfile.Write("\t\t\t\tRoman\n"); + m_xmlfile.Write("\t\t\t\troman\n"); break; case wxSCRIPT: - m_xmlfile.Write("\t\t\t\tScript\n"); + m_xmlfile.Write("\t\t\t\tscript\n"); break; case wxSWISS: - m_xmlfile.Write("\t\t\t\tSwiss\n"); + m_xmlfile.Write("\t\t\t\tswiss\n"); break; case wxMODERN: - m_xmlfile.Write("\t\t\t\tModern\n"); + m_xmlfile.Write("\t\t\t\tmodern\n"); break; default: wxLogError("Unknown font face");