]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/rotate/rotate.cpp
Patch 950002 after agreement from Markus Sinner
[wxWidgets.git] / samples / rotate / rotate.cpp
index 2f26cf2a7ef9e237bd53b923d5d986bd621f4cfa..3a11213e83661f184d14e0668882f8ec5f3f77de 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #include "wx/image.h"
+#include "wx/numdlg.h"
 
 /* GRG: This is not ANSI standard, define M_PI explicitly
 #include <math.h>       // M_PI
@@ -89,7 +90,7 @@ 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 );
@@ -101,7 +102,7 @@ bool MyApp::OnInit()
         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 +118,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 +131,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 +150,7 @@ MyCanvas::MyCanvas(wxWindow* parent):
   wxScrolledWindow(parent, -1)
 {
     SetBackgroundColour (wxColour (0,80,60));
-    Clear();
+    ClearBackground();
 }
 
 // Rotate with interpolation and with offset correction