DropMaster 是4個原生 VCL 控件的集合,在 Delphi 和 C++Builder 中使用。雖然包含在 Delphi 和 C++Builder 中的 VCL 組件允許同一程序內窗口之間的拖放,DropMaster 允許開發者加入程序間拖放的支持。該拖放可以在開發者的新程序和已存在程序(例如 Microsoft Office 套件、web 瀏覽器等等)之間,或在兩個自定義程序之間。
DropMaster is a set of 4 native VCL controls for use in Delphi and C++Builder. While the VCL components included with Delphi and C++Builder permit drag and drop between windows in the same application, DropMaster allows developers to add support for drag and drop between applications. The drag and drop can be between the developer's new application and existing applications such as the Microsoft Office suite, a web browser, etc., or between two custom-written applications.
The 4 DropMaster components are:
-
TDMTextSource
TDMTextSource deals with dragging data from your application to another. For simple use, you can assign a TWinControl on your form to the DonorComponent property, detect the drag in the control's OnMouseDown event, and call the Execute method. TDMTextSource is also the component that is used for dragging arbitrary formats other than text, through the use of its CustomFormatData property.
-
TDMTextTarget
TDMTextTarget deals with accepting data dragged into your application from another. TDMTextTarget is also the component that is used for accepting arbitrary formats other than text, through the use of its CustomFormat property.
-
TDMGraphicSource
Other than the native formats in TDMTextTarget, graphic images are the most commonly requested data types for drag and drop. For convenience, we provide TDMGraphicSource which works just like TDMTextSource, except that it has DonorImage and Picture properties (of type TImage and TPicture, respectively), which correspond to the DonorComponent and Text properties of TDMTextSource. Dragging a picture becomes as easy as assigning it to a property, detecting the drag, and calling Execute.
-
TDMGraphicTarget
TDMGraphicTarget can accept pictures dragged from another application. For convenience, it deals with multiple formats like DIBs, bitmap handles, metafiles and enhanced metafiles, so the developer need only provide a home for the TPicture data that is accepted. Of course, there is ample opportunity for customizing the process as with the other components.