Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv30543/src/gui

Modified Files:
        wxComposeView.cpp 
Log Message:
fixes for the recent rcpt order changes

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.301
retrieving revision 1.302
diff -b -u -2 -r1.301 -r1.302
--- wxComposeView.cpp   7 Sep 2002 19:55:50 -0000       1.301
+++ wxComposeView.cpp   8 Sep 2002 13:51:16 -0000       1.302
@@ -345,7 +345,8 @@
 {
 public:
-   wxRcptExtraControl(wxComposeView *cv, size_t index) : wxRcptControl(cv)
+   wxRcptExtraControl(wxComposeView *cv) : wxRcptControl(cv)
    {
-      m_index = index;
+      // we're always inserted in the beginning, see AddRecipientControls()
+      m_index = 0;
       m_btnRemove = NULL;
    }
@@ -354,4 +355,10 @@
    void OnRemove() { m_composeView->OnRemoveRcpt(m_index); }
 
+   // increment our index (called when another control is inserted before us)
+   void IncIndex()
+   {
+      m_index++;
+   }
+
    // decrement our index (presumably because another control was deleted
    // before us)
@@ -1919,6 +1926,5 @@
 
    // create the controls and add them to the sizer
-   wxRcptExtraControl *
-       rcpt = new wxRcptExtraControl(this, m_rcptExtra.GetCount());
+   wxRcptExtraControl *rcpt = new wxRcptExtraControl(this);
 
    wxSizer *sizerRcpt = rcpt->CreateControls(m_panelRecipients->GetCanvas());
@@ -1934,4 +1940,11 @@
    m_sizerRcpts->Layout();
    m_panelRecipients->RefreshScrollbar(m_panelRecipients->GetClientSize());
+
+   // adjust the indexes of all the existing controls
+   const size_t count = m_rcptExtra.GetCount();
+   for ( size_t n = 1; n < count; n++ )
+   {
+      m_rcptExtra[n]->IncIndex();
+   }
 }
 



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to