X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/60f523207e546152f77cbd881c66b7edb4f823fb..449d48f9e15e1430805aed3b33e55000754ad926:/samples/text/text.cpp diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 05cd37a94e..f5ac96136b 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -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; @@ -733,7 +741,9 @@ END_EVENT_TABLE() MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) : wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ) { - m_log = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(5,260), wxSize(630,100), wxTE_MULTILINE ); + m_log = new wxTextCtrl( this, -1, "This is the log window.\n", + wxPoint(5,260), wxSize(630,100), + wxTE_MULTILINE | wxTE_READONLY /* | wxTE_RICH */); wxLog *old_log = wxLog::SetActiveTarget( new wxLogTextCtrl( m_log ) ); @@ -829,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