]> git.saurik.com Git - wxWidgets.git/commitdiff
Unicode compilation fixed for almost all samples
authorMattia Barbon <mbarbon@cpan.org>
Thu, 22 Nov 2001 09:11:33 +0000 (09:11 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Thu, 22 Nov 2001 09:11:33 +0000 (09:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp
samples/dnd/dnd.cpp
samples/drawing/drawing.cpp
samples/font/font.cpp
samples/grid/grid.cpp
samples/image/image.cpp
samples/regtest/regtest.cpp
samples/scroll/scroll.cpp
samples/scrollsub/scrollsub.cpp
samples/statbar/statbar.cpp

index 3ccb94120bbb08ad1f62a074b34c59660ec5cc9d..0b85c4d46e5088c23f0c6ee48c389692b2df9a53 100644 (file)
@@ -326,8 +326,8 @@ bool MyApp::OnInit()
         y = 50;
     if ( argc == 3 )
     {
-        wxSscanf(argv[1], "%d", &x);
-        wxSscanf(argv[2], "%d", &y);
+        wxSscanf(wxString(argv[1]), wxT("%d"), &x);
+        wxSscanf(wxString(argv[2]), wxT("%d"), &y);
     }
 
     // Create the main frame window
@@ -487,7 +487,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
 
     m_text = new wxTextCtrl(this, -1, "This is the log window.\n",
                             wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE);
-    m_text->SetBackgroundColour("wheat");
+    m_text->SetBackgroundColour(wxT("wheat"));
 
     if ( 0 )
         wxLog::AddTraceMask(_T("focus"));
@@ -609,7 +609,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
     SetChoiceClientData(wxT("choice"), m_choiceSorted);
 
     m_choice->SetSelection(2);
-    m_choice->SetBackgroundColour( "red" );
+    m_choice->SetBackgroundColour( wxT("red") );
     (void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #&2", wxPoint(180,30), wxSize(140,30) );
     (void)new wxButton( panel, ID_CHOICE_SEL_STR, "&Select 'This'", wxPoint(340,30), wxSize(140,30) );
     (void)new wxButton( panel, ID_CHOICE_CLEAR, "&Clear", wxPoint(180,80), wxSize(140,30) );
@@ -876,16 +876,16 @@ void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event))
         SetBackgroundColour(s_colOld);
         s_colOld = wxNullColour;
 
-        m_lbSelectThis->SetForegroundColour("red");
-        m_lbSelectThis->SetBackgroundColour("white");
+        m_lbSelectThis->SetForegroundColour(wxT("red"));
+        m_lbSelectThis->SetBackgroundColour(wxT("white"));
     }
     else
     {
-        s_colOld = wxColour("red");
-        SetBackgroundColour("white");
+        s_colOld = wxColour(wxT("red"));
+        SetBackgroundColour(wxT("white"));
 
-        m_lbSelectThis->SetForegroundColour("white");
-        m_lbSelectThis->SetBackgroundColour("red");
+        m_lbSelectThis->SetForegroundColour(wxT("white"));
+        m_lbSelectThis->SetBackgroundColour(wxT("red"));
     }
 
     m_lbSelectThis->Refresh();
index 474633ce8931a8d1b70f9e1aaa3aaf70c60477d4..8dfad555fd3ab34475142efaf75e84dcb4961c6c 100644 (file)
@@ -1864,7 +1864,7 @@ void DnDShapeDataObject::CreateBitmap() const
     wxBitmap bitmap(x, y);
     wxMemoryDC dc;
     dc.SelectObject(bitmap);
-    dc.SetBrush(wxBrush("white", wxSOLID));
+    dc.SetBrush(wxBrush(wxT("white"), wxSOLID));
     dc.Clear();
     m_shape->Draw(dc);
     dc.SelectObject(wxNullBitmap);
