]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/text/text.cpp
Fix compilo
[wxWidgets.git] / samples / text / text.cpp
index e40562aeb4443032c6e39c0d7081abf849b27c8a..40a25e533f2fe5b3f5e6ba2833c363c7471a1428 100644 (file)
@@ -311,20 +311,21 @@ private:
     void DoAddText(bool freeze)
     {
         wxTextCtrl * const text = m_panel->m_textrich;
-        text->Clear();
 
         if ( freeze )
             text->Freeze();
 
+        text->Clear();
+
         for ( int i = 0; i < 100; i++ )
         {
             text->AppendText(wxString::Format(wxT("Line %i\n"), i));
         }
 
+        text->SetInsertionPoint(0);
+
         if ( freeze )
             text->Thaw();
-
-        text->SetInsertionPoint(0);
     }
 
     MyPanel *m_panel;
@@ -921,6 +922,10 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
                 wxLogMessage(_T("Selection = '%s' (len = %u)"),
                              sel.c_str(),
                              (unsigned int) sel.length());
+
+                const wxString text = GetLineText(line);
+                wxLogMessage(_T("Current line: \"%s\"; length = %lu"),
+                             text.c_str(), text.length());
             }
             break;
 
@@ -1140,7 +1145,6 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
     topSizer->Add( m_log, 1, wxALL | wxEXPAND, 10 );
 #endif
 
-    SetAutoLayout( true );
     SetSizer(topSizer);
 }
 
@@ -1495,13 +1499,13 @@ void MyFrame::OnIdle( wxIdleEvent& event )
         wxString msg;
         msg.Printf(
 #ifdef __WXMSW__
-                _T("Focus: wxWindow = %p, HWND = %08x"),
+                _T("Focus: wxWindow = %p, HWND = %p"),
 #else
                 _T("Focus: wxWindow = %p"),
 #endif
                 s_windowFocus
 #ifdef __WXMSW__
-                , (unsigned int) s_windowFocus->GetHWND()
+                , s_windowFocus->GetHWND()
 #endif
                   );