]> git.saurik.com Git - wxWidgets.git/commitdiff
fix a couple of drawing defects
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Fri, 20 Feb 2009 16:38:48 +0000 (16:38 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Fri, 20 Feb 2009 16:38:48 +0000 (16:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/thread/thread.cpp

index 261e81fc69d6a532cea5269f49688e8e5dc3b6e8..c6e7d0d2de98e621284389d69d6334fdb1cfc053 100644 (file)
@@ -833,7 +833,7 @@ void MyImageDialog::OnPaint(wxPaintEvent& WXUNUSED(evt))
 
     // paint a sort of progress bar with a 10px border:
     dc.SetBrush(*wxRED_BRUSH);
-    dc.DrawRectangle(10,10, 10+m_nCurrentProgress*(GUITHREAD_BMP_SIZE-20)/100,30);
+    dc.DrawRectangle(10,10, m_nCurrentProgress*(sz.GetWidth()-20)/100,30);
     dc.SetTextForeground(*wxBLUE);
     dc.DrawText(wxString::Format("%d%%", m_nCurrentProgress),
                 (sz.GetWidth()-dc.GetCharWidth()*2)/2,
@@ -998,7 +998,7 @@ wxThread::ExitCode MyGUIThread::Entry()
 
         // notify the dialog that another piece of our masterpiece is complete:
         wxThreadEvent event( wxEVT_COMMAND_THREAD, GUITHREAD_EVENT );
-        event.SetInt(i);
+        event.SetInt(i+1);
         wxQueueEvent( m_dlg, event.Clone() );
 
         // give the main thread the time to refresh before we lock the GUI mutex again