index 4903011b23c9523e00ba64e63deb198897ba216f..bd1c29c4e496b799ac59a34817338ab2532beed0 100644 (file)
@@ -406,17 +406,17 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
             {
                 dc.SetLogicalFunction(wxCOPY);
 
-                dc.SetPen( wxPen( "black", 4, wxSOLID) );
+                dc.SetPen( wxPen( wxT("black"), 4, wxSOLID) );
                 dc.SetBrush( *brush4 );
                 dc.DrawPolygon(5,todraw,0,0,wxWINDING_RULE);
 
-                dc.SetPen( wxPen( "red", 4, wxSOLID) );
+                dc.SetPen( wxPen( wxT("red"), 4, wxSOLID) );
                 dc.SetBrush( *brush36 );
                 dc.SetTextForeground(*wxCYAN);
                 dc.SetTextBackground(m_owner->m_colourBackground);
                 dc.DrawRectangle( x+10, y+10, 200, 200 );
 
-                dc.SetPen( wxPen( "green", 4, wxSOLID) );
+                dc.SetPen( wxPen( wxT("green"), 4, wxSOLID) );
                 dc.SetBrush( *brush4_mono );
                 dc.SetTextForeground(*wxCYAN);
                 dc.SetTextBackground(m_owner->m_colourBackground);
@@ -441,7 +441,7 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
                 memDC->Clear();
                 memDC->SetBackground(wxNullBrush);
 
-                memDC->SetPen( wxPen( "black", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("black"), 4, wxSOLID) );
                 memDC->SetBrush( wxNullBrush);
                 memDC->SetBrush( *brush4 );
                 memDC->SetTextForeground(*wxBLACK);            // 0s --> 0x000000 (black)
@@ -463,12 +463,12 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 
 
                 //don't understand how but the outline is also depending on logicalfunction
-                memDC->SetPen( wxPen( "red", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("red"), 4, wxSOLID) );
                 memDC->DrawPolygon(5,todraw2,0,0,wxWINDING_RULE);
 
                 memDC->SetLogicalFunction(wxCOPY);
 
-                memDC->SetPen( wxPen( "black", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("black"), 4, wxSOLID) );
                 memDC->SetBrush( wxNullBrush);
                 memDC->SetBrush( *brush36 );
                 memDC->SetTextForeground(*wxBLACK);            // 0s --> 0x000000 (black)
@@ -487,7 +487,7 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
                 memDC->SetLogicalFunction(wxOR);
 
                 //don't understand how but the outline is also depending on logicalfunction
-                memDC->SetPen( wxPen( "yellow", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("yellow"), 4, wxSOLID) );
                 memDC->DrawRectangle( 10, 10, 200, 200 );
 
                 memDC->SetBrush(wxNullBrush);
@@ -510,7 +510,7 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
                 memDC->Clear();
                 memDC->SetBackground(wxNullBrush);
 
-                memDC->SetPen( wxPen( "black", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("black"), 4, wxSOLID) );
                 memDC->SetBrush( *brush4 );
                 memDC->SetTextBackground(*wxBLACK);            // 0s --> 0x000000 (black)
                 memDC->SetTextForeground(*wxWHITE);    // 1s --> 0xFFFFFF (white)
@@ -530,12 +530,12 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 
 
                 //don't understand how but the outline is also depending on logicalfunction
-                memDC->SetPen( wxPen( "red", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("red"), 4, wxSOLID) );
                 memDC->DrawPolygon(5,todraw2,0,0,wxWINDING_RULE);
 
                 memDC->SetLogicalFunction(wxCOPY);
 
-                memDC->SetPen( wxPen( "black", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("black"), 4, wxSOLID) );
                 memDC->SetBrush( *brush36 );
                 memDC->SetTextBackground(*wxBLACK);            // 0s --> 0x000000 (black)
                 memDC->SetTextForeground(*wxWHITE);    // 1s --> 0xFFFFFF (white)
@@ -552,7 +552,7 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
                 memDC->SetLogicalFunction(wxOR);
 
                 //don't understand how but the outline is also depending on logicalfunction
-                memDC->SetPen( wxPen( "yellow", 4, wxSOLID) );
+                memDC->SetPen( wxPen( wxT("yellow"), 4, wxSOLID) );
                 memDC->DrawRectangle( 10, 10, 200, 200 );
 
                 memDC->SetBrush(wxNullBrush);
@@ -570,39 +570,39 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 
 void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc )
 {
-    dc.SetPen( wxPen( "black", width, wxSOLID) );
+    dc.SetPen( wxPen( wxT("black"), width, wxSOLID) );
     dc.SetBrush( *wxRED_BRUSH );
     dc.DrawText(wxString::Format(wxT("Testing lines of width %d"), width), x + 10, y - 10);
     dc.DrawRectangle( x+10, y+10, 100, 190 );
 
     dc.DrawText("Solid/dot/short dash/long dash/dot dash", x + 150, y + 10);
-    dc.SetPen( wxPen( "black", width, wxSOLID) );
+    dc.SetPen( wxPen( wxT("black"), width, wxSOLID) );
     dc.DrawLine( x+20, y+20, 100, y+20 );
-    dc.SetPen( wxPen( "black", width, wxDOT) );
+    dc.SetPen( wxPen( wxT("black"), width, wxDOT) );
     dc.DrawLine( x+20, y+30, 100, y+30 );
-    dc.SetPen( wxPen( "black", width, wxSHORT_DASH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxSHORT_DASH) );
     dc.DrawLine( x+20, y+40, 100, y+40 );
-    dc.SetPen( wxPen( "black", width, wxLONG_DASH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxLONG_DASH) );
     dc.DrawLine( x+20, y+50, 100, y+50 );
-    dc.SetPen( wxPen( "black", width, wxDOT_DASH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxDOT_DASH) );
     dc.DrawLine( x+20, y+60, 100, y+60 );
 
     dc.DrawText("Misc hatches", x + 150, y + 70);
-    dc.SetPen( wxPen( "black", width, wxBDIAGONAL_HATCH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxBDIAGONAL_HATCH) );
     dc.DrawLine( x+20, y+70, 100, y+70 );
-    dc.SetPen( wxPen( "black", width, wxCROSSDIAG_HATCH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxCROSSDIAG_HATCH) );
     dc.DrawLine( x+20, y+80, 100, y+80 );
-    dc.SetPen( wxPen( "black", width, wxFDIAGONAL_HATCH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxFDIAGONAL_HATCH) );
     dc.DrawLine( x+20, y+90, 100, y+90 );
-    dc.SetPen( wxPen( "black", width, wxCROSS_HATCH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxCROSS_HATCH) );
     dc.DrawLine( x+20, y+100, 100, y+100 );
-    dc.SetPen( wxPen( "black", width, wxHORIZONTAL_HATCH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxHORIZONTAL_HATCH) );
     dc.DrawLine( x+20, y+110, 100, y+110 );
-    dc.SetPen( wxPen( "black", width, wxVERTICAL_HATCH) );
+    dc.SetPen( wxPen( wxT("black"), width, wxVERTICAL_HATCH) );
     dc.DrawLine( x+20, y+120, 100, y+120 );
 
     dc.DrawText("User dash", x + 150, y + 140);
-    wxPen ud( "black", width, wxUSER_DASH );
+    wxPen ud( wxT("black"), width, wxUSER_DASH );
     wxDash dash1[1];
     dash1[0] = 0;
     ud.SetDashes( 1, dash1 );
index 66fc9350d53533dee4eba90beab1d93da1607221..43ef8f587104569e501f8cd1f6082c03f790f5c6 100644 (file)
@@ -662,7 +662,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     PrepareDC(dc);
 
     // set background
-    dc.SetBackground(wxBrush("white", wxSOLID));
+    dc.SetBackground(wxBrush(wxT("white"), wxSOLID));
     dc.Clear();
 
     // output the font name/info
index 8aa405111d021c17660aaa134251eadf3b534e92..2e1d4544d23bab31a8df39d68fbf1d0a70cde7e3 100644 (file)
@@ -134,7 +134,7 @@ bool MyApp::OnInit(void)
   frame->grid->SetCellValue("First cell", 0, 0);
   frame->grid->SetCellValue("Another cell", 1, 1);
   frame->grid->SetCellValue("Yet another cell", 2, 2);
-  frame->grid->SetCellTextFont(* wxTheFontList->FindOrCreateFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
+  frame->grid->SetCellTextFont(wxFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
   frame->grid->SetCellTextColour(*wxRED, 1, 1);
   frame->grid->SetCellBackgroundColour(*wxCYAN, 2, 2);
   if (cellBitmap1 && cellBitmap2)
@@ -212,7 +212,7 @@ void MyFrame::ToggleColLabel(wxCommandEvent& WXUNUSED(event))
 void MyFrame::ToggleDividers(wxCommandEvent& WXUNUSED(event))
 {
       if (!grid->GetDividerPen().Ok())
-        grid->SetDividerPen(* wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID));
+        grid->SetDividerPen(wxPen(wxT("LIGHT GREY"), 1, wxSOLID));
       else
         grid->SetDividerPen(wxNullPen);
       grid->Refresh();
index 706be54393544c02f9b0a26af79e886538ab6107..c03daca0775ab34a885ed9703c9166b5f07173a2 100644 (file)
@@ -253,7 +253,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
 
     wxMemoryDC dc;
     dc.SelectObject( bitmap );
-    dc.SetBrush( wxBrush( "orange", wxSOLID ) );
+    dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) );
     dc.SetPen( *wxBLACK_PEN );
     dc.DrawRectangle( 0, 0, 100, 100 );
     dc.SetBrush( *wxWHITE_BRUSH );
@@ -388,7 +388,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     if (my_square && my_square->Ok()) dc.DrawBitmap( *my_square, 30, 30 );
 
     dc.DrawText( "Drawn directly", 150, 10 );
-    dc.SetBrush( wxBrush( "orange", wxSOLID ) );
+    dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) );
     dc.SetPen( *wxBLACK_PEN );
     dc.DrawRectangle( 150, 30, 100, 100 );
     dc.SetBrush( *wxWHITE_BRUSH );
