No Events Are Fired When Closing Panes
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
No Events Are Fired When Closing Panes
We are trying to determine when a pane is closed to update a menu but it doesn't appear that any events are fired when it happens unless all the panes are closed and then the e.pagesView.endLayoutChanging event is finally thrown.
You can test it by showing the Thumbnail and Bookmarks panes in the standard location and then using the close button to only close one of them.
The only thing I have determined so far is to Implement a IUIX_EventMonitor and watch for each pane for the e_Visible event which doesn't appear to be the most efficient way to do it.
Is there an easier way to a way to capture maybe that the menu selection has been checked or unchecked?
You can test it by showing the Thumbnail and Bookmarks panes in the standard location and then using the close button to only close one of them.
The only thing I have determined so far is to Implement a IUIX_EventMonitor and watch for each pane for the e_Visible event which doesn't appear to be the most efficient way to do it.
Is there an easier way to a way to capture maybe that the menu selection has been checked or unchecked?
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: No Events Are Fired When Closing Panes
Hi RMan,
I'm using IUIX_ObjImpl's OnEvent checking for pEvent.Code = e_Visible to get notified when a pane's visibility changes.
Setting up IUIX_ObjImpl when e.documentView.ready is fired in OnEvent for pxvControl.
In e.documentView.ready the pFrom is IPXV_DocumentView. So, pushing my IUIX_ObjImpl for IPXV_DocumentView.BookmarksView.Obj for example.
Note that a pane can be both visible and hidden.
You can use :
IPXV_View.Panes.IsVisible[pane as IPXV_View]
IPXV_View.Panes.IsHidden[pane as IPXV_View]
In the below image, Bookmark's pane IsHidded == false AND IsVisible == false
-žarko
I'm using IUIX_ObjImpl's OnEvent checking for pEvent.Code = e_Visible to get notified when a pane's visibility changes.
Setting up IUIX_ObjImpl when e.documentView.ready is fired in OnEvent for pxvControl.
In e.documentView.ready the pFrom is IPXV_DocumentView. So, pushing my IUIX_ObjImpl for IPXV_DocumentView.BookmarksView.Obj for example.
Note that a pane can be both visible and hidden.
You can use :
IPXV_View.Panes.IsVisible[pane as IPXV_View]
IPXV_View.Panes.IsHidden[pane as IPXV_View]
In the below image, Bookmark's pane IsHidded == false AND IsVisible == false
-žarko
- TrackerSupp-Daniel
- Site Admin
- Posts: 8440
- Joined: Wed Jan 03, 2018 6:52 pm
No Events Are Fired When Closing Panes
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2352
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: No Events Are Fired When Closing Panes
Also you may listen to UIX_Notify_Layout_*** notifications sent by IPXV_DocumentView.Panes.Layout object to the IPXV_DocumentView.Obj.
For example, you may intercept them in your global IUIX_EventMonitor::OnEvent, find the corresponding IPXV_Document/IPXV_DocumentView by comparing the Document[n].View[m].Obj and pTarget-arg and then react as you want... OR you may put your own listener of UI-events directly to the certain IPXV_DocumentView.Obj, by IUIX_Obj::PushImpl. Note: be aware in your IUIX_ObjImpl::OnPreEvent/OnEvent/OnPostEvent and keep Event.bHandled==false to allow default handling of events when you don't plan to completely override it...
HTH.
For example, you may intercept them in your global IUIX_EventMonitor::OnEvent, find the corresponding IPXV_Document/IPXV_DocumentView by comparing the Document[n].View[m].Obj and pTarget-arg and then react as you want... OR you may put your own listener of UI-events directly to the certain IPXV_DocumentView.Obj, by IUIX_Obj::PushImpl. Note: be aware in your IUIX_ObjImpl::OnPreEvent/OnEvent/OnPostEvent and keep Event.bHandled==false to allow default handling of events when you don't plan to completely override it...
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: No Events Are Fired When Closing Panes
Thanks for the hint to this in viewtopic.php?f=66&t=38428#p158547.zarkogajic wrote: ↑Thu Aug 26, 2021 1:39 pm Hi RMan,
I'm using IUIX_ObjImpl's OnEvent checking for pEvent.Code = e_Visible to get notified when a pane's visibility changes.
Setting up IUIX_ObjImpl when e.documentView.ready is fired in OnEvent for pxvControl.
In e.documentView.ready the pFrom is IPXV_DocumentView. So, pushing my IUIX_ObjImpl for IPXV_DocumentView.BookmarksView.Obj for example.
Note that a pane can be both visible and hidden.
You can use :
IPXV_View.Panes.IsVisible[pane as IPXV_View]
IPXV_View.Panes.IsHidden[pane as IPXV_View]
In the below image, Bookmark's pane IsHidded == false AND IsVisible == false
image.png
-žarko
In OnEvent (Handler) for pxvControl I can identify e.documentView.ready
What does it mean: "Setting up IUIX_ObjImpl"
Do I have to create a handler for the IUIX_ObjImpl.OnEvent (which is a method)?
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2352
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: No Events Are Fired When Closing Panes
Yes, correct. Any implementation of IUIX_ObjImpl - is the simple event-listener. Like this:Do I have to create a handler for the IUIX_ObjImpl.OnEvent (which is a method)?
Code: Select all
class MyEventListener : IUIX_ObjImpl
{
public:
IUIX_Obj Obj; // get-property, implementation is optional, may return null
void OnPreEvent(IUIX_Obj pSender, IUIX_Event pEvent);
{
}
void OnEvent(IUIX_Obj pSender, IUIX_Event pEvent)
{
// use pEvent.Code, etc.
}
void OnPostEvent(IUIX_Obj pSender, IUIX_Event pEvent)
{
}
};
...
MyEventListener myListener = new MyEventListener();
documentView.Obj.PushImpl(myListener);
...
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: No Events Are Fired When Closing Panes
Thanks for the answers - they were very helpfull.
Another Question: when I display PageThumbsView via cmd.view.pageThumbnails the PageThumbsView appears on every Pdf-Tab (like in the PDF-XChange Editor itself). There is no way to do it for a single Tab I guess?
Another Question: when I display PageThumbsView via cmd.view.pageThumbnails the PageThumbsView appears on every Pdf-Tab (like in the PDF-XChange Editor itself). There is no way to do it for a single Tab I guess?
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: No Events Are Fired When Closing Panes
Hi
Or from code:
IPXVInst.Settings["Docs.AutoSyncDocPanesLayouts"].v = false;
IPXVInst.FireAppPrefsChanged(PXV_AppPrefsChange_Documents);
-ž
Or from code:
IPXVInst.Settings["Docs.AutoSyncDocPanesLayouts"].v = false;
IPXVInst.FireAppPrefsChanged(PXV_AppPrefsChange_Documents);
-ž
Re: No Events Are Fired When Closing Panes
Thank you, -ž
- Tracker Supp-Stefan
- Site Admin
- Posts: 17824
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: No Events Are Fired When Closing Panes
The pEvent.Code for e_Visible is 24? (I can't find it in the sdkhelp)I'm using IUIX_ObjImpl's OnEvent checking for pEvent.Code = e_Visible to get notified when a pane's visibility changes.
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2352
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: No Events Are Fired When Closing Panes
You may open any our .NET sample project , build it (to make import of types and interfaces from Editor SDK) and then use 'Go to Definition' feature in your IDE for PDFXEdit.UIX_EventCodes and you will see all values of all event-codes.
At the moment e_Visible=6472.
HTH.
At the moment e_Visible=6472.
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.