TPJDropFiles Component |
This component provides a window which can accept files dragged and dropped from File Manager (Win 3.1) or Explorer (Win 95/8). The window takes on the appearance of its parent window, although anything drawn on the parent's canvas is obliterated.
The control can contain child components (in a similar way to TPanel components). Files dropped over any such child component are accepted by the parent TPJDropFiles component. The TPJDropFiles component can be aligned with the form on which it is placed using the Align property.
When files from File Manager or Explorer are dropped over this component the OnDropFiles event is triggered. The names of the files are recorded in the Files property and the number of files dropped is held in the Count property.
The point at which the files were dropped is given by the DropPoint property (in coordinates relative to the control). The DropControl property idenitfies any child control that was under the mouse cursor when the files were dropped.
The component accepts dropped files only if the Enabled property is True.
This component has been tested with Delphi 1, 2, 3 and 4. It may work correctly in Delphi 5 but this has not been tested.
In these instructions $(DELPHI)
is to be taken to represent the path where the appropriate version of Delphi was installed. For example, if you have Delphi 2 installed on the default installation path then $(DELPHI)
is equivalent to C:\Program Files\Borland\Delphi 2.0
.
drpfiles.zip
into a folder, preserving the directory structure.
drpfiles.pas
to the folder from where you wish to
install the component into the Delphi Component Palette. This will probably be an existing
folder where you keep the library components - say the default $(DELPHI)\lib
folder.
drpfiles.dcr
from the 16
sub-folder into the same place that
you copied drpfiles.pas
.
drpfiles.hlp
into the $(DELPHI)\bin
folder.
drpfiles.kwf
into the
$(DELPHI)\help
folder.
helpinst.exe
from the $(DELPHI)\help
folder. When
helpinst.exe
is running open the delphi.hdx
file and add
drpfiles.kwf
and click on the Save button.
drpfiles.pas
file in the directory where you placed it. Click OK to
recompile the components library.
drpfiles.pas
from the place where you copied it if you wish.
The component will appear on a palette called PJ Stuff. You can move the component to a
different palette as required, or hack the source code (before installing the component) by
finding the Register
procedure at the end of the code and changing the string
'PJ stuff'
to the name of the required palette.
drpfiles.zip
into a folder, preserving the directory structure.
drpfiles.pas
to the folder from where you wish to
install it into the Delphi Component Palette. This will probably be an existing folder where you
keep the library components - say the default $(DELPHI)\lib
folder.
drpfiles.dcr
from the 32
sub-folder into the
same place that you copied drpfiles.pas
.
drpfiles.hlp
into the $(DELPHI)\help
folder.
drpfiles.kwf
into the $(DELPHI)\help
folder.
helpinst.exe
from the
$(DELPHI)\help\tools
folder. When helpinst.exe
is running open the
delphi.hdx
file and add drpfiles.kwf
and click on the
Save button.
drpfiles.pas
file in the folder where you placed it. Click OK to
recompile the components library.
drpfiles.pas
from the place where you copied it if you wish.
The component will appear on a palette called PJ Stuff. You can move the component to a
different palette as required, or hack the source code (before installing the component) by
finding the Register
procedure at the end of the code and changing the string
'PJ stuff'
to the name of the required palette.
Note that although the provided help file gives information about using the component it cannot be linked into the Delphi 3 or Delphi 4 environments at present.
drpfiles.zip
into a folder, preserving the directory structure.
drpfiles.pas
to the folder from where you wish to install the
component into the Delphi Component Palette. This will probably be a sub-folder of the
$(DELPHI)\lib
folder.
drpfiles.dcr
from the 32
sub-folder into the same place
that you copied drpfiles.pas
.
drpfiles.pas
and select the file.
$(DELPHI)\lib\dclusrXX.dpk
(where XX=30 for Delphi 3 and XX=40 for Delphi 4).
drpfiles.pas
from the place where you copied it if you wish.
The component will appear on a palette called PJ Stuff. You can move the component to a
different palette as required, or hack the source code (before installing the program) by
finding the Register
procedure at the end of the code and changing the string
'PJ stuff'
to the name of the required palette.
$(DELPHI)\bin
folder for Delphi 1 or the $(DELPHI)/help
folder for Delphi 2). The location of the help file will be remembered in future.
Un-released
DrpFiles v1.0 of 15/05/1998
Un-released
DrpFiles v1.1 of 22/10/1998
Release 1.1 of 10/07/1999
DrpFiles v1.1a of 09/04/1999
Release 1.1.1 of 28/11/1999
DrpFiles v1.1a of 09/04/1999
This component is copyright © P.D.Johnson, 1998-1999.
The source code and help files can be freely distributed on a not-for-profit basis providing that:
By not-for-profit I mean that you may recover out of pocket expenses incurred in distributing the code, but should not make a profit from this.
If you discover any bugs in this implementation, or if you have any update suggestions, please contact me on peter.johnson@openlink.org.
Please do modify the code for you own use. I'd like to see any changes you make - I could incorporate them into future versions. Please notify me of changes on at the above e-mail address.
This software is provided as is - no warranty is given as to its suitability for any purposes to which you may wish to put it.
I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales, UK. I write mainly in Delphi, but occasionally dabble in C, C++ and Java. My programs are available for download on my web-site: http://homepages.tesco.net/~p.d.johnson/.
I can be contacted by e-mail on peter.johnson@openlink.org.