Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File manager like project manager

Status
Not open for further replies.

polymathinc

Programmer
Mar 19, 2007
10
US
I am looking for a simple file manager that would work in a drag and drop manner like the current project manager. I want to add this feature to an existing application. Ideally I could choose file types like "email, fax, docs, xls, dwg, other." (these would be the categories on the folders) Then, using Windows Explorer the user could drag and drop files into the various "buckets" which could ge a general field or perhaps a folder on the drive.
Anyone have something similar?
Thanks in advance.
 
VFP solution samples has an example of "OLE Drag and Drop Data Formats". It shows you get a FileName and FileNameW from a drop of an OLE object of an explorer window (that is a file or folder drag). From there it should be easy to load the real file.

Don't store files in general fields though, it's a one way ticket. In one or the other way you get at the original files, but it should be easier to keep the files as files on disk, or just store the file names.

Bye, Olaf.
 
Polymathinc,

It wouldn't be too hard to create your own Project Manager. It's essentially a form containing a page frame. On each page, there is a listview, which you could create with the Microsoft Listview control (which comes with VFP).

It's easy to arrange for the form to receive drag-and-drop events, and to test that the dragged object is a file or a list of files. You don't have to know how the listview handles that. It would be enough to write the drag-and-drop code at the form level, and set the contained controls to pass the any dropped object up to their container.

Sounds like a nice little exercise for a rainy afternoon.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

I am using the oDataObject.GETFORMAT(15) to get the file name which is Dragged and Dropped. This works great!
Unfortunately, it does not work for OUTLOOK messages. If I drag a message from outlook onto the desktop and then drag it onto the form it works fine (I believe because it sees it as a file). Is there a different number to use for the GETFORMAT or the GETDATA so I can drag and drop email messages?
OR,...
if the Listview control handles outlook email messages then I could use that control (instead of the text box I am presently using).
Any insite would be greatly appreciated.
Dave G.
 
Dave,

First, I made a mistake in mentioning the listview control. I really meant the treeview. But that's not really relevant, because both controls are the same as far as drag-and-drop is concerned.

If the form is seeing the drop object as a group of files, then the treeview should as well. But you don't need to do anything special about that. It should be enough simply to pass the treeview's OLEDragOver and OLEDragDrop up to the form (remembering to pass up the parameters as well)

In other words, in the treeview's OLEDragOver, you would do:

THISFORM.OLEDragOver ;
(data, effect, button, shift, x, y, state)

and similarly, in its OLEDragDrop:

THISFORM.OLEDragDrop ;
(data, effect, button, shift, x, y)

The point is that it doesn't really matter which control receives the dropped objects. The form is the thing that knows how to deal with them.

I hope this makes sense. Come back if it needs clarifying.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top