[Demo] Dragging URL from TreeView to RichViewEdit
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
[Demo] Dragging URL from TreeView to RichViewEdit
With use of Drag&Drop Component Suite by Anders Melander ( http://www.melander.dk/ ), you can easily implement drag&drop between VCL components and RichViewEdit.
New version of Drag&Drop Component Suite can be downloaded from https://github.com/DelphiPraxis/The-Dra ... nent-Suite
This demo shows how to drop:
- URLs listed in TTreeView
- bitmap contained in TImage
in TRichViewEdit.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
One more simple example using Drag&Drop Component Suite: dragging text from TRichViewEdit to TListBox
https://www.trichview.com/support/files ... istbox.zip
https://www.trichview.com/support/files ... istbox.zip
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Update: this information is obsolete. You can download a new version of D&D Component Suite from https://github.com/DelphiPraxis/The-Dra ... for-Delphi . It is compatible with new versions of Delphi.
The current version of Drag&Drop Component Suite is 5.2.
It is not compatible with Delphi XE2.
Changes required to install it in XE2:
1) Open DragDrop.pas, change all occurrences (2 times) of 'CF_MAX-1' to CF_LOCALE
2) Open DragDropContext.pas, change the declaration of methods of TDropContextMenu to
The same changes must be made to implementation of these methods.
3) Open DragDropD2011 package, save it as DragDropDXE2, and install.
The current version of Drag&Drop Component Suite is 5.2.
It is not compatible with Delphi XE2.
Changes required to install it in XE2:
1) Open DragDrop.pas, change all occurrences (2 times) of 'CF_MAX-1' to CF_LOCALE
2) Open DragDropContext.pas, change the declaration of methods of TDropContextMenu to
Code: Select all
{ IContextMenu }
function QueryContextMenu(Menu: HMENU; indexMenu, idCmdFirst, idCmdLast,
uFlags: UINT): HResult; stdcall;
function InvokeCommand(var lpici: TCMInvokeCommandInfo): HResult; stdcall;
function GetCommandString(idCmd: UINT_PTR; uType: UINT; pwReserved: PUINT;
pszName: LPSTR; cchMax: UINT): HResult; stdcall;
{ IContextMenu2 }
function HandleMenuMsg(uMsg: UINT; WParam: WPARAM; LParam: LPARAM): HResult; stdcall;
{ IContextMenu3 }
function HandleMenuMsg2(uMsg: UINT; WParam: WPARAM; LParam: LPARAM;
var lpResult: LRESULT): HResult; stdcall;
3) Open DragDropD2011 package, save it as DragDropDXE2, and install.
Also I noticed a couple of other changes needed to complete compile.
I have XE3 BTW.....
In the GetCommandString function there is this CASE statement:
case uFlags of //DLR was UType
Notice I changed from UTypes to UFlags That is because the NAME OF THE PARAMTER into the procedure had changed from UType to UFlags.
ALSO:
function TDropContextMenu.HandleMenuMsg(uMsg: UINT; WParam: WPARAM; LParam: LPARAM): HResult;
var
lpResult: LRESULT; //DLR
Notice my REDEFINITION of the lpResult variable. It USED to be "Integer", It had to be CHANGED to LRESULT, because the variable is used in a procedure call and the procedure EXPECTS a variable of type LPRESULT and not INTEGER
Anyways.... I got it to compile, so, YIPPIE!!!
Hope this helps someone out there!
Davie
I have XE3 BTW.....
In the GetCommandString function there is this CASE statement:
case uFlags of //DLR was UType
Notice I changed from UTypes to UFlags That is because the NAME OF THE PARAMTER into the procedure had changed from UType to UFlags.
ALSO:
function TDropContextMenu.HandleMenuMsg(uMsg: UINT; WParam: WPARAM; LParam: LPARAM): HResult;
var
lpResult: LRESULT; //DLR
Notice my REDEFINITION of the lpResult variable. It USED to be "Integer", It had to be CHANGED to LRESULT, because the variable is used in a procedure call and the procedure EXPECTS a variable of type LPRESULT and not INTEGER
Anyways.... I got it to compile, so, YIPPIE!!!
Hope this helps someone out there!
Davie
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: [Demo] Dragging URL from TreeView to RichViewEdit
For newer versions of Delphi, you can use https://github.com/DelphiPraxis/The-Dra ... for-Delphi