@@ -439,14 +439,14 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     {
         dc.DrawText( "XBM bitmap", 30, 1975 );
         dc.DrawText( "(green on red)", 30, 1990 );
-        dc.SetTextForeground( "GREEN" );
-        dc.SetTextBackground( "RED" );
+        dc.SetTextForeground( wxT("GREEN") );
+        dc.SetTextBackground( wxT("RED") );
         dc.DrawBitmap( *my_smile_xbm, 30, 2010 );
 
-        dc.SetTextForeground( "BLACK" );
+        dc.SetTextForeground( wxT("BLACK") );
         dc.DrawText( "After wxImage conversion", 150, 1975 );
         dc.DrawText( "(red on white)", 150, 1990 );
-        dc.SetTextForeground( "RED" );
+        dc.SetTextForeground( wxT("RED") );
         wxImage i = my_smile_xbm->ConvertToImage();
         i.SetMaskColour( 255, 255, 255 );
         i.Replace( 0, 0, 0,
@@ -454,7 +454,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
                wxRED_PEN->GetColour().Green(),
                wxRED_PEN->GetColour().Blue() );
         dc.DrawBitmap( i.ConvertToBitmap(), 150, 2010, TRUE );
-        dc.SetTextForeground( "BLACK" );
+        dc.SetTextForeground( wxT("BLACK") );
     }
 
 
