]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/convertrc/convert.cpp
define _HPUX_SOURCE under HP-UX, otherwise many things are not defined in standard...
[wxWidgets.git] / contrib / utils / convertrc / convert.cpp
index b2d17962efc1b40d0c09315d6490f87444dbc102..43aebfce0526e96d1bfa0dded5ea4dc8e1f5305d 100644 (file)
@@ -5,11 +5,6 @@
 3.  Converts portions of an .RC file into a wxr file
 */
 
-#ifdef __GNUG__
-#pragma implementation "convert.cpp"
-#pragma interface "convert.cpp"
-#endif
-
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
 #endif
 
 // 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
-#include <wx/wx.h>
+#include "wx/wx.h"
 #endif
 
-#include <wx/image.h>
+#include "wx/image.h"
 
 #include "wx/deprecated/setup.h"
 #include "wx/deprecated/resource.h"
@@ -58,17 +53,17 @@ bool wxConvertApp::OnInit()
     SetAppName(_T("wxConvertApp"));
 
     if (HandleCommandLine())
-        return TRUE;
+        return true;
 
 
 // Create the main frame window
-    m_pFrame = new wxMainFrame(NULL, -1, _T("wxConvertApp"), wxPoint(0, 0), wxSize(500, 400),
+    m_pFrame = new wxMainFrame(NULL, wxID_ANY, _T("wxConvertApp"), wxPoint(0, 0), wxSize(500, 400),
         wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
 
     InitMenu();
-    m_pFrame->Show(TRUE);
+    m_pFrame->Show(true);
     SetTopWindow(m_pFrame);
-    return TRUE;
+    return true;
 }
 
 void wxConvertApp::InitMenu()
@@ -122,12 +117,13 @@ wxMainFrame::~wxMainFrame()
 
 void wxMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
-    Close(TRUE);
+    Close(true);
 }
 
 
 void wxMainFrame::OnRc2Wxr(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_FILEDLG
     wxFileDialog filed(this);
     filed.SetWildcard(_T("*.rc"));
     filed.SetStyle(wxOPEN);
@@ -145,10 +141,12 @@ void wxMainFrame::OnRc2Wxr(wxCommandEvent& WXUNUSED(event))
 
     rc2wxr convert;
     convert.Convert(wxrfile.GetPath(),filed.GetPath());
+#endif // wxUSE_FILEDLG
 }
 
 void wxMainFrame::OnWXR2XML(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_FILEDLG
     wxFileDialog f(this);
     f.SetWildcard(_T("*.wxr"));
     if (f.ShowModal()!=wxID_OK)
@@ -165,11 +163,12 @@ void wxMainFrame::OnWXR2XML(wxCommandEvent& WXUNUSED(event))
 
     wxr2xml XMLCon;
     XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
-
+#endif // wxUSE_FILEDLG
 }
 
 void wxMainFrame::OnRC2XML(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_FILEDLG
     wxFileDialog f(this);
     f.SetWildcard(_T("*.rc"));
     if (f.ShowModal()!=wxID_OK)
@@ -185,14 +184,14 @@ void wxMainFrame::OnRC2XML(wxCommandEvent& WXUNUSED(event))
 
     rc2xml XMLCon;
     XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
-
+#endif // wxUSE_FILEDLG
 }
 
 bool wxConvertApp::HandleCommandLine()
 {
 
    if (argc != 2)
-       return FALSE;
+       return false;
 
 //Figure out kind of conversion
     wxString source,target;
@@ -208,18 +207,18 @@ bool wxConvertApp::HandleCommandLine()
     if ((source.Find(_T(".wxr"))>0)&&(target.Find(_T(".xml"))>0))
         {
         trans_wxr2xml.Convert(source,target);
-        return TRUE;
+        return true;
         }
-    else if ((source.Find(_T(".rc"))!=-1)&(target.Find(_T(".wxr"))!=-1))
+    else if ((source.Find(_T(".rc"))!=wxNOT_FOUND)&(target.Find(_T(".wxr"))!=wxNOT_FOUND))
         {
         trans_rc2wxr.Convert(source,target);
-        return TRUE;
+        return true;
         }
-    else if ((source.Find(_T(".rc"))!=-1)&(target.Find(_T(".xml"))!=-1))
+    else if ((source.Find(_T(".rc"))!=wxNOT_FOUND)&(target.Find(_T(".xml"))!=wxNOT_FOUND))
         {
         trans_rc2xml.Convert(source,target);
-        return TRUE;
+        return true;
         }
 
-    return FALSE;
+    return false;
 }