Copy link to clipboard
Copied
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:
What type of panel is this?
What panel type should I use to dynamically create such a panel?
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.
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!
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;
};
Copy link to clipboard
Copied
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
-Manan
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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;
};
Copy link to clipboard
Copied
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?