X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6f28223ee2e8afe7c94fa288859458b99ace7dd..89be85c244981722e20e8755031f44f0d51a820e:/demos/poem/wxpoem.cpp diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index 9bdca453e9..24dabe56b7 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 @@ -219,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 ++; } @@ -488,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; } @@ -553,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 { @@ -660,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); @@ -747,7 +748,7 @@ int LoadIndex(wxChar *file_name) wxSprintf(buf, _T("%s.idx"), file_name); - index_file = wxFopen(buf, _T("r")); + index_file = wxFopen(wxFNCONV(buf), _T("r")); if (index_file == NULL) return 0; @@ -822,7 +823,7 @@ bool LoadPoem(wxChar *file_name, long position) } wxSprintf(buf, _T("%s.dat"), file_name); - data_file = wxFopen(buf, _T("r")); + data_file = wxFopen(wxFNCONV(buf), _T("r")); if (data_file == NULL) { @@ -850,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) @@ -896,7 +897,7 @@ long MainWindow::DoSearch(void) if (data_filename) wxSprintf(buf, _T("%s.dat"), data_filename); - file = wxFopen(buf, _T("r")); + file = wxFopen(wxFNCONV(buf), _T("r")); if (! (data_filename && file)) { wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf); @@ -978,7 +979,7 @@ bool Compile(void) if (data_filename) wxSprintf(buf, _T("%s.dat"), data_filename); - file = wxFopen(buf, _T("r")); + file = wxFopen(wxFNCONV(buf), _T("r")); if (! (data_filename && file)) { wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf); @@ -993,7 +994,7 @@ bool Compile(void) nitems ++; // Do rest - + do { ch = getc(file); if (ch == '#') @@ -1010,7 +1011,7 @@ bool Compile(void) if (index_filename) wxSprintf(buf, _T("%s.idx"), index_filename); - file = wxFopen(buf, _T("w")); + file = wxFopen(wxFNCONV(buf), _T("w")); if (! (data_filename && file)) { wxSprintf(error_buf, _T("Poetry index file %s cannot be created\n"), buf);