]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/wxrc/wxrc.cpp
fix for generating set/kill focus events for wxRadioBox (also fixes TABbing in a...
[wxWidgets.git] / contrib / utils / wxrc / wxrc.cpp
index 349a00321aeb41075ef753b52bb832d3ca6ba339..7b74deabc69e2a61ff05de7c8ec4da8f3fca241a 100644 (file)
 #endif
 
 #include "wx/cmdline.h"
-#include "wx/xrc/xml.h"
+#include "wx/xml/xml.h"
 #include "wx/ffile.h"
 #include "wx/filename.h"
 #include "wx/wfstream.h"
 
 
-
-
-
-/*
-#if wxUSE_GUI
-#error "You must compile the resource compiler with wxBase!"
-#endif
-*/
-
-class XmlResApp : public wxApp
+class XmlResApp : public wxAppConsole
 {
 public:
+    // don't use builtin cmd line parsing:
+    virtual bool OnInit() { return true; } 
 
-#if wxUSE_GUI
-    bool OnInit();
-#else
     virtual int OnRun();
-#endif
     
 private:
     
@@ -75,13 +64,9 @@ private:
     int retCode;
 };
 
-IMPLEMENT_APP(XmlResApp)
+IMPLEMENT_APP_CONSOLE(XmlResApp)
 
-#if wxUSE_GUI
-bool XmlResApp::OnInit()
-#else
 int XmlResApp::OnRun()
-#endif
 {
     static const wxCmdLineEntryDesc cmdLineDesc[] =
     {
@@ -109,7 +94,10 @@ int XmlResApp::OnRun()
     {
         case -1:
             return 0;
+            #if 0
+            // break is unreachable because of return earlier
             break;
+            #endif
 
         case 0:
             retCode = 0;
@@ -118,21 +106,20 @@ int XmlResApp::OnRun()
                 OutputGettext();
             else
                 CompileRes();
-#if wxUSE_GUI
-            return FALSE;
-#else
             return retCode;
-#endif
+            #if 0
+            // break is unreachable because of return earlier
             break;
+            #endif
 
+        #if 0
+        // default return moved outside of switch to avoid warning about lack of return in function
         default:
-#if wxUSE_GUI
-            return FALSE;
-#else
             return 1;
-#endif
             break;
+        #endif
     }
+    return 1;
 }
 
 
@@ -169,7 +156,18 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
         parFuncname = _T("InitXmlResource");
 
     for (size_t i = 0; i < cmdline.GetParamCount(); i++)
+    {
+#ifdef __WINDOWS__
+        wxString fn=wxFindFirstFile(cmdline.GetParam(i), wxFILE);
+        while (!fn.IsEmpty())
+        {
+            parFiles.Add(fn);
+            fn=wxFindNextFile();
+        }
+#else
         parFiles.Add(cmdline.GetParam(i));
+#endif
+    }
 }