X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/197ab43d72571ecfd86c35f1832f063237775648..11e3c6ef36393fb5863ea2f9601d8facd73acb12:/samples/html/printing/printing.cpp diff --git a/samples/html/printing/printing.cpp b/samples/html/printing/printing.cpp index bfec54d97f..7d6458d9f9 100644 --- a/samples/html/printing/printing.cpp +++ b/samples/html/printing/printing.cpp @@ -1,11 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// // Name: printing.cpp // Purpose: wxHtml sample: wxHtmlEasyPrinting test -// Author: ? -// Modified by: -// Created: ? +// Author: Vaclav Slavik // RCS-ID: $Id$ -// Copyright: (c) wxWidgets team +// Copyright: (c) 1998-2009 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -27,7 +25,7 @@ #include "wx/html/htmlwin.h" #include "wx/html/htmprint.h" -#ifndef __WXMSW__ +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../../sample.xpm" #endif @@ -154,11 +152,8 @@ bool MyApp::OnInit() MyFrame *frame = new MyFrame(_("Printing test"), wxDefaultPosition, wxSize(640, 480)); - // Show it and tell the application that it's our main window - // @@@ what does it do exactly, in fact? is it necessary here? + // Show it frame->Show(true); - SetTopWindow(frame); - // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned false here, the @@ -181,23 +176,23 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) wxMenu *menuFile = new wxMenu; menuFile->Append(Minimal_Open, _("Open...\tCtrl-O")); menuFile->AppendSeparator(); - menuFile->Append(Minimal_PageSetup, _("Page Setup")); - menuFile->Append(Minimal_Print, _("Print...")); - menuFile->Append(Minimal_Preview, _("Preview...")); + menuFile->Append(Minimal_PageSetup, _("Page &Setup")); + menuFile->Append(Minimal_Preview, _("Print pre&view...")); + menuFile->Append(Minimal_Print, _("Print...\tCtrl-P")); menuFile->AppendSeparator(); menuFile->Append(wxID_ABOUT, _("&About")); menuFile->AppendSeparator(); menuFile->Append(Minimal_Quit, _("&Exit")); - wxMenu *testFile = new wxMenu; - testFile->Append(Minimal_PrintSmall, _("Small Printer Fonts")); - testFile->Append(Minimal_PrintNormal, _("Normal Printer Fonts")); - testFile->Append(Minimal_PrintHuge, _("Huge Printer Fonts")); + wxMenu *menuFonts = new wxMenu; + menuFonts->AppendRadioItem(Minimal_PrintSmall, _("&Small Printer Fonts")); + menuFonts->AppendRadioItem(Minimal_PrintNormal, _("&Normal Printer Fonts")); + menuFonts->AppendRadioItem(Minimal_PrintHuge, _("&Huge Printer Fonts")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; menuBar->Append(menuFile, _("&File")); - menuBar->Append(testFile, _("&Test")); + menuBar->Append(menuFonts, _("F&onts")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -225,8 +220,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // frame destructor MyFrame::~MyFrame() { - delete m_Prn; - m_Prn = (wxHtmlEasyPrinting *) NULL; + wxDELETE(m_Prn); }