]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/console/console.cpp
Missing header
[wxWidgets.git] / samples / console / console.cpp
index 91876f7d424403def096a937e0d6f85f9b28772d..7f0b545c80ea9972e139d886c9e12d3a0b329b46 100644 (file)
@@ -65,6 +65,7 @@
     #define TEST_LOCALE
     #define TEST_LOG
     #define TEST_MIME
+    #define TEST_MODULE
     #define TEST_PATHLIST
     #define TEST_ODBC
     #define TEST_PRINTF
@@ -85,7 +86,7 @@
     #define TEST_WCHAR
     #define TEST_ZIP
 #else // #if TEST_ALL
-    #define TEST_DIR
+    #define TEST_MODULE
 #endif
 
 // some tests are interactive, define this to run them
@@ -1381,6 +1382,80 @@ static void TestMimeAssociate()
 
 #endif // TEST_MIME
 
+// ----------------------------------------------------------------------------
+// module dependencies feature
+// ----------------------------------------------------------------------------
+
+#ifdef TEST_MODULE
+
+#include "wx/module.h"
+
+class wxTestModule : public wxModule
+{
+protected:
+    virtual bool OnInit() { wxPrintf(_T("Load module: %s\n"), GetClassInfo()->GetClassName()); return true; }
+    virtual void OnExit() { wxPrintf(_T("Unload module: %s\n"), GetClassInfo()->GetClassName()); }
+};
+
+class wxTestModuleA : public wxTestModule
+{
+public:
+    wxTestModuleA();
+private:
+    DECLARE_DYNAMIC_CLASS(wxTestModuleA)
+};
+
+class wxTestModuleB : public wxTestModule
+{
+public:
+    wxTestModuleB();
+private:
+    DECLARE_DYNAMIC_CLASS(wxTestModuleB)
+};
+
+class wxTestModuleC : public wxTestModule
+{
+public:
+    wxTestModuleC();
+private:
+    DECLARE_DYNAMIC_CLASS(wxTestModuleC)
+};
+
+class wxTestModuleD : public wxTestModule
+{
+public:
+    wxTestModuleD();
+private:
+    DECLARE_DYNAMIC_CLASS(wxTestModuleD)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxTestModuleC, wxModule)
+wxTestModuleC::wxTestModuleC()
+{
+    AddDependency(CLASSINFO(wxTestModuleD));
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxTestModuleA, wxModule)
+wxTestModuleA::wxTestModuleA()
+{
+    AddDependency(CLASSINFO(wxTestModuleB));
+    AddDependency(CLASSINFO(wxTestModuleD));
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxTestModuleD, wxModule)
+wxTestModuleD::wxTestModuleD()
+{
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxTestModuleB, wxModule)
+wxTestModuleB::wxTestModuleB()
+{
+    AddDependency(CLASSINFO(wxTestModuleD));
+    AddDependency(CLASSINFO(wxTestModuleC));
+}
+
+#endif // TEST_MODULE
+
 // ----------------------------------------------------------------------------
 // misc information functions
 // ----------------------------------------------------------------------------
@@ -2684,7 +2759,17 @@ static void TestStandardPaths()
     wxPrintf(_T("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir().c_str());
     wxPrintf(_T("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str());
     wxPrintf(_T("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str());
+    wxPrintf(_T("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str());
     wxPrintf(_T("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str());
+    wxPrintf(_T("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str());
+    wxPrintf(_T("Localized res. dir:\t%s\n"),
+             stdp.GetLocalizedResourcesDir(_T("fr")).c_str());
+    wxPrintf(_T("Message catalogs dir:\t%s\n"),
+             stdp.GetLocalizedResourcesDir
+                  (
+                    _T("fr"),
+                    wxStandardPaths::ResourceCat_Messages
+                  ).c_str());
 }
 
 #endif // TEST_STDPATHS