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

Modified Files:
        wxComposeView.cpp 
Log Message:
implemented collective reply/forward

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.279
retrieving revision 1.280
diff -b -u -2 -r1.279 -r1.280
--- wxComposeView.cpp   1 May 2002 16:47:50 -0000       1.279
+++ wxComposeView.cpp   13 May 2002 00:27:39 -0000      1.280
@@ -953,6 +953,5 @@
                   const MailFolder::Params& params,
                   wxComposeView::Mode mode,
-                  wxComposeView::MessageKind kind,
-                  bool hide)
+                  wxComposeView::MessageKind kind)
 {
    wxWindow *parent = mApplication->TopLevelFrame();
@@ -967,5 +966,5 @@
    cv->SetTemplate(params.templ);
    cv->SetTitle(COMPOSER_TITLE);
-   cv->Create(parent, profile, hide);
+   cv->Create(parent, profile);
 
    return cv;
@@ -974,22 +973,29 @@
 Composer *
 Composer::CreateNewArticle(const MailFolder::Params& params,
-                           Profile *profile,
-                           bool hide)
+                           Profile *profile)
 {
-   return CreateComposeView(profile, params,
+   wxComposeView *cv = CreateComposeView(profile, params,
                             wxComposeView::Mode_News,
-                            wxComposeView::Message_New,
-                            hide);
+                                         wxComposeView::Message_New);
+
+   CHECK( cv, NULL, "failed to create composer for a new article" );
+
+   cv->Launch();
+
+   return cv;
 }
 
 Composer *
-Composer::CreateNewMessage(const MailFolder::Params& params,
-                           Profile *profile,
-                           bool hide)
+Composer::CreateNewMessage(const MailFolder::Params& params, Profile *profile)
 {
-   return CreateComposeView(profile, params,
+   wxComposeView *cv = CreateComposeView(profile, params,
                             wxComposeView::Mode_Mail,
-                            wxComposeView::Message_New,
-                            hide);
+                                         wxComposeView::Message_New);
+
+   CHECK( cv, NULL, "failed to create composer for a new message" );
+
+   cv->Launch();
+
+   return cv;
 }
 
@@ -997,11 +1003,9 @@
 Composer::CreateReplyMessage(const MailFolder::Params& params,
                              Profile *profile,
-                             Message *original,
-                             bool hide)
+                             Message *original)
 {
    wxComposeView *cv = CreateComposeView(profile, params,
                                          wxComposeView::Mode_Mail,
-                                         wxComposeView::Message_Reply,
-                                         hide);
+                                         wxComposeView::Message_Reply);
 
    cv->SetOriginal(original);
@@ -1013,11 +1017,9 @@
 Composer::CreateFwdMessage(const MailFolder::Params& params,
                            Profile *profile,
-                           Message *original,
-                           bool hide)
+                           Message *original)
 {
    wxComposeView *cv = CreateComposeView(profile, params,
                                          wxComposeView::Mode_Mail,
-                                         wxComposeView::Message_Forward,
-                                         hide);
+                                         wxComposeView::Message_Forward);
 
    cv->SetOriginal(original);
@@ -1403,7 +1405,5 @@
 
 void
-wxComposeView::Create(wxWindow * WXUNUSED(parent),
-                      Profile *parentProfile,
-                      bool hide)
+wxComposeView::Create(wxWindow * WXUNUSED(parent), Profile *parentProfile)
 {
    // first create the profile: we must have one, so find a non NULL one
@@ -1449,15 +1449,8 @@
    m_splitter->SetMinimumPaneSize(heightHeaders);
 
-   // show the frame
-   // --------------
-
-   if ( !hide )
-   {
-      Show(TRUE);
-   }
-
-   // note that we must do it before setting the control values or the text
-   // would be scrolled to the right in the text fields as they initially don't
-   // have enough space to show it...
+   // note that we must show and layout the frame before setting the control
+   // values or the text would be scrolled to the right in the text fields as
+   // they initially don't have enough space to show it...
+   Show();
    Layout();
 
@@ -1985,5 +1978,8 @@
       DoInitText(msg, msgview);
    }
+}
 
+void wxComposeView::Launch()
+{
    // we also use this method to initialize the focus as we can't do it before
    // the composer text is inited
@@ -2010,6 +2006,4 @@
          break;
    }
-
-   Show();
 }
 
@@ -2017,5 +2011,10 @@
 wxComposeView::DoInitText(Message *mailmsg, MessageView *msgview)
 {
-   // NB: the signature is now inserted by the template parser
+   // position the cursor correctly and separate us from the previous message
+   // if we're replying to several messages at once
+   if ( !IsEmpty() )
+   {
+      InsertText("\n");
+   }
 
    // deal with templates: first decide what kind of template do we need
@@ -2106,4 +2105,6 @@
    } while ( templateChanged );
 
+   // NB: the signature is now inserted by the template parser
+
    // finally, attach a vCard if requested
    //
@@ -3481,4 +3482,9 @@
 }
 
+bool wxComposeView::IsEmpty() const
+{
+   return m_editor->IsEmpty();
+}
+
 // ----------------------------------------------------------------------------
 // other wxComposeView operations
@@ -3496,5 +3502,11 @@
 wxComposeView::MoveCursorTo(int x, int y)
 {
-   m_editor->MoveCursorTo(x, y);
+   m_editor->MoveCursorTo((unsigned long)x, (unsigned long)y);
+}
+
+void
+wxComposeView::MoveCursorBy(int x, int y)
+{
+   m_editor->MoveCursorBy(x, y);
 }
 


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to