Highlighted

Get Text From EditTextBox Widget

New Here ,
Jul 28, 2020

Copy link to clipboard

Copied

Sorry to make another thread for my query... I'm unable to post a reply for my thread  https://community.adobe.com/t5/indesign/get-text-from-edittextbox-widget/m-p/11320167?page=1#M196286  it shows spam message....
Reply to my query..

Yes Manan. I'm using the InDesign debug build.

I have refered a Abode InDesign CS6 Plug-In Development document too.......... Still i can't find the actual problem in my code...

Here's my code... What was the problem in it????????


#include "VCPlugInHeaders.h"

// General includes:
#include "CObserver.h"
#include "ErrorUtils.h"
#include "EventUtilities.h"
#include "ILayoutUIUtils.h"
#include "ILinkFacade.h"
#include "IPasteboardUtils.h"

// Interface includes:
#include "IActiveContext.h"
#include "IControlView.h"
#include "IDropDownListController.h"
#include "IImportExportFacade.h"
#include "IPanelControlData.h"
#include "IStringData.h"
#include "IStringListControlData.h"
#include "ISpread.h"
#include "ISubject.h"
#include "IWidgetParent.h"
#include "PMString.h"
#include "URI.h"

// Project includes:
#include "CustomHttpLinkUIID.h"
#include "IScriptManager.h"
#include "IScriptRunner.h"
#include "Utils.h"
#include "IScriptUtils.h"
#include "JavaScriptID.h"
#include "IScriptUtils.h"
#include "IScriptArgs.h"
#include "CAlert.h"
#include "IExtendScriptUtils.h"
#include "ITextControlData.h"

class CustomHttpLinkUIPlaceButtonObserver : public CObserver
{
public:
CustomHttpLinkUIPlaceButtonObserver(IPMUnknown* boss);

virtual ~CustomHttpLinkUIPlaceButtonObserver() {}

virtual void AutoAttach();

virtual void AutoDetach();

virtual void Update(const ClassID& theChange, ISubject* theSubject, const PMIID &protocol, void* changedBy);
};

CREATE_PMINTERFACE(CustomHttpLinkUIPlaceButtonObserver, kCustomHttpLinkUIPlaceButtonObserverImpl)

CustomHttpLinkUIPlaceButtonObserver::CustomHttpLinkUIPlaceButtonObserver(IPMUnknown* boss)
: CObserver(boss)
{
}

void CustomHttpLinkUIPlaceButtonObserver::AutoAttach()
{
InterfacePtr<ISubject> subject(this, IID_ISUBJECT);
if (subject && !subject->IsAttached(this, IID_IBOOLEANCONTROLDATA))
subject->AttachObserver(this, IID_IBOOLEANCONTROLDATA);

}

void CustomHttpLinkUIPlaceButtonObserver::AutoDetach()
{
InterfacePtr<ISubject> subject(this, IID_ISUBJECT);
if (subject && subject->IsAttached(this, IID_IBOOLEANCONTROLDATA) && subject->IsAttached(this, IID_ITRISTATECONTROLDATA))
subject->DetachObserver(this, IID_IBOOLEANCONTROLDATA);

}

void CustomHttpLinkUIPlaceButtonObserver::Update(const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)
{
if (theChange == kTrueStateMessage)
{
// Check for the widget id
InterfacePtr<IControlView> view(this, UseDefaultIID());
WidgetID widgetid = view->GetWidgetID();
if (widgetid == kGetTextButtonWidgetID)
{
CAlert::InformationAlert("1");
InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID());
IControlView* EditTextBoxView = panelControlData->FindWidget(kSampleTextEditBoxWidgetID);
InterfacePtr<ITextControlData> EditBoxTextData(EditTextBoxView, UseDefaultIID());
PMString temp;
temp = EditBoxTextData->GetString();
PMString returnText = temp;
CAlert::InformationAlert(returnText);
}
}
}

 

Thanks,

ParvathiKannan.

Topics

How to, Scripting, SDK, Server developers, Sync and storage

Views

24

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

