No Events Are Fired When Closing Panes

PDF-XChange Editor SDK for Developers

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.
Post Reply
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

No Events Are Fired When Closing Panes

Post by RMan »

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?
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: No Events Are Fired When Closing Panes

Post by zarkogajic »

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
image.png (15.27 KiB) Viewed 1955 times

-žarko
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

No Events Are Fired When Closing Panes

Post by TrackerSupp-Daniel »

:)
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
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: No Events Are Fired When Closing Panes

Post by Vasyl-Tracker Dev Team »

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.
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.
khho
User
Posts: 34
Joined: Fri Mar 11, 2022 11:02 am

Re: No Events Are Fired When Closing Panes

Post by khho »

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
Thanks for the hint to this in viewtopic.php?f=66&t=38428#p158547.
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)?
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: No Events Are Fired When Closing Panes

Post by Vasyl-Tracker Dev Team »

Do I have to create a handler for the IUIX_ObjImpl.OnEvent (which is a method)?
Yes, correct. Any implementation of IUIX_ObjImpl - is the simple event-listener. Like this:

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);
...
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.
khho
User
Posts: 34
Joined: Fri Mar 11, 2022 11:02 am

Re: No Events Are Fired When Closing Panes

Post by khho »

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?
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: No Events Are Fired When Closing Panes

Post by zarkogajic »

Hi

image.png

Or from code:


IPXVInst.Settings["Docs.AutoSyncDocPanesLayouts"].v = false;
IPXVInst.FireAppPrefsChanged(PXV_AppPrefsChange_Documents);


khho
User
Posts: 34
Joined: Fri Mar 11, 2022 11:02 am

Re: No Events Are Fired When Closing Panes

Post by khho »

Thank you, -ž
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

No Events Are Fired When Closing Panes

Post by Tracker Supp-Stefan »

:)
khho
User
Posts: 34
Joined: Fri Mar 11, 2022 11:02 am

Re: No Events Are Fired When Closing Panes

Post by khho »

I'm using IUIX_ObjImpl's OnEvent checking for pEvent.Code = e_Visible to get notified when a pane's visibility changes.
The pEvent.Code for e_Visible is 24? (I can't find it in the sdkhelp)
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: No Events Are Fired When Closing Panes

Post by Vasyl-Tracker Dev Team »

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.
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.
Post Reply