@@ -476,14 +476,14 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     {
         dc.DrawText( "Mono bitmap", 30, 2095 );
         dc.DrawText( "(red on green)", 30, 2110 );
-        dc.SetTextForeground( "RED" );
-        dc.SetTextBackground( "GREEN" );
+        dc.SetTextForeground( wxT("RED") );
+        dc.SetTextBackground( wxT("GREEN") );
         dc.DrawBitmap( mono, 30, 2130 );
 
-        dc.SetTextForeground( "BLACK" );
+        dc.SetTextForeground( wxT("BLACK") );
         dc.DrawText( "After wxImage conversion", 150, 2095 );
         dc.DrawText( "(red on white)", 150, 2110 );
-        dc.SetTextForeground( "RED" );
+        dc.SetTextForeground( wxT("RED") );
         wxImage i = mono.ConvertToImage();
         i.SetMaskColour( 255,255,255 );
         i.Replace( 0,0,0,
@@ -491,7 +491,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
                wxRED_PEN->GetColour().Green(),
                wxRED_PEN->GetColour().Blue() );
         dc.DrawBitmap( i.ConvertToBitmap(), 150, 2130, TRUE );
-        dc.SetTextForeground( "BLACK" );
+        dc.SetTextForeground( wxT("BLACK") );
     }
 
     dc.DrawText("XPM bitmap", 30, 2230);