Get Text From EditTextBox Widget

New Here ,
Jul 28, 2020

Copy link to clipboard

Copied

Sorry to make another thread for my query... I'm unable to post a reply for my thread  https://community.adobe.com/t5/indesign/get-text-from-edittextbox-widget/m-p/11320167?page=1#M196286  it shows spam message....
Reply to my query..

Yes Manan. I'm using the InDesign debug build.

I have refered a Abode InDesign CS6 Plug-In Development document too.......... Still i can't find the actual problem in my code...

Here's my code... What was the problem in it????????


#include "VCPlugInHeaders.h"

// General includes:
#include "CObserver.h"
#include "ErrorUtils.h"
#include "EventUtilities.h"
#include "ILayoutUIUtils.h"
#include "ILinkFacade.h"
#include "IPasteboardUtils.h"

// Interface includes:
#include "IActiveContext.h"
#include "IControlView.h"
#include "IDropDownListController.h"
#include "IImportExportFacade.h"
#include "IPanelControlData.h"
#include "IStringData.h"
#include "IStringListControlData.h"
#include "ISpread.h"
#include "ISubject.h"
#include "IWidgetParent.h"
#include "PMString.h"
#include "URI.h"

// Project includes:
#include "CustomHttpLinkUIID.h"
#include "IScriptManager.h"
#include "IScriptRunner.h"
#include "Utils.h"
#include "IScriptUtils.h"
#include "JavaScriptID.h"
#include "IScriptUtils.h"
#include "IScriptArgs.h"
#include "CAlert.h"
#include "IExtendScriptUtils.h"
#include "ITextControlData.h"

class CustomHttpLinkUIPlaceButtonObserver : public CObserver
{
public:
CustomHttpLinkUIPlaceButtonObserver(IPMUnknown* boss);

virtual ~CustomHttpLinkUIPlaceButtonObserver() {}

virtual void AutoAttach();

virtual void AutoDetach();

virtual void Update(const ClassID& theChange, ISubject* theSubject, const PMIID &protocol, void* changedBy);
};

CREATE_PMINTERFACE(CustomHttpLinkUIPlaceButtonObserver, kCustomHttpLinkUIPlaceButtonObserverImpl)

CustomHttpLinkUIPlaceButtonObserver::CustomHttpLinkUIPlaceButtonObserver(IPMUnknown* boss)
: CObserver(boss)
{
}

void CustomHttpLinkUIPlaceButtonObserver::AutoAttach()
{
InterfacePtr<ISubject> subject(this, IID_ISUBJECT);
if (subject && !subject->IsAttached(this, IID_IBOOLEANCONTROLDATA))
subject->AttachObserver(this, IID_IBOOLEANCONTROLDATA);

}

void CustomHttpLinkUIPlaceButtonObserver::AutoDetach()
{
InterfacePtr<ISubject> subject(this, IID_ISUBJECT);
if (subject && subject->IsAttached(this, IID_IBOOLEANCONTROLDATA) && subject->IsAttached(this, IID_ITRISTATECONTROLDATA))
subject->DetachObserver(this, IID_IBOOLEANCONTROLDATA);

}

void CustomHttpLinkUIPlaceButtonObserver::Update(const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)
{
if (theChange == kTrueStateMessage)
{
// Check for the widget id
InterfacePtr<IControlView> view(this, UseDefaultIID());
WidgetID widgetid = view->GetWidgetID();
if (widgetid == kGetTextButtonWidgetID)
{
CAlert::InformationAlert("1");
InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID());
IControlView* EditTextBoxView = panelControlData->FindWidget(kSampleTextEditBoxWidgetID);
InterfacePtr<ITextControlData> EditBoxTextData(EditTextBoxView, UseDefaultIID());
PMString temp;
temp = EditBoxTextData->GetString();
PMString returnText = temp;
CAlert::InformationAlert(returnText);
}
}
}

 

Thanks,

ParvathiKannan.

Topics

How to, Scripting, SDK, Server developers, Sync and storage

Views

25

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

Have something to add?

Join the conversation