When a floating window has more than one ContentPane, a close button appears in the title bar, which when clicked sends close commands to all the CPs in the floating window. I need to follow the cancelable closing idiom here. I'm wondering if there is a higher event (at the SplitPane level perhaps?) in the floating window where I could add a handler to do this. Any other ideas are welcome. Thanks.
PaneToolWindowLoaded/Unloaded?
Hello Darryl,
Thank you for your post!
I have been looking into them and it seems that I am missing something from your scenario. Would you please provide me with some additional information about the functionality you are trying to achieve?
Do you want to be able to close the ContentPanes, that inside the Floating Widonw one by one and/or close the Floating Window itself too?
Having this information would help me further investigate this issue for you.
Looking forward to hearing from you.
Thank you for the feedback. Please do not hesitate to let me know if you have any further questions on this matter.
I played around with this some more this afternoon. There are lots of surprises as things move around and take different forms. But in the end, i can't see a way to do it apart from the PaneToolWindow class checking for a cancelled Pane.Closing, and aborting the loop of close commands on the child panes.
Thanks Gergana. But if I cancel, I would still need a Closing handler for a subsequent close (btw, ContentPane.Closing is wired when the CP is created).
Thank you for the provided information.
I have been looking into your post. What I can suggest is to hook the Closing event of the Pane of the PaneToolWindow in the ToolWindowLoaded event. Then in the Closing event of the PaneToolWindow you can check if the user is clicked "Cancel". If yes, you can unhook the Closing and Closed events of the ContentPanes, that are inside the PaneToolWindow.
I have created a small sample application for show you the above mentioned functionality. Please find the attached sample application and feel free to let me know if you have any further questions on this matter.
Hi Gergana. For a multi-document window, I need to wire-up the closing event with a yes/no/cancel messagebox, where if cancelled, no additional closing events will fire. This is relatively simple to achieve for the main window since that is outside the scope of the DM, but the floating PaneToolWindow (I believe it is) is intent on sending close commands for all child panes. Even if I find an event, I'm not so sure how/if I could cancel those commands.