@@ -518,7 +518,7 @@ void MyCanvas::CreateAntiAliasedBitmap()
   dc.Clear();
 
   dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL) );
-  dc.SetTextForeground( "RED" );
+  dc.SetTextForeground( wxT("RED") );
   dc.DrawText( "This is anti-aliased Text.", 20, 20 );
   dc.DrawText( "And a Rectangle.", 20, 60 );
 
index 2e8b20c303b9c9a0e2944791e79a234bce634d47..d08d4a84591116ec11c884f8a475200d0aec7e8f 100644 (file)
@@ -128,7 +128,7 @@ private:
       void Refresh();
       bool DeleteChild(TreeNode *child);
       void DestroyChildren();
-      const char *FullName() const;
+      const wxChar *FullName() const;
 
       // get the associated key: make sure the pointer is !NULL
       wxRegKey& Key() { if ( !m_pKey ) OnExpand(); return *m_pKey; }
@@ -480,7 +480,7 @@ RegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(TreeNode *pParent,
                                    pNewNode->IsKey() ? strName : *pstrValue,
                                    idImage);
 
-  wxASSERT_MSG( pNewNode->m_id, "can't create tree control item!");
+  wxASSERT_MSG( pNewNode->m_id, wxT("can't create tree control item!"));
 
   // save the pointer in the item
   SetItemData(pNewNode->m_id, pNewNode);
@@ -548,7 +548,7 @@ void RegTreeCtrl::OnIdle(wxIdleEvent& WXUNUSED(event))
 {
     if ( m_restoreStatus ) {
         // restore it after OnItemExpanding()
-        wxLogStatus("Ok");
+        wxLogStatus(wxT("Ok"));
         wxSetCursor(*wxSTANDARD_CURSOR);
 
         m_restoreStatus = FALSE;
@@ -579,14 +579,14 @@ void RegTreeCtrl::OnMenuTest()
   long lId = GetSelection();
   TreeNode *pNode = (TreeNode *)GetItemData(lId);
 
-  wxCHECK_RET( pNode != NULL, "tree item without data?" );
+  wxCHECK_RET( pNode != NULL, wxT("tree item without data?") );
 
   if ( pNode->IsRoot() ) {
-    wxLogError("Can't create a subkey under the root key.");
+    wxLogError(wxT("Can't create a subkey under the root key."));
     return;
   }
   if ( !pNode->IsKey() ) {
-    wxLogError("Can't create a subkey under a value!");
+    wxLogError(wxT("Can't create a subkey under a value!"));
     return;
   }
 
@@ -595,19 +595,19 @@ void RegTreeCtrl::OnMenuTest()
     wxRegKey key2a(key1, "key2a"), key2b(key1, "key2b");
     if ( key2a.Create() && key2b.Create() ) {
       // put some values under the newly created keys
-      key1.SetValue("first_term", "10");
-      key1.SetValue("second_term", "7");
+      key1.SetValue(wxT("first_term"), "10");
+      key1.SetValue(wxT("second_term"), "7");
       key2a = "this is the unnamed value";
-      key2b.SetValue("sum", 17);
+      key2b.SetValue(wxT("sum"), 17);
 
       // refresh tree
       pNode->Refresh();
-      wxLogStatus("Test keys successfully added.");
+      wxLogStatus(wxT("Test keys successfully added."));
       return;
     }
   }
 
-  wxLogError("Creation of test keys failed.");
+  wxLogError(wxT("Creation of test keys failed."));
 }
 
 void RegTreeCtrl::OnChar(wxKeyEvent& event)
@@ -643,7 +643,7 @@ void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
 
   // expansion might take some time
   wxSetCursor(*wxHOURGLASS_CURSOR);
-  wxLogStatus("Working...");
+  wxLogStatus(wxT("Working..."));
   wxYield();  // to give the status line a chance to refresh itself
   m_restoreStatus = TRUE;   // some time later...
 
