Skip to main content
Matúš — LTTR
Inspiring
February 5, 2023
Question

Illustrator plugin C++ w. CEP - Modal dialog

  • February 5, 2023
  • 2 replies
  • 1592 views

Hey, developers!

 

I'm creating an Illustrator plugin - C++ Illustrator SDK with CEP.

 

How do I create, display and operate a cusotm modal dialog? Is it similar to creating panels? I already have those and need to display some UI content in a dialog. Can you share some resources on getting started with dialogs?

Are these dialogs blocking the user from interacting with the rest of Illustrator GUI or not?

 

Thanks.

This topic has been closed for replies.

2 replies

erinferinferinf
Adobe Employee
Adobe Employee
February 7, 2023

Hi there,

 

I also saw your post on the AdobeDevs Slack (an unoffical Slack run by the community, not Adobe).

 

The official Illustrator C++ documentation is a download available here: https://console.adobe.io/downloads/ai (If you get "access denied" read this article.)

Here's the CEP documentation: https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_11.x/Documentation/CEP%2011.1%20HTML%20Extension%20Cookbook.md

 

The C++ SDK document has a section about dialogs that begins like this:

 

quote

Adobe Dialog Manager (ADM)

 

ADM provides a consistent Adobe interface with a distinctive look and feel, through platform-independent user-interaction dialogs.

 

It defines modal dialogs (which keep the keyboard and mouse focus until dismissed by the user) and floating dialogs (palettes that remain onscreen until closed, interactively or programmatically, but do not prevent interaction with other windows). These are populated by dialog items (interface elements or controls).

 

ADM supports a wide variety of control types, including basic ones such as buttons and text, and more complicated types such as lists and hierarchy lists. ADM provides tabbed palettes and docking palettes, and automatic event tracking and radio-button grouping.

 

CEP covers modal dialogs in this section:

 

ModalDialog
  • A Modal Dialog type opens a new extension window and forces the user to interact only with the extenison window before returning control to the host application. User can interact with host application only after closing extension window.

 

Hopefully this can at least get you started.

 

My team also wrote a Getting Started Guide for CEP a few years ago, and it is still relevant for Illustrator.

 

(Scripting documentation: https://ai-scripting.docsforadobe.dev/)

Martin — LTTR
Participant
February 9, 2023

Hi @erinferinferinf,

 

thanks for the links.

 

Regarding the CEP path - our extension is a Panel extension as its main interface is shown in a panel. We have some sub-scenarios when we would like to open a modal dialog - for example, editing some complex values - either because it would need more space than our panel provides or to enforce atomicity of multiple changes - or showing an internet page in an embedded browser, in both cases triggered by a user click on a button in the panel.

 

We understood from the CEP documentation, that ModalDialog is a different extension type, i.e. it cannot be used as part of a Panel extension. Is there a supported / recommended way to display modal dialogs as part of Panel extensions?

Thanks.

Inspiring
February 13, 2023

I use modals and panel extenstions mixed together. 

Modals are always blocking for user input.

I seems logical that they are in fact 2 different extensions.

What i do is just load the Modal when neede via the plugin. 

Either the Ai plugin launches the modal directly or a CEP panel send a message to the Ai plugin and again the plugin lauches the modal. When finished the modal sents to the plugin and the plugin sends to the panel... Done! 🙂 

Monika Gause
Community Expert
Community Expert
February 5, 2023

Maybe @erinferinferinf  can help?