The Drag and Drop Interface Samples






4.33/5 (5 votes)
Nov 10, 2000

172595

3905
A series of articles that resulted from experimenting with adding Drag and Drop features to my existing application
This article is part of the drag and drop interface samples:
- Serializing ASCII Data
- Modeless child dialog
- Modeless sibling dialog
- The drag source
- The MFC drop target
- The TBTextTarget class
Preface
This is a series of articles that has yielded from experimenting with adding some Drag and Drop features to my already-existing application. Due to the complexity of the task, I split the article in several small documents that may easily fit into various CodeProject's sections.
Introduction
The idea was simple: I have an SDI application with a CFormView
containing a however-you-like filled out CListCtrl
in report view.
The first tricky thing was to use the doc/view architecture with a document file format containing ASCII-strings. Read about that quck'n'clean approach.
Next, I needed to batch-manipulate the data displayed in this control. "So why not use a kind of drag & drop interface with a modeless dialog box and let the user drag the rows he needs into that dialog..." I thought - and that's how this article starts.
You may download all sample MSVC (6.0) projects at once or you can fetch the code for each of these steps:
I'm looking forward to hearing your comments and improvements.
- Create a modeless dialog box as a child or as a sibling of your view (or dialog) window and display it in a message handler.
- Implement the
CListCtrl
drag source - Implement the drop target in the modeless dialog
- Take a cup of coffee
- Rework the code and let's see how to make it better
- Write something for Codeproject
- Get a job (this part is done!)
License
This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.
A list of licenses authors might use can be found here.