Resize the panel dynamically

Community Beginner ,
Jul 15, 2020

Copy link to clipboard

Copied

Hi,

I have displayed the page count values inside the panel.After displaying the value inside the panel i need to minimise the panel dynamically. Please guide me on this...

do
{
InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importScript;
PMString pagecount;
importScript.Append("var pagecount = app.activeDocument.pages.length;");
//importScript.Append("alert(pagecount);");
importScript.Append("app.scriptArgs.set(\"pagecount\",String(pagecount));");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importScript);
pagecount = Utils<IScriptArgs>()->Get("pagecount");
CAlert::InformationAlert(pagecount);
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(kPageCountTextEditBoxWidgetID);
ASSERT(textControlView);
if (!textControlView) {
break;
}
InterfacePtr<ITextControlData> textControlData(textControlView, UseDefaultIID());
ASSERT(textControlData);
if (!textControlData) {
break;
}

textControlData->SetString(pagecount);

textControlView->Resize(PMPoint(0, 0));

}while(false);

Rajendran
TOPICS
How to, Scripting, SDK

Views

36

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

Resize the panel dynamically

Community Beginner ,
Jul 15, 2020

Copy link to clipboard

Copied

Hi,

I have displayed the page count values inside the panel.After displaying the value inside the panel i need to minimise the panel dynamically. Please guide me on this...

do
{
InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importScript;
PMString pagecount;
importScript.Append("var pagecount = app.activeDocument.pages.length;");
//importScript.Append("alert(pagecount);");
importScript.Append("app.scriptArgs.set(\"pagecount\",String(pagecount));");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importScript);
pagecount = Utils<IScriptArgs>()->Get("pagecount");
CAlert::InformationAlert(pagecount);
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(kPageCountTextEditBoxWidgetID);
ASSERT(textControlView);
if (!textControlView) {
break;
}
InterfacePtr<ITextControlData> textControlData(textControlView, UseDefaultIID());
ASSERT(textControlData);
if (!textControlData) {
break;
}

textControlData->SetString(pagecount);

textControlView->Resize(PMPoint(0, 0));

}while(false);

Rajendran
TOPICS
How to, Scripting, SDK

Views

37

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
Jul 15, 2020 0

Have something to add?

Join the conversation