diff --git a/samples/event/event.cpp b/samples/event/event.cpp index b397f828aa..7e1af4cf80 100644 --- a/samples/event/event.cpp +++ b/samples/event/event.cpp @@ -298,8 +298,6 @@ bool MyApp::OnInit() if ( !wxApp::OnInit() ) return false; - wxImage::AddHandler(new wxJPEGHandler); - // create the main application window MyFrame *frame = new MyFrame(wxT("Event wxWidgets Sample"), wxPoint(50, 50), wxSize(600, 340)); diff --git a/samples/event/gestures.cpp b/samples/event/gestures.cpp index 06b6cd794a..f28c53dc89 100644 --- a/samples/event/gestures.cpp +++ b/samples/event/gestures.cpp @@ -1,6 +1,8 @@ #include "gestures.h" #include "wx/dcgraph.h" +#include "../image/horse.xpm" + MyGestureFrame::MyGestureFrame() : wxFrame(NULL, wxID_ANY, "Multi-touch Gestures", wxDefaultPosition, wxSize(800, 600)) { @@ -30,18 +32,11 @@ MyGestureFrame::MyGestureFrame() Bind(wxEVT_CLOSE_WINDOW, &MyGestureFrame::OnQuit, this); } -MyGesturePanel::MyGesturePanel(MyGestureFrame *parent) : wxPanel(parent, wxID_ANY) +MyGesturePanel::MyGesturePanel(MyGestureFrame *parent) + : wxPanel(parent, wxID_ANY), + m_bitmap(horse_xpm) { - // Load an image - if ( !m_bitmap.LoadFile("../image/horse.jpg", wxBITMAP_TYPE_JPEG) ) - { - wxLogError("Can't load the image"); - } - - else - { - Bind(wxEVT_PAINT, &MyGesturePanel::OnPaint, this); - } + Bind(wxEVT_PAINT, &MyGesturePanel::OnPaint, this); if ( !EnableTouchEvents(wxTOUCH_ALL_GESTURES) ) {