X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..690201a250dcdd2a38aa4156df4375dd135209df:/samples/rotate/rotate.cpp diff --git a/samples/rotate/rotate.cpp b/samples/rotate/rotate.cpp index 89c7a0d299..87b9a07960 100644 --- a/samples/rotate/rotate.cpp +++ b/samples/rotate/rotate.cpp @@ -89,19 +89,19 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { - m_image = wxImage("kclub.bmp", wxBITMAP_TYPE_BMP); + m_image = wxImage(_T("kclub.bmp"), wxBITMAP_TYPE_BMP); // any unused colour will do m_image.SetMaskColour( 0, 255, 255 ); if ( !m_image.Ok() ) { - wxLogError("Can't load the test image, please copy it to the " - "program directory"); + wxLogError(wxT("Can't load the test image, please copy it to the ") + wxT("program directory")); return FALSE; } - MyFrame *frame = new MyFrame ("wxWindows rotate sample", + MyFrame *frame = new MyFrame (_T("wxWindows rotate sample"), wxPoint(20,20), wxSize(600,450)); frame->Show (TRUE); @@ -117,12 +117,12 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) new MyCanvas(this); wxMenu *menuFile = new wxMenu; - menuFile->Append (ID_Angle, "Set &angle\tCtrl-A"); + menuFile->Append (ID_Angle, _T("Set &angle\tCtrl-A")); menuFile->AppendSeparator(); - menuFile->Append (ID_Quit, "E&xit\tAlt-X"); + menuFile->Append (ID_Quit, _T("E&xit\tAlt-X")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append (menuFile, "&File"); + menuBar->Append (menuFile, _T("&File")); SetMenuBar (menuBar); } @@ -130,9 +130,9 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) void MyFrame::OnAngle (wxCommandEvent &) { long degrees = (long)((180*m_angle)/M_PI); - degrees = wxGetNumberFromUser("Change the image rotation angle", - "Angle in degrees:", - "wxWindows rotate sample", + degrees = wxGetNumberFromUser(_T("Change the image rotation angle"), + _T("Angle in degrees:"), + _T("wxWindows rotate sample"), degrees, -180, +180, this); @@ -149,7 +149,7 @@ MyCanvas::MyCanvas(wxWindow* parent): wxScrolledWindow(parent, -1) { SetBackgroundColour (wxColour (0,80,60)); - Clear(); + ClearBackground(); } // Rotate with interpolation and with offset correction @@ -161,10 +161,10 @@ void MyCanvas::OnMouseLeftUp (wxMouseEvent & event) const wxImage& img = wxGetApp().GetImage(); wxImage img2 = img.Rotate(frame->m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), TRUE, &offset); - wxBitmap bmp = img2.ConvertToBitmap (); + wxBitmap bmp(img2); wxClientDC dc (this); - dc.DrawBitmap (img2.ConvertToBitmap(), event.m_x + offset.x, event.m_y + offset.y, TRUE); + dc.DrawBitmap (bmp, event.m_x + offset.x, event.m_y + offset.y, TRUE); } // without interpolation, and without offset correction @@ -175,7 +175,7 @@ void MyCanvas::OnMouseRightUp (wxMouseEvent & event) const wxImage& img = wxGetApp().GetImage(); wxImage img2 = img.Rotate(frame->m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), FALSE); - wxBitmap bmp = img2.ConvertToBitmap (); + wxBitmap bmp(img2); wxClientDC dc (this); dc.DrawBitmap (bmp, event.m_x, event.m_y, TRUE);