X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0bc9b25e9a0218d5ddc1d12c40dd96216bb275e7..a3c1786def55bcc233f9606acb1aceee956d184f:/samples/wxpoem/wxpoem.cpp?ds=inline diff --git a/samples/wxpoem/wxpoem.cpp b/samples/wxpoem/wxpoem.cpp index 2482790364..4890c8f92a 100644 --- a/samples/wxpoem/wxpoem.cpp +++ b/samples/wxpoem/wxpoem.cpp @@ -26,9 +26,7 @@ #endif #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/list.h" -#include "wx/utils.h" +#include "wx/wx.h" #endif #include "wx/help.h" @@ -135,7 +133,9 @@ void CopyToClipboard(HWND, char *); wxMenu *popupMenu = NULL; void PopupFunction(wxMenu& menu, wxCommandEvent& event); -wxHelpController *HelpController = NULL; +#if wxUSE_HELP + wxHelpController *HelpController = NULL; +#endif // wxUSE_HELP IMPLEMENT_APP(MyApp) @@ -590,8 +590,10 @@ bool MyApp::OnInit() DarkGreyPen = new wxPen("GREY", THICK_LINE_WIDTH, wxSOLID); WhitePen = new wxPen("WHITE", THICK_LINE_WIDTH, wxSOLID); +#if wxUSE_HELP HelpController = new wxHelpController(); HelpController->Initialize("wxpoem"); +#endif // wxUSE_HELP CreateFonts(); @@ -606,13 +608,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"); @@ -666,7 +668,9 @@ int MyApp::OnExit() { if (backingBitmap) delete backingBitmap; +#if wxUSE_HELP delete HelpController; +#endif // wxUSE_HELP delete GreyPen; delete DarkGreyPen; delete WhitePen; @@ -695,7 +699,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) @@ -703,7 +707,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) { } @@ -1122,8 +1126,10 @@ void PopupFunction(wxMenu& /*menu*/, wxCommandEvent& event) } case POEM_HELP_CONTENTS: { +#if wxUSE_HELP HelpController->LoadFile("wxpoem"); HelpController->DisplayContents(); +#endif // wxUSE_HELP break; } case POEM_ABOUT: