]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/configtool/src/wxconfigtool.cpp
wxURI is enough for the basic url operations.
[wxWidgets.git] / utils / configtool / src / wxconfigtool.cpp
index cd2f5af42fb785dd5748f50a6b180f94b81fb1ab..53da9ef1a3e6e15673dc85bb18232dcde92ec79a 100644 (file)
 #pragma implementation "wxconfigtool.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/config.h"
+#ifndef WX_PRECOMP
+
 #include "wx/laywin.h"
-#include "wx/image.h"
 #include "wx/menuitem.h"
 #include "wx/tooltip.h"
+#include "wx/variant.h"
+
+#endif
+
 #include "wx/cshelp.h"
 #include "wx/helphtml.h"
 #include "wx/html/htmprint.h"
 #include "wx/html/htmlwin.h"
+#include "wx/image.h"
 #include "wx/filesys.h"
 #include "wx/fs_mem.h"
 #include "wx/fs_zip.h"
 #include "wx/wfstream.h"
-#include "wx/variant.h"
-
+#include "wx/config.h"
 #include "wxconfigtool.h"
 #include "configtooldoc.h"
 #include "configtoolview.h"
@@ -52,24 +57,23 @@ ctApp::ctApp()
     m_docManager = NULL;
 }
 
-ctApp::~ctApp()
-{
-}
-
 bool ctApp::OnInit(void)
 {
+
+#if wxUSE_LOG
     wxLog::SetTimestamp(NULL);
-    
+#endif // wxUSE_LOG
+
     wxHelpProvider::Set(new wxSimpleHelpProvider);
 
 #if wxUSE_LIBPNG
     wxImage::AddHandler( new wxPNGHandler );
 #endif
-    
+
 #if wxUSE_LIBJPEG
     wxImage::AddHandler( new wxJPEGHandler );
 #endif
-    
+
 #if wxUSE_GIF
     wxImage::AddHandler( new wxGIFHandler );
 #endif
@@ -90,7 +94,9 @@ bool ctApp::OnInit(void)
     wxString currentDir = wxGetCwd();
 
     // Use argv to get current app directory
-    m_appDir = apFindAppPath(argv[0], currentDir, wxT("WXCONFIGTOOLDIR"));
+    wxString argv0(argv[0]);
+    wxString appVariableName(wxT("WXCONFIGTOOLDIR"));
+    m_appDir = apFindAppPath(argv0, currentDir, appVariableName);
 
 #ifdef __WXMSW__
     // If the development version, go up a directory.
@@ -114,13 +120,13 @@ bool ctApp::OnInit(void)
     m_settings.Init();
 
     LoadConfig();
+
     wxString helpFilePathReference(GetFullAppPath(_("wx")));
     m_helpControllerReference->Initialize(helpFilePathReference);
-    
+
     wxString helpFilePath(GetFullAppPath(_("configtool")));
     m_helpController->Initialize(helpFilePath);
-    
+
     ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, wxID_ANY, wxGetApp().GetSettings().GetAppName(),
         GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(),
         wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
@@ -184,16 +190,16 @@ bool ctApp::OnInit(void)
                 doc->SetDocumentSaved(true);
         }
     }
-    
+
     GetTopWindow()->Show(true);
-    
+
     return true;
 }
 
 int ctApp::OnExit(void)
 {
     SaveConfig();
-    
+
     // Save the file history
     {
         wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("Generic Organisation"));
@@ -202,7 +208,7 @@ int ctApp::OnExit(void)
 
     delete m_docManager;
     m_docManager = NULL;
-    
+
     return 0;
 }
 
@@ -210,7 +216,7 @@ void ctApp::ClearHelpControllers()
 {
     delete m_helpController;
     m_helpController = NULL;
-        
+
     delete m_helpControllerReference;
     m_helpControllerReference = NULL;
 }
@@ -223,7 +229,7 @@ wxString ctApp::GetFullAppPath(const wxString& filename) const
     if (path.Last() != wxFILE_SEP_PATH && filename[0] != wxFILE_SEP_PATH)
         path += wxFILE_SEP_PATH;
     path += filename;
-    
+
     return path;
 }