X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac7ad70d4c6d7db2ab9e01a4662611f2a706b6fe..21b2dde583e83d3ad455c20fa8db717037b5f548:/samples/console/console.cpp diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 8c405aab04..04c23b8225 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -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! @@ -88,27 +89,7 @@ #define TEST_WCHAR #define TEST_ZIP #else // #if TEST_ALL -<<<<<<< console.cpp -<<<<<<< console.cpp -<<<<<<< console.cpp -<<<<<<< console.cpp -<<<<<<< console.cpp #define TEST_MIME -======= - #define TEST_STDPATHS ->>>>>>> 1.197 -======= - #define TEST_MODULE ->>>>>>> 1.199 -======= - #define TEST_INFO_FUNCTIONS ->>>>>>> 1.201 -======= - #define TEST_STDPATHS ->>>>>>> 1.203 -======= - #define TEST_FILE ->>>>>>> 1.204 #endif // some tests are interactive, define this to run them @@ -1402,7 +1383,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 @@ -2804,6 +2785,7 @@ static void TestStackWalk(const char *argv0) #ifdef TEST_STDPATHS #include "wx/stdpaths.h" +#include "wx/wxchar.h" // wxPrintf static void TestStandardPaths() { @@ -2962,6 +2944,52 @@ 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++); + fflush(stdout); + + 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; + + wxTimer timer1; + timer1.Start(100, true /* one shot */); + timer1.Stop(); + timer1.Start(100, true /* one shot */); + + MyTimer timer; + timer.Start(500); + + loop.Run(); +} + #endif // TEST_TIMER // ---------------------------------------------------------------------------- @@ -4385,12 +4413,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 @@ -4469,6 +4495,7 @@ int main(int argc, char **argv) #ifdef TEST_TIMER TestStopWatch(); + TestTimer(); #endif // TEST_TIMER #ifdef TEST_DATETIME