]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/wxpoem/wxpoem.cpp
No longer emit char events for shift/ctrl presses.
[wxWidgets.git] / samples / wxpoem / wxpoem.cpp
index 7ae00905cc57f233535393951bc432edececd863..49833dd30d968587f3138cf93e76118e1ee4295c 100644 (file)
 #include <string.h>
 #include <time.h>
 
+#ifdef __WINDOWS__
+#include <windows.h>
+#ifdef DrawText
+#undef DrawText
+#endif
+#endif
+
 #define         buf_size 10000
 #define         DEFAULT_POETRY_DAT "wxpoem"
 #define         DEFAULT_POETRY_IND "wxpoem"
@@ -130,10 +137,6 @@ void PopupFunction(wxMenu& menu, wxCommandEvent& event);
 
 wxHelpController *HelpController = NULL;
 
-// A macro needed for some compilers (AIX) that need 'main' to be defined
-// in the application itself.
-IMPLEMENT_WXWIN_MAIN
-
 IMPLEMENT_APP(MyApp)
 
 MainWindow *TheMainWindow = NULL;
@@ -603,13 +606,13 @@ bool MyApp::OnInit()
 //    randomize();
   pages[0] = 0;
 
-  TheMainWindow = new MainWindow(NULL, -1, "wxPoem", wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU);
+  TheMainWindow = new MainWindow(NULL, 500, "wxPoem", wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU);
 
 #ifdef wx_x
   TheMainWindow->SetIcon(Icon("wxpoem"));
 #endif
 
-  TheMainWindow->canvas = new MyCanvas(TheMainWindow, -1, wxDefaultPosition, wxDefaultSize);
+  TheMainWindow->canvas = new MyCanvas(TheMainWindow, 501, wxDefaultPosition, wxDefaultSize);
 
   popupMenu = new wxMenu("", (wxFunction)PopupFunction);
   popupMenu->Append(POEM_NEXT, "Next poem/page");
@@ -692,7 +695,7 @@ void MainWindow::OnChar(wxKeyEvent& event)
     canvas->OnChar(event);
 }
 
-BEGIN_EVENT_TABLE(MyCanvas, wxPanel)
+BEGIN_EVENT_TABLE(MyCanvas, wxWindow)
     EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent)
     EVT_CHAR(MyCanvas::OnChar)
     EVT_PAINT(MyCanvas::OnPaint)
@@ -700,7 +703,7 @@ END_EVENT_TABLE()
 
 // Define a constructor for my canvas
 MyCanvas::MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size):
- wxPanel(frame, id, pos, size)
+ wxWindow(frame, id, pos, size)
 {
 }