]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxrc/wxrc.cpp
fixing capture problem for mouse moved events, fixes #14486
[wxWidgets.git] / utils / wxrc / wxrc.cpp
index d54dab604e8230cd2f346911a855ff65aa990f4b..d6b9799e9283e0e78ae833b9949967d3448f7f51 100644 (file)
@@ -32,7 +32,7 @@
 #include "wx/mimetype.h"
 #include "wx/vector.h"
 
-WX_DECLARE_HASH_SET(wxString, wxStringHash, wxStringEqual, StringSet);
+WX_DECLARE_HASH_SET(wxString, ::wxStringHash, ::wxStringEqual, StringSet);
 
 class XRCWidgetData
 {
@@ -140,7 +140,7 @@ public:
         {
             const XRCWidgetData& w = m_wdata.Item(i);
             if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
-            if( w.GetName().Length() == 0 ) continue;
+            if( w.GetName().empty() ) continue;
             file.Write(
                 wxT(" ") + w.GetClass() + wxT("* ") + w.GetName()
                 + wxT(";\n"));
@@ -155,7 +155,7 @@ public:
         {
             const XRCWidgetData& w = m_wdata.Item(i);
             if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
-            if( w.GetName().Length() == 0 ) continue;
+            if( w.GetName().empty() ) continue;
             file.Write( wxT("  ")
                         + w.GetName()
                         + wxT(" = XRCCTRL(*this,\"")
@@ -707,16 +707,17 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
 
 void XmlResApp::GenCPPHeader()
 {
-    wxString fileSpec = ((parOutput.BeforeLast('.')).AfterLast('/')).AfterLast('\\');
-    wxString heaFileName = fileSpec + wxT(".h");
+    // Generate the output header in the same directory as the source file.
+    wxFileName headerName(parOutput);
+    headerName.SetExt("h");
 
-    wxFFile file(heaFileName, wxT("wt"));
+    wxFFile file(headerName.GetFullPath(), wxT("wt"));
     file.Write(
 "//\n"
 "// This file was automatically generated by wxrc, do not edit by hand.\n"
 "//\n\n"
-"#ifndef __"  + fileSpec + "_h__\n"
-"#define __"  + fileSpec + "_h__\n"
+"#ifndef __"  + headerName.GetName() + "_h__\n"
+"#define __"  + headerName.GetName() + "_h__\n"
 );
     for(size_t i=0;i<aXRCWndClassData.GetCount();++i){
                 aXRCWndClassData.Item(i).GenerateHeaderCode(file);
@@ -895,7 +896,9 @@ static wxString ConvertText(const wxString& str)
     {
         if (*dt == wxT('_'))
         {
-            if ( *(++dt) == wxT('_') )
+            if ( *(dt+1) == 0 )
+                str2 << wxT('_');
+            else if ( *(++dt) == wxT('_') )
                 str2 << wxT('_');
             else
                 str2 << wxT('&') << *dt;