Copy link to clipboard
Copied
I have a plug-in that is attempting to accept a drag & drop operation from a 3rd party browser based image system.
The drag operation provides a 'TEXT' flavour which contains a URL that I want to process and then make some
changes to the text box that was targeted.
Typically you implement a CDragDropTargetFlavorHelper and override CouldAcceptTypes & ProcessDragDropCommand
DragDrop::TargetResponse
OrdPnlDDFlavorHelper::CouldAcceptTypes( const IDragDropTarget* target,
DataObjectIterator* dataIter,const IDragDropSource* fromSource,
const IDragDropController* controller ) const
{
... Some code to Decide that the 'TEXT' flavour is in the Drag preceeds this bit
DataExchangeResponse response = dataIter->FlavorExistsWithPriorityInAllObjects( 'TEXT' );
if( response.CanDo() && target->IsTargetModifiable() )
{
InterfacePtr<IDragDropController> ddController( GetExecutionContextSession(),IID_IDRAGDROPCONTROLLER );
ddController->SetTrackingCursorFeedback( CursorSpec( kCrsrPlaceFileInto ) );
return DragDrop::TargetResponse( DragDrop::kDropWillCopy,
DragDrop::kUseDefaultTrackingFeedback,
DragDrop::kUseDefaultCursorFeedback,
DragDrop::kUseDefaultTargetTracking,
DragDrop::kOverrideHelper );
}
return DragDrop::kWontAcceptTargetResponse;
}
The last parameter if the DragDrop::TargetResponse is interesting here as it defines the behaviour of the FlavorHelper and is of the type PMFlavorPriority
which has a whole host of settings in PMFlavorTypes.h starting at line 132. One of these is kHighestFlavorPriority which I would expect to give our handler top priority and be allowed to accept the drop. No matter what value I pass back for this, the standard InDesign 'TEXT' flavour handler always gets the drop and our ProcessDragDropCommand function is never called.
Has anyone ever successfully modified the default drop behavior on text boxes for the 'TEXT' flavor?
My solution works fine for Picture boxes ( presumably because they don't accept the 'TEXT' flavor ).
Kind Regards,
Mike/
Copy link to clipboard
Copied
Hi,
I seem to be at the place you are. Did you find a solution for this?
P.
Copy link to clipboard
Copied
Hi,
Unfortunately not I'm afraid, we ended up having to drop support for this feature in the end.
At the time I believe we were attempting to implement this in CC2015 and also CS5.5 and
to support some legacy installs. I presume this is still broken in CC2019 too?
Regards,
Mike.
Copy link to clipboard
Copied
Hi,
I am Mac CC2015 and have got it working with Chrome and FireFox. My problem is with windows. On windows my CouldAccept gets called but ProcessDD doesn't.
This might help you.
I am using:
#define customFlavor kTEXTExternalFlavor
In the CouldAccept
response = dataIter->FlavorExistsWithPriorityInAllObjects(customFlavor);
if (response.CanDo())
{
return DragDrop::TargetResponse(response, DragDrop::kDropWillCopy);
}
P.
Edited.
I was using 'Text' flavour, now using 'TEXT' and Safari works too.
Copy link to clipboard
Copied
Hi,
Thanks for the heads up, will certainly look into it and see if this helps.
Regards,
Mike.
Copy link to clipboard
Copied
Did you get Windows working?
P
Copy link to clipboard
Copied
It was a mac only install and codebase so windows wasn't used.
Mike.