@@ -711,13 +711,13 @@ void RegTreeCtrl::OnBeginDrag(wxTreeEvent& event)
     TreeNode *pNode = GetNode(event);
     if ( pNode->IsRoot() || pNode->Parent()->IsRoot() )
     {
-        wxLogStatus("This registry key can't be %s.",
-                    m_copyOnDrop ? "copied" : "moved");
+        wxLogStatus(wxT("This registry key can't be %s."),
+                    m_copyOnDrop ? wxT("copied") : wxT("moved"));
     }
     else
     {
-        wxLogStatus("%s item %s...",
-                    m_copyOnDrop ? "Copying" : "Moving",
+        wxLogStatus(wxT("%s item %s..."),
+                    m_copyOnDrop ? wxT("Copying") : wxT("Moving"),
                     pNode->FullName());
 
         m_draggedItem = pNode;
@@ -728,7 +728,7 @@ void RegTreeCtrl::OnBeginDrag(wxTreeEvent& event)
 
 void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
 {
-    wxCHECK_RET( m_draggedItem, "end drag without begin drag?" );
+    wxCHECK_RET( m_draggedItem, wxT("end drag without begin drag?") );
 
     // clear the pointer anyhow
     TreeNode *src = m_draggedItem;
@@ -741,7 +741,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
         dst = dst->Parent();
     }
     if ( !dst || dst->IsRoot() ) {
-        wxLogError("Can't create a key here.");
+        wxLogError(wxT("Can't create a key here."));
 
         return;
     }
@@ -749,7 +749,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
     bool isKey = src->IsKey();
     if ( (isKey && (src == dst)) ||
          (!isKey && (dst->Parent() == src)) ) {
-        wxLogStatus("Can't copy something on itself");
+        wxLogStatus(wxT("Can't copy something on itself"));
 
         return;
     }
@@ -765,7 +765,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
 
     if ( wxMessageBox(wxString::Format
                         (
-                         "Do you really want to %s the %s %s to %s?",
+                         wxT("Do you really want to %s the %s %s to %s?"),
                          verb.c_str(),
                          what.c_str(),
                          nameSrc.c_str(),
@@ -782,7 +782,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
         wxRegKey keyDst(dst->Key(), src->m_strName);
         ok = keyDst.Create(FALSE);
         if ( !ok ) {
-            wxLogError("Key '%s' already exists");
+            wxLogError(wxT("Key '%s' already exists"));
         }
         else {
             ok = key.Copy(keyDst);
@@ -806,7 +806,8 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
     }
 
     if ( !ok ) {
-        wxLogError("Failed to %s registry %s.", verb.c_str(), what.c_str());
+        wxLogError(wxT("Failed to %s registry %s."),
+                   verb.c_str(), what.c_str());
     }
     else {
         dst->Refresh();
@@ -840,7 +841,7 @@ bool RegTreeCtrl::TreeNode::OnExpand()
   }
 
   if ( !m_pKey->Open() ) {
-    wxLogError("The key '%s' can't be opened.", FullName());
+    wxLogError(wxT("The key '%s' can't be opened."), FullName());
     return FALSE;
   }
 
@@ -953,7 +954,7 @@ bool RegTreeCtrl::TreeNode::DeleteChild(TreeNode *child)
 {
     int index = m_aChildren.Index(child);
     wxCHECK_MSG( index != wxNOT_FOUND, FALSE,
-                 "our child in tree should be in m_aChildren" );
+                 wxT("our child in tree should be in m_aChildren") );
 
     m_aChildren.RemoveAt((size_t)index);
 
@@ -998,18 +999,18 @@ RegTreeCtrl::TreeNode::~TreeNode()
   delete m_pKey;
 }
 
-const char *RegTreeCtrl::TreeNode::FullName() const
+const wxChar *RegTreeCtrl::TreeNode::FullName() const
 {
   static wxString s_strName;
 
   if ( IsRoot() ) {
-    return "Registry Root";
+    return wxT("Registry Root");
   }
   else {
     // our own registry key might not (yet) exist or we might be a value,
     // so just use the parent's and concatenate
     s_strName = Parent()->FullName();
-    s_strName << '\\' << m_strName;
+    s_strName << wxT('\\') << m_strName;
 
     return s_strName;
   }
@@ -1073,24 +1074,24 @@ void RegTreeCtrl::DeleteSelected()
        lParent  = GetParent(lCurrent);
 
   if ( lParent == 0 ) {
-    wxLogError("Can't delete root key.");
+    wxLogError(wxT("Can't delete root key."));
     return;
   }
 
   TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent),
            *pParent  = (TreeNode *)GetItemData(lParent);
 
-  wxCHECK_RET( pCurrent && pParent, "either node or parent without data?" );
+  wxCHECK_RET(pCurrent && pParent, wxT("either node or parent without data?"));
 
   if ( pParent->IsRoot() ) {
-    wxLogError("Can't delete standard key.");
+    wxLogError(wxT("Can't delete standard key."));
     return;
   }
 
   wxString what = pCurrent->IsKey() ? "key" : "value";
   if ( wxMessageBox(wxString::Format
                     (
-                      "Do you really want to delete this %s?",
+                      wxT("Do you really want to delete this %s?"),
                       what.c_str()
                     ),
                     "Confirmation",
@@ -1106,12 +1107,12 @@ void RegTreeCtrl::CreateNewKey(const wxString& strName)
   long lCurrent = GetSelection();
   TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
 
-  wxCHECK_RET( pCurrent != NULL, "node without data?" );
+  wxCHECK_RET( pCurrent != NULL, wxT("node without data?") );
 
   wxASSERT( pCurrent->IsKey() );  // check must have been done before
 
   if ( pCurrent->IsRoot() ) {
-    wxLogError("Can't create a new key under the root key.");
+    wxLogError(wxT("Can't create a new key under the root key."));
     return;
   }
 
@@ -1125,12 +1126,12 @@ void RegTreeCtrl::CreateNewTextValue(const wxString& strName)
   long lCurrent = GetSelection();
   TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
 
-  wxCHECK_RET( pCurrent != NULL, "node without data?" );
+  wxCHECK_RET( pCurrent != NULL, wxT("node without data?") );
 
   wxASSERT( pCurrent->IsKey() );  // check must have been done before
 
   if ( pCurrent->IsRoot() ) {
-    wxLogError("Can't create a new value under the root key.");
+    wxLogError(wxT("Can't create a new value under the root key."));
     return;
   }
 
@@ -1143,12 +1144,12 @@ void RegTreeCtrl::CreateNewBinaryValue(const wxString& strName)
   long lCurrent = GetSelection();
   TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
 
-  wxCHECK_RET( pCurrent != NULL, "node without data?" );
+  wxCHECK_RET( pCurrent != NULL, wxT("node without data?") );
 
   wxASSERT( pCurrent->IsKey() );  // check must have been done before
 
   if ( pCurrent->IsRoot() ) {
-    wxLogError("Can't create a new value under the root key.");
+    wxLogError(wxT("Can't create a new value under the root key."));
     return;
   }
 
@@ -1163,7 +1164,7 @@ void RegTreeCtrl::ShowProperties()
 
     if ( !pCurrent || pCurrent->IsRoot() )
     {
-        wxLogStatus("No properties");
+        wxLogStatus(wxT("No properties"));
 
         return;
     }
@@ -1174,27 +1175,27 @@ void RegTreeCtrl::ShowProperties()
         size_t nSubKeys, nValues;
         if ( !key.GetKeyInfo(&nSubKeys, NULL, &nValues, NULL) )
         {
-            wxLogError("Couldn't get key info");
+            wxLogError(wxT("Couldn't get key info"));
         }
         else
         {
-            wxLogMessage("Key '%s' has %u subkeys and %u values.",
+            wxLogMessage(wxT("Key '%s' has %u subkeys and %u values."),
                          key.GetName().c_str(), nSubKeys, nValues);
         }
     }
     else // it's a value
     {
         TreeNode *parent = pCurrent->Parent();
-        wxCHECK_RET( parent, "reg value without key?" );
+        wxCHECK_RET( parent, wxT("reg value without key?") );
 
         const wxRegKey& key = parent->Key();
-        const char *value = pCurrent->m_strName.c_str();
-        wxLogMessage("Value '%s' under the key '%s' is of type "
-                     "%d (%s).",
+        const wxChar *value = pCurrent->m_strName.c_str();
+        wxLogMessage(wxT("Value '%s' under the key '%s' is of type ")
+                     wxT("%d (%s)."),
                      value,
                      parent->m_strName.c_str(),
                      key.GetValueType(value),
-                     key.IsNumericValue(value) ? "numeric" : "string");
+                     key.IsNumericValue(value) ? wxT("numeric") : wxT("string"));
 
     }
 }
@@ -1217,7 +1218,7 @@ void RegTreeCtrl::Refresh()
 
     TreeNode *pNode = (TreeNode *)GetItemData(lId);
 
-    wxCHECK_RET( pNode != NULL, "tree item without data?" );
+    wxCHECK_RET( pNode != NULL, wxT("tree item without data?") );
 
     pNode->Refresh();
 }
index 82168460410db8af057068583f01eb04f062d32c..6f27a04edeb6dde9bb7a61cf1b474f794e7fc1d5 100644 (file)
@@ -205,27 +205,27 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
 #endif
 
     wxPanel *test = new wxPanel( this, -1, wxPoint(10, 110), wxSize(130,50), wxSIMPLE_BORDER | wxTAB_TRAVERSAL );
-    test->SetBackgroundColour( "WHEAT" );
+    test->SetBackgroundColour( wxT("WHEAT") );
 
 #if 0
 
     wxButton *test2 = new wxButton( test, -1, "Hallo", wxPoint(10,10) );
 
     test = new wxPanel( this, -1, wxPoint(160, 530), wxSize(130,120), wxSUNKEN_BORDER | wxTAB_TRAVERSAL );
-    test->SetBackgroundColour( "WHEAT" );
+    test->SetBackgroundColour( wxT("WHEAT") );
     test->SetCursor( wxCursor( wxCURSOR_NO_ENTRY ) );
     test2 = new wxButton( test, -1, "Hallo", wxPoint(10,10) );
     test2->SetCursor( wxCursor( wxCURSOR_PENCIL ) );
 
     test = new wxPanel( this, -1, wxPoint(310, 530), wxSize(130,120), wxRAISED_BORDER | wxTAB_TRAVERSAL );
-    test->SetBackgroundColour( "WHEAT" );
+    test->SetBackgroundColour( wxT("WHEAT") );
     test->SetCursor( wxCursor( wxCURSOR_PENCIL ) );
     test2 = new wxButton( test, -1, "Hallo", wxPoint(10,10) );
     test2->SetCursor( wxCursor( wxCURSOR_NO_ENTRY ) );
 
 #endif
 
-    SetBackgroundColour( "BLUE" );
+    SetBackgroundColour( wxT("BLUE") );
 
     SetCursor( wxCursor( wxCURSOR_IBEAM ) );
 }
index c53f93744bf557e2fe1739b02feac527a214a02b..6c8b3fe8b75be2251fe28480ac8915442ab931d9 100644 (file)
@@ -153,7 +153,7 @@ MyScrolledWindow::MyScrolledWindow( wxWindow *parent, wxWindowID id,
     
     SetTargetWindow( m_canvas );
 
-    SetBackgroundColour( "WHEAT" );
+    SetBackgroundColour( wxT("WHEAT") );
   
     SetCursor( wxCursor( wxCURSOR_HAND ) );
     
@@ -264,7 +264,7 @@ MyCanvas::MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *r
     (void)new wxTextCtrl( this, -1, "Text I", wxPoint(0,100), wxSize(100,25) );
     (void)new wxTextCtrl( this, -1, "Text II", wxPoint(200,100), wxSize(100,25) );
 
-    SetBackgroundColour( "WHEAT" );
+    SetBackgroundColour( wxT("WHEAT") );
   
     SetCursor( wxCursor( wxCURSOR_IBEAM ) );
 }
index cc3198507c80de5ae988474ffb6463000252e3ca..e1aed5d11a0f9d510154adfa5b802115040967cc 100644 (file)
@@ -308,7 +308,7 @@ void MyFrame::DoCreateStatusBar(MyFrame::StatBarKind kind)
             break;
 
         default:
-            wxFAIL_MSG("unknown stat bar kind");
+            wxFAIL_MSG(wxT("unknown stat bar kind"));
     }
 
     GetStatusBar()->Show();