Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6897/src/gui

Modified Files:
        wxComposeView.cpp 
Log Message:
avoid horrible flicker due to many recipient controls relayouts when replying 
to a message with many addressees

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.408
retrieving revision 1.409
diff -b -u -2 -r1.408 -r1.409
--- wxComposeView.cpp   24 Jun 2006 01:27:45 -0000      1.408
+++ wxComposeView.cpp   25 Jun 2006 22:25:12 -0000      1.409
@@ -735,4 +735,6 @@
    // identity combo notification
    EVT_CHOICE(IDC_IDENT_COMBO, wxComposeView::OnIdentChange)
+
+   EVT_IDLE(wxComposeView::OnIdle)
 END_EVENT_TABLE()
 
@@ -1735,4 +1737,5 @@
 
    m_isModified = false;
+   m_numNewRcpts = 0;
 
    m_okToConvertOnSend = false;
@@ -2482,4 +2485,13 @@
    }
 
+   if ( !m_numNewRcpts )
+   {
+      // before adding a new receipient control, prevent the updates: this is
+      // especially useful when many recepients are added at once as is the
+      // case when replying to a message with a lot of addressees, as we avoid
+      // a lot of flicker
+      Freeze();
+   }
+
    // create the controls and add them to the sizer
    wxRcptExtraControl *rcpt = new wxRcptExtraControl(this);
@@ -2495,8 +2507,11 @@
 
    m_sizerRcpts->Prepend(sizerRcpt, 0, wxALL | wxEXPAND, LAYOUT_MARGIN / 2);
-   m_sizerRcpts->Layout();
-   m_panelRecipients->RefreshScrollbar(m_panelRecipients->GetClientSize());
 
-   // adjust the indexes of all the existing controls
+   // hide the newly added controls for now and set the flag telling our
+   // OnIdle() to show it, after laying it out, later
+   m_sizerRcpts->Hide(sizerRcpt);
+   m_numNewRcpts++;
+
+   // adjust the indexes of all the existing controls after adding a new one
    const size_t count = m_rcptExtra.GetCount();
    for ( size_t n = 1; n < count; n++ )
@@ -3109,4 +3124,23 @@
 }
 
+void wxComposeView::OnIdle(wxIdleEvent& event)
+{
+   if ( m_numNewRcpts )
+   {
+      for ( unsigned n = 0; n < m_numNewRcpts; n++ )
+         m_sizerRcpts->Show(n);
+
+      m_sizerRcpts->Layout();
+      m_panelRecipients->RefreshScrollbar(m_panelRecipients->GetClientSize());
+
+      m_numNewRcpts = 0;
+
+      // now show all the recepient controls
+      Thaw();
+   }
+
+   event.Skip();
+}
+
 void wxComposeView::OnFirstTimeModify()
 {


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to