How to use icon for refreshing the content
Hi,
I have used the code to refresh the values using refresh icon I have tried the code to fetch and bind the values inside the panel but I cannot the icon doesn't get refresh.After it get refreshed it must be displayed in the editbox.Hereby I have attached the code which I have used
RollOverIconButtonWidget
(
kInStudioVersionControllerRefreshPanelButtonWidgetID, // WidgetID
kInStudioVersionControllerRefreshIconRsrcID, // Icon resource ID
kCustomHttpLinkUIPluginID, // Plug-in ID
kBindNone | kBindTop, // Binding
// kBindNone,
Frame(174, 348, 194, 368) // Frame (l,t,r,b)
kTrue, kTrue, // Visible, Enabled
kADBEIconSuiteButtonType, // PNGIconAttributes, new for InDesign 3.0
),
if(protocol == IID_ITRISTATECONTROLDATA && theChange == kTrueStateMessage)
{
InterfacePtr<IControlView> view(theSubject, UseDefaultIID()) ;
else if (view->GetWidgetID() == kInStudioVersionControllerRefreshPanelButtonWidgetID
{
do
{
InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importScript;
PMString dragdropaction;
importScript.Append("app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;");
importScript.Append("var dragdropaction =0;");
importScript.Append("for(var i=0;app.activeDocument.stories.length>i;i++)");
importScript.Append("dragdropaction += app.activeDocument.textFrames[i].texts.length;");
//importScript.Append("alert(dragdropaction);");
importScript.Append("app.scriptArgs.set(\"dragdropaction\",String(dragdropaction));");
importScript.Append("app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importScript);
dragdropaction = Utils<IScriptArgs>()->Get("dragdropaction");
CAlert::InformationAlert(dragdropaction);
Utils<IScriptArgs>()->Clear();
// Update the data displayed in the panel's widgets.
InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID());
ASSERT(panelControlData);
if (!panelControlData) {
break;
}
// Display each string returned by the suite in a line in the multi line widget.
IControlView* textControlView = panelControlData->FindWidget(kDragdropactionTextEditBoxWidgetID);
ASSERT(textControlView);
if (!textControlView) {
break;
}
InterfacePtr<ITextControlData> textControlData(textControlView, UseDefaultIID());
ASSERT(textControlData);
if (!textControlData) {
break;
}
textControlData->SetString(dragdropaction);
} while (false);
}
}
Please guide me on this...
Regards,