Highlighted

drag text into document -plugin development

Community Beginner ,
Aug 23, 2020

Copy link to clipboard

Copied

Hello,

I am trying to drag a text into document, i have the below code for this but its not working, please help!

 

InterfacePtr<IDataExchangeHandler> ourHandler(DNDController->QueryHandler(kTEXTFlavor));
if (ourHandler==nil)
{
    ASSERT_FAIL("Handler nil for our flavor?");
break;
}

if (ourHandler->IsEmpty() == kFalse)
{
ourHandler->Clear();
}

DNDController->SetSourceHandler(ourHandler);

PMString newPageItem("Hello There");

 

InterfacePtr<IStringData> stringData(ourHandler , UseDefaultIID());

stringData->Set(newPageItem);
InterfacePtr<IPMDataObject> item(DNDController->AddDragItem(1));


PMFlavorFlags flavorFlags = 0;

item->PromiseFlavor(kTEXTFlavor, flavorFlags);
result = kTrue;

TOPICS
SDK

Views

85

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

drag text into document -plugin development

Community Beginner ,
Aug 23, 2020

Copy link to clipboard

Copied

Hello,

I am trying to drag a text into document, i have the below code for this but its not working, please help!

 

InterfacePtr<IDataExchangeHandler> ourHandler(DNDController->QueryHandler(kTEXTFlavor));
if (ourHandler==nil)
{
    ASSERT_FAIL("Handler nil for our flavor?");
break;
}

if (ourHandler->IsEmpty() == kFalse)
{
ourHandler->Clear();
}

DNDController->SetSourceHandler(ourHandler);

PMString newPageItem("Hello There");

 

InterfacePtr<IStringData> stringData(ourHandler , UseDefaultIID());

stringData->Set(newPageItem);
InterfacePtr<IPMDataObject> item(DNDController->AddDragItem(1));


PMFlavorFlags flavorFlags = 0;

item->PromiseFlavor(kTEXTFlavor, flavorFlags);
result = kTrue;

TOPICS
SDK

Views

86

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 23, 2020 0

Have something to add?

Join the conversation