Copy link to clipboard
Copied
I have an Illustrator plugin which installs several tools. I want to have a panel pop up for each tool when the user selects a tool.
All the SDK examples I have seen create a main flex panel when the extension loads up. I do not want to any panel to appear when the extension is loaded. I want to load the extension and then popup panels only when a tool is selected.
What is the best way to implement this behavior?
Copy link to clipboard
Copied
There's a tool even for when a tool is selected, so it'd be fairly trivial to respond to use that opportunity to show the panel. We used to do this for one of our panels.
Also, though I don't use flex I would think it'd be possible to load but not show a panel when the extension is loaded, but I can't swear to it.
Copy link to clipboard
Copied
Also, though I don't use flex I would think it'd be possible to load but not show a panel when the extension is loaded, but I can't swear to it.
That seems to be the biggest obstacle. Whenever I load the extension a panel appears. I tried setting the dimensions to 0 and setting Autovisible=false but the panel still shows up whenever the extension is loaded.
Copy link to clipboard
Copied
You could give a look at FreedGrid/UI or StrikeFilter/UI projets. (sdk samples).
You will definitely find everything you are asking for.
1- How to set your plugin (tools,menus, notifications and communication).
2- How to set your extension (communication with your plugin, show, hide, load and unload extension).
Easy as 1,2,3!
Here is a sample code showing you how it works:
/*
*/
ASErr FreeGridPlugin::GoMenuItem(AIMenuMessage* message)
{
ASErr result = kNoErr;
// Compare the menuItem selected (in the message) with our stored values to see if we do anything
if (message->menuItem == this->fAboutPluginMenu)
{
// Pop this plug-in's about box.
SDKAboutPluginsHelper aboutPluginsHelper;
aboutPluginsHelper.PopAboutBox(message, "About FreeGrid", kSDKDefAboutSDKCompanyPluginsAlertString);
}
else if (message->menuItem == this->fMoveToNewAIMenu)
{
if (freeGridDialogController)
{
ASBoolean visible = freeGridDialogController->GetPanelReady();
if(visible)
{
result = freeGridDialogController->UnloadExtension();
freeGridDialogController->SetPanelReady(false);
}
else
{
result = freeGridDialogController->LoadExtension();
}
}
}
return result;
}
Best reagards,
Thomas.
Copy link to clipboard
Copied
You can always hide the panel (using panel controller) in your plugin startup.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now