]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/console/console.cpp
fix a macroscopic error which made Doxygen generate invalid XML
[wxWidgets.git] / samples / console / console.cpp
index 696467232b9b4721ae3fd09ab230e8c808fd8ec4..1744e90776b5cf2028bff2369113ddc0a1aa4c64 100644 (file)
@@ -27,6 +27,7 @@
 #include "wx/log.h"
 #include "wx/apptrait.h"
 #include "wx/platinfo.h"
+#include "wx/wxchar.h"
 
 // without this pragma, the stupid compiler precompiles #defines below so that
 // changing them doesn't "take place" later!
@@ -69,7 +70,6 @@
     #define TEST_MIME
     #define TEST_MODULE
     #define TEST_PATHLIST
-    #define TEST_ODBC
     #define TEST_PRINTF
     #define TEST_REGCONF
     #define TEST_REGEX
@@ -88,7 +88,7 @@
     #define TEST_WCHAR
     #define TEST_ZIP
 #else // #if TEST_ALL
-    #define TEST_TIMER
+    #define TEST_CMDLINE
 #endif
 
 // some tests are interactive, define this to run them
@@ -150,6 +150,7 @@ static void ShowCmdLine(const wxCmdLineParser& parser)
 
     wxString strVal;
     long lVal;
+    double dVal;
     wxDateTime dt;
     if ( parser.Found(_T("o"), &strVal) )
         s << _T("Output file:\t") << strVal << '\n';
@@ -157,6 +158,8 @@ static void ShowCmdLine(const wxCmdLineParser& parser)
         s << _T("Input dir:\t") << strVal << '\n';
     if ( parser.Found(_T("s"), &lVal) )
         s << _T("Size:\t") << lVal << '\n';
+    if ( parser.Found(_T("f"), &dVal) )
+        s << _T("Double:\t") << dVal << '\n';
     if ( parser.Found(_T("d"), &dt) )
         s << _T("Date:\t") << dt.FormatISODate() << '\n';
     if ( parser.Found(_T("project_name"), &strVal) )
@@ -1382,7 +1385,7 @@ static void TestMimeAssociate()
                             _T(""),             // print cmd
                             _T("XYZ File"),     // description
                             _T(".xyz"),         // extensions
-                            NULL                // end of extensions
+                            wxNullPtr           // end of extensions
                          );
     ftInfo.SetShortDesc(_T("XYZFile")); // used under Win32 only
 
@@ -1658,26 +1661,6 @@ static void TestRegExInteractive()
 
 #endif // TEST_REGEX
 
-// ----------------------------------------------------------------------------
-// database
-// ----------------------------------------------------------------------------
-
-#if !wxUSE_ODBC
-    #undef TEST_ODBC
-#endif
-
-#ifdef TEST_ODBC
-
-#include "wx/db.h"
-
-static void TestDbOpen()
-{
-    HENV henv;
-    wxDb db(henv);
-}
-
-#endif // TEST_ODBC
-
 // ----------------------------------------------------------------------------
 // printf() tests
 // ----------------------------------------------------------------------------
@@ -2958,6 +2941,7 @@ void TestTimer()
         virtual void Notify()
         {
             wxPrintf(_T("%d"), m_num++);
+            fflush(stdout);
 
             if ( m_num == 10 )
             {
@@ -2977,6 +2961,11 @@ void TestTimer()
 
     wxEventLoop loop;
 
+    wxTimer timer1;
+    timer1.Start(100, true /* one shot */);
+    timer1.Stop();
+    timer1.Start(100, true /* one shot */);
+
     MyTimer timer;
     timer.Start(500);
 
@@ -4265,19 +4254,21 @@ int main(int argc, char **argv)
 #if wxUSE_CMDLINE_PARSER
     static const wxCmdLineEntryDesc cmdLineDesc[] =
     {
-        { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("show this help message"),
+        { wxCMD_LINE_SWITCH, "h", "help", "show this help message",
             wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
-        { wxCMD_LINE_SWITCH, _T("v"), _T("verbose"), _T("be verbose") },
-        { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet") },
+        { wxCMD_LINE_SWITCH, "v", "verbose", "be verbose" },
+        { wxCMD_LINE_SWITCH, "q", "quiet",   "be quiet" },
 
-        { wxCMD_LINE_OPTION, _T("o"), _T("output"),  _T("output file") },
-        { wxCMD_LINE_OPTION, _T("i"), _T("input"),   _T("input dir") },
-        { wxCMD_LINE_OPTION, _T("s"), _T("size"),    _T("output block size"),
+        { wxCMD_LINE_OPTION, "o", "output",  "output file" },
+        { wxCMD_LINE_OPTION, "i", "input",   "input dir" },
+        { wxCMD_LINE_OPTION, "s", "size",    "output block size",
             wxCMD_LINE_VAL_NUMBER },
-        { wxCMD_LINE_OPTION, _T("d"), _T("date"),    _T("output file date"),
+        { wxCMD_LINE_OPTION, "d", "date",    "output file date",
             wxCMD_LINE_VAL_DATE },
+        { wxCMD_LINE_OPTION, "f", "double",  "output double",
+            wxCMD_LINE_VAL_DOUBLE },
 
-        { wxCMD_LINE_PARAM,  NULL, NULL, _T("input file"),
+        { wxCMD_LINE_PARAM,  NULL, NULL, "input file",
             wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE },
 
         { wxCMD_LINE_NONE }
@@ -4406,12 +4397,10 @@ int main(int argc, char **argv)
 #endif // TEST_FTP
 
 #ifdef TEST_MIME
-    wxLog::AddTraceMask(_T("mime"));
-    #if TEST_ALL
-        TestMimeEnum();
-    #endif
-        TestMimeOverride();
-        TestMimeAssociate();
+    //wxLog::AddTraceMask(_T("mime"));
+    TestMimeEnum();
+    TestMimeOverride();
+    // TestMimeAssociate();
     TestMimeFilename();
 #endif // TEST_MIME
 
@@ -4429,10 +4418,6 @@ int main(int argc, char **argv)
     TestPathList();
 #endif // TEST_PATHLIST
 
-#ifdef TEST_ODBC
-    TestDbOpen();
-#endif // TEST_ODBC
-
 #ifdef TEST_PRINTF
     TestPrintf();
 #endif // TEST_PRINTF