Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

aboup pop-up panel!

Explorer ,
Apr 07, 2025 Apr 07, 2025

Snipaste_2025-04-08_10-42-43.png

I want to create a pop-up panel that appears when a button is clicked. This panel is different from regular panels — it has no tabs, cannot be docked, and it automatically closes when clicking outside of it (i.e., when clicking elsewhere in the application window).

Currently, I'm facing the following issues:

  1. What type of panel is this?
    What panel type should I use to dynamically create such a panel?

  2. How do I position the panel on the screen after creation?
    For example, I want it to appear next to the button that triggered it.

  3. How can I make the panel automatically close when clicking outside of it?
    What mechanism is used to detect this and close the panel?

If anyone has experience with this, please kindly share your insights. Thank you very much!

 

TOPICS
SDK
140
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Apr 07, 2025 Apr 07, 2025

Hi, 

 

You need to implement kPopupPanelButtonBoss. This is what it does, on click of button, it opens the popup panel and if you click outside then it will gets close.

 

In your fr file -

type MyPopupPanelButtonWidget(kViewRsrcType) : Widget (ClassID = kPopupPanelButtonBoss)
{
CControlView;
PopupPanelWidgetAttributes;
};

 

 

MyPopupPanelButtonWidget
(
MyWidgetID, // WidgetID
kSysButtonPMRsrcId, // RsrcID
kBindNone, // Binding
Frame(0, 0, 20, 20) // Frame (l,t,r,b)
kTrue, kTrue, // Visible, Enabled
MyPanelResource
...
Translate
Community Expert ,
Apr 07, 2025 Apr 07, 2025

I suppose this is a C++ SDK question. If so then anything we create using the SDK might have some basic features baked in like docking etc. So you have two options according to me

  1. Check the SDK to see if you have options to override this behaviour either using the fr file options or using the C++ code.
  2. Create a OS native UI for yourself and don't use InDesign sdk for this panel.

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 07, 2025 Apr 07, 2025

yes ,this is c++ sdk plugin. There are too many files in the SDK, and I don't know where to start. The SDK documentation doesn't cover this aspect, and the sample code doesn't provide any references either. That's why I came online to seek help. However, I believe it should be possible to achieve this using the SDK interfaces, because InDesign's C++ plugin development offers a very open set of APIs. It's just that the documentation isn't detailed or comprehensive enough.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2025 Apr 07, 2025

You won't find any documentation or help unless someone tried this already. I have worked on C++ sdk plugins where native OS UI was created like a login window etc, maybe the reason would be the same as yours. For checking out the capabilities of the SDK options you would have to read the header files which contain defintion for UI widgets that are then referenced when creating UI elements in fr file. The other option is to check if overriding some implementation of the UI element helps.

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 07, 2025 Apr 07, 2025

Hi, 

 

You need to implement kPopupPanelButtonBoss. This is what it does, on click of button, it opens the popup panel and if you click outside then it will gets close.

 

In your fr file -

type MyPopupPanelButtonWidget(kViewRsrcType) : Widget (ClassID = kPopupPanelButtonBoss)
{
CControlView;
PopupPanelWidgetAttributes;
};

 

 

MyPopupPanelButtonWidget
(
MyWidgetID, // WidgetID
kSysButtonPMRsrcId, // RsrcID
kBindNone, // Binding
Frame(0, 0, 20, 20) // Frame (l,t,r,b)
kTrue, kTrue, // Visible, Enabled
MyPanelResourceID,    // give your panel resource ID here
MyPluginID,
MyPanelResourceID,  // give your panel resource ID here
),
 
- Rahul Rastogi
Adobe InDesign SDK Custom Plugin Architect
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 08, 2025 Apr 08, 2025
LATEST

Thank you so much, this issue is resolved. You're truly my angel. By the way, I have one more question:
In the current situation, the popup panel is triggered by clicking a button. But if I want to trigger the same popup panel via a right-click of the mouse, or from within an edit box based on a key event, how should I do that?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines