X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17d31882db35ec37bbe79d7877d2fec7a19cf6bb..df83b840bbf6441a0166848d49a093557e562926:/demos/poem/wxpoem.cpp?ds=sidebyside diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index e0c04ad435..1ac305abe9 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -36,6 +36,7 @@ #include "corner2.xpm" #include "corner3.xpm" #include "corner4.xpm" +#include "wxpoem.xpm" #endif #define buf_size 10000 @@ -118,6 +119,10 @@ void CreateFonts(); #include "wx/clipbrd.h" #endif +#ifdef __WXWINCE__ + STDAPI_(__int64) CeGetRandomSeed(); +#endif + IMPLEMENT_APP(MyApp) MainWindow *TheMainWindow = NULL; @@ -215,7 +220,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) while (((ch = poem_buffer[i]) != 10) && (ch != 0)) #endif { - line[j] = ch; + line[j] = (wxChar)ch; j ++; i ++; } @@ -484,7 +489,7 @@ void MainWindow::Search(bool ask) { s.MakeLower(); if (search_string) delete[] search_string; - search_string = copystring(s); + search_string = wxStrcpy(new wxChar[wxStrlen(s.c_str()) + 1], s.c_str()); search_ok = true; } else search_ok = false; } @@ -523,10 +528,14 @@ bool MyApp::OnInit() ReadPreferences(); // Seed the random number generator +#ifdef __WXWINCE__ + srand((unsigned) CeGetRandomSeed()); +#else time_t current_time; (void)time(¤t_time); srand((unsigned int)current_time); +#endif // randomize(); pages[0] = 0; @@ -545,8 +554,8 @@ bool MyApp::OnInit() if (argc > 1) { - index_filename = copystring(argv[1]); - data_filename = copystring(argv[1]); + index_filename = wxStrcpy(new wxChar[wxStrlen(argv[1]) + 1], argv[1]); + data_filename = wxStrcpy(new wxChar[wxStrlen(argv[1]) + 1], argv[1]); } else { @@ -652,7 +661,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) TheMainWindow->GetClientSize(&xx, &yy); dc.DrawBitmap(* backingBitmap, 0, 0); -#if 0 +#if 0 wxMemoryDC memDC; memDC.SelectObject(* backingBitmap); dc.Blit(0, 0, backingBitmap->GetWidth(), backingBitmap->GetHeight(), &memDC, 0, 0); @@ -842,7 +851,7 @@ bool LoadPoem(wxChar *file_name, long position) i++; } - poem_buffer[i] = ch; + poem_buffer[i] = (wxChar)ch; i ++; if (i == buf_size) @@ -985,7 +994,7 @@ bool Compile(void) nitems ++; // Do rest - + do { ch = getc(file); if (ch == '#')