]> git.saurik.com Git - wxWidgets.git/commitdiff
Needed some variation; got bored of seeing the compilation errors for this
authorOve Kaaven <ovek@arcticnet.no>
Sat, 24 Jul 1999 12:39:40 +0000 (12:39 +0000)
committerOve Kaaven <ovek@arcticnet.no>
Sat, 24 Jul 1999 12:39:40 +0000 (12:39 +0000)
sample in Unicode mode, so now I can see the errors for the next instead

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/caret/caret.cpp

index 3f41e9b3ac28d7be099572ee4f28ef417b2d59dc..9142ef3094b74d4e27444f022b1e33505e59b202 100644 (file)
@@ -87,7 +87,7 @@ public:
     MyCanvas( wxWindow *parent );
     ~MyCanvas();
 
     MyCanvas( wxWindow *parent );
     ~MyCanvas();
 
-    char& CharAt(int x, int y) { return *(m_text + x + m_xChars * y); }
+    wxChar& CharAt(int x, int y) { return *(m_text + x + m_xChars * y); }
 
     // caret movement
     void Home() { m_xCaret = 0; }
 
     // caret movement
     void Home() { m_xCaret = 0; }
@@ -121,7 +121,7 @@ private:
     int      m_xChars, m_yChars;
 
     // the text
     int      m_xChars, m_yChars;
 
     // the text
-    char    *m_text;
+    wxChar  *m_text;
 
     DECLARE_DYNAMIC_CLASS(MyCanvas)
     DECLARE_EVENT_TABLE()
 
     DECLARE_DYNAMIC_CLASS(MyCanvas)
     DECLARE_EVENT_TABLE()
@@ -265,7 +265,7 @@ MyCanvas::MyCanvas( wxWindow *parent )
                             wxDefaultPosition, wxDefaultSize,
                             wxSUNKEN_BORDER )
 {
                             wxDefaultPosition, wxDefaultSize,
                             wxSUNKEN_BORDER )
 {
-    m_text = (char *)NULL;
+    m_text = (wxChar *)NULL;
 
     SetBackgroundColour(* wxWHITE);
 
 
     SetBackgroundColour(* wxWHITE);
 
@@ -301,10 +301,10 @@ void MyCanvas::OnSize( wxSizeEvent &event )
         m_yChars = 1;
 
     free(m_text);
         m_yChars = 1;
 
     free(m_text);
-    m_text = (char *)calloc(m_xChars * m_yChars, sizeof(char));
+    m_text = (wxChar *)calloc(m_xChars * m_yChars, sizeof(wxChar));
 
     wxString msg;
 
     wxString msg;
-    msg.Printf("Panel size is (%d, %d)", m_xChars, m_yChars);
+    msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars);
 
     ((wxFrame *)GetParent())->SetStatusText(msg, 1);
 
 
     ((wxFrame *)GetParent())->SetStatusText(msg, 1);
 
@@ -324,9 +324,9 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
 
         for ( int x = 0; x < m_xChars; x++ )
         {
 
         for ( int x = 0; x < m_xChars; x++ )
         {
-            char ch = CharAt(x, y);
+            wxChar ch = CharAt(x, y);
             if ( !ch )
             if ( !ch )
-                ch = ' ';
+                ch = _T(' ');
             line += ch;
         }
 
             line += ch;
         }
 
@@ -368,9 +368,9 @@ void MyCanvas::OnChar( wxKeyEvent &event )
             break;
 
         default:
             break;
 
         default:
-            if ( isprint(event.KeyCode()) )
+            if ( wxIsprint(event.KeyCode()) )
             {
             {
-                CharAt(m_xCaret, m_yCaret) = (char)event.KeyCode();
+                CharAt(m_xCaret, m_yCaret) = (wxChar)event.KeyCode();
                 NextChar();
             }
             else
                 NextChar();
             }
             else
@@ -380,7 +380,7 @@ void MyCanvas::OnChar( wxKeyEvent &event )
             }
     }
 
             }
     }
 
-    wxLogStatus("Caret is at (%d, %d)", m_xCaret, m_yCaret);
+    wxLogStatus(_T("Caret is at (%d, %d)"), m_xCaret, m_yCaret);
 
     m_caret.Move(m_xMargin + m_xCaret * m_widthChar,
                  m_yMargin + m_yCaret * m_heightChar);
 
     m_caret.Move(m_xMargin + m_xCaret * m_widthChar,
                  m_yMargin + m_yCaret * m_heightChar);