]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/text/text.cpp
Fixed mouse handling for captured windows
[wxWidgets.git] / samples / text / text.cpp
index d42dcf55754b9ca8ec98ed6787298159c947db67..f5ac96136b6e65bba13653e4101e8ebbdcd14f5e 100644 (file)
@@ -36,6 +36,8 @@
     #include "wx/tooltip.h"
 #endif
 
+    #include "wx/progdlg.h"
+
 // We test for wxUSE_DRAG_AND_DROP also, because data objects may not be
 // implemented for compilers that can't cope with the OLE parts in
 // wxUSE_DRAG_AND_DROP.
@@ -224,8 +226,14 @@ private:
         if ( freeze )
             text->Freeze();
 
+        text->Clear();
+
+        wxProgressDialog dlg(_T("Wait..."), _T("Updating"), 100, this);
         for ( int i = 0; i < 100; i++ )
+        {
+            dlg.Update(i);
             text->AppendText(wxString::Format(wxT("Line %i\n"), i));
+        }
 
         text->SetInsertionPoint(0);
 
@@ -685,7 +693,7 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
             else
             {
                 wxLogDebug( wxT("Stopped capturing mouse and events.") );
-                m_hasCapture = TRUE;
+                m_hasCapture = FALSE;
                 ReleaseMouse();
             }
             break;
@@ -831,7 +839,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
                                 wxPoint(450, 10), wxSize(230, 230),
                                 wxTE_RICH |
                                 wxTE_MULTILINE |
-                                wxTE_AUTO_URL |
+                                // wxTE_AUTO_URL |
                                 wxHSCROLL);
 
 #if 1