]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/console/console.cpp
we don't need status bar in the MDI children
[wxWidgets.git] / samples / console / console.cpp
index 90548b244556dbccea560b9bdad53da1dfeef28b..696467232b9b4721ae3fd09ab230e8c808fd8ec4 100644 (file)
@@ -88,7 +88,7 @@
     #define TEST_WCHAR
     #define TEST_ZIP
 #else // #if TEST_ALL
-    #define TEST_FILE
+    #define TEST_TIMER
 #endif
 
 // some tests are interactive, define this to run them
@@ -2784,6 +2784,7 @@ static void TestStackWalk(const char *argv0)
 #ifdef TEST_STDPATHS
 
 #include "wx/stdpaths.h"
+#include "wx/wxchar.h"      // wxPrintf
 
 static void TestStandardPaths()
 {
@@ -2799,6 +2800,7 @@ static void TestStandardPaths()
     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("Executable path:\t%s\n"), stdp.GetExecutablePath().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"),
@@ -2941,6 +2943,46 @@ static void TestStopWatch()
     wxPuts(_T(", ok."));
 }
 
+#include "wx/timer.h"
+#include "wx/evtloop.h"
+
+void TestTimer()
+{
+    wxPuts(_T("*** Testing wxTimer ***\n"));
+
+    class MyTimer : public wxTimer
+    {
+    public:
+        MyTimer() : wxTimer() { m_num = 0; }
+
+        virtual void Notify()
+        {
+            wxPrintf(_T("%d"), m_num++);
+
+            if ( m_num == 10 )
+            {
+                wxPrintf(_T("... exiting the event loop"));
+                Stop();
+
+                wxEventLoop::GetActive()->Exit(0);
+                wxPuts(_T(", ok."));
+            }
+
+            fflush(stdout);
+        }
+
+    private:
+        int m_num;
+    };
+
+    wxEventLoop loop;
+
+    MyTimer timer;
+    timer.Start(500);
+
+    loop.Run();
+}
+
 #endif // TEST_TIMER
 
 // ----------------------------------------------------------------------------
@@ -4367,9 +4409,9 @@ int main(int argc, char **argv)
     wxLog::AddTraceMask(_T("mime"));
     #if TEST_ALL
         TestMimeEnum();
+    #endif
         TestMimeOverride();
         TestMimeAssociate();
-    #endif
     TestMimeFilename();
 #endif // TEST_MIME
 
@@ -4448,6 +4490,7 @@ int main(int argc, char **argv)
 
 #ifdef TEST_TIMER
     TestStopWatch();
+    TestTimer();
 #endif // TEST_TIMER
 
 #ifdef TEST_DATETIME