]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
added GetBorder(flags)
[wxWidgets.git] / src / common / appbase.cpp
index 271e3cd7e584cba012dd631213d2ff8f01114893..c2528ec5c9e227db222927d9abc362520c9c15ef 100644 (file)
@@ -36,6 +36,9 @@
 #include "wx/apptrait.h"
 #include "wx/cmdline.h"
 #include "wx/confbase.h"
+#if wxUSE_FILENAME
+    #include "wx/filename.h"
+#endif // wxUSE_FILENAME
 #if wxUSE_FONTMAP
     #include "wx/fontmap.h"
 #endif // wxUSE_FONTMAP
@@ -114,6 +117,33 @@ wxAppConsole::~wxAppConsole()
     delete m_traits;
 }
 
+// ----------------------------------------------------------------------------
+// initilization/cleanup
+// ----------------------------------------------------------------------------
+
+bool wxAppConsole::Initialize(int& argc, wxChar **argv)
+{
+    // remember the command line arguments
+    this->argc = argc;
+    this->argv = argv;
+
+    if ( m_appName.empty() && argv )
+    {
+        // the application name is, by default, the name of its executable file
+#if wxUSE_FILENAME
+        wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL);
+#else // !wxUSE_FILENAME
+        m_appName = argv[0];
+#endif // wxUSE_FILENAME/!wxUSE_FILENAME
+    }
+
+    return true;
+}
+
+void wxAppConsole::CleanUp()
+{
+}
+
 // ----------------------------------------------------------------------------
 // OnXXX() callbacks
 // ----------------------------------------------------------------------------
@@ -178,7 +208,7 @@ void wxAppConsole::Exit()
 
 wxAppTraits *wxAppConsole::CreateTraits()
 {
-    return wxAppTraits::CreateConsole();
+    return new wxConsoleAppTraits;
 }
 
 wxAppTraits *wxAppConsole::GetTraits()
@@ -516,11 +546,6 @@ bool wxAppTraitsBase::ShowAssertDialog(const wxString& msg)
 
 #endif // __WXDEBUG__
 
-wxAppTraits *wxAppTraitsBase::CreateConsole()
-{
-    return new wxConsoleAppTraits;
-}
-
 // ============================================================================
 // global functions implementation
 // ============================================================================