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

Modified Files:
        wxComposeView.cpp 
Log Message:
The composer window now accepts dropped files (as attachments)

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.389
retrieving revision 1.390
diff -b -u -2 -r1.389 -r1.390
--- wxComposeView.cpp   19 Jul 2005 08:21:05 -0000      1.389
+++ wxComposeView.cpp   14 Nov 2005 10:25:20 -0000      1.390
@@ -72,4 +72,5 @@
 #include <wx/fontmap.h>
 #include <wx/fontutil.h>      // for wxNativeFontInfo
+#include <wx/dnd.h>
 // windows.h included from wx/fontutil.h under Windows #defines this
 #ifdef __CYGWIN__
@@ -1907,4 +1908,24 @@
 }
 
+
+class wxComposeViewFileDropTarget : public wxFileDropTarget {
+public:  
+  wxComposeViewFileDropTarget(wxComposeView* composeView)
+    : wxFileDropTarget()
+    , m_composeView(composeView)
+  {}
+  virtual bool OnDropFiles(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const 
wxArrayString& filenames) {
+    size_t countFiles = filenames.GetCount();
+    for ( size_t nFiles = 0; nFiles < countFiles; nFiles++ )
+    {
+      m_composeView->InsertFile(filenames[nFiles]);
+    }
+    return true;
+  }
+
+private:
+  wxComposeView* m_composeView;
+};
+
 void
 wxComposeView::Create(wxWindow * WXUNUSED(parent), Profile *parentProfile)
@@ -1926,4 +1947,8 @@
    CreateToolAndStatusBars();
 
+   m_dropTarget = new wxComposeViewFileDropTarget(this);
+   SetDropTarget(m_dropTarget);
+
+
    // create the child controls
 



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to