Hide the "Find" pane  SOLVED

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

Hide the "Find" pane

Post by zarkogajic »

Hi Support,

How to programatically hide the "Find" pane as if clicking the [x] button:

image.png
image.png (21.31 KiB) Viewed 1919 times

?


Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Hide the "Find" pane

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Here's the code that should help you get the find dialog itself:
viewtopic.php?f=66&t=27795&p=108843&hil ... nd#p108843
Then you can emulate the click on the btn.close to hide it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hide the "Find" pane

Post by zarkogajic »

Thanks Alex,

I've tried that - but was not able to do what I'm really up to.

Btw, why does clicking the "Find..." command button makes the dialog visible if not, but does not hide it if already visible (the only way to close/hide it is to click the [x] (or ESC key in the "find..." box)? The Find command seems not to be of the on/off state type per document.

The real world question I have is: how do I get if the Find dialog is visible or not for a specific document (or in general if this is not document related - but it does appear it is)?

Here's why I'm asking: I'm working with multiple instances of the PXVControl.

One instance is active and a few documents loaded. For each document the state of the Find dialog is correctly tracked by your internal code . Meaning that activating Find for one document and switching to other document - the Find dialog gets hidden (if not made visible before for that one). Now, say the Find dialog is active/visible for the currently active document.

Instantiating another pxvControl somehow "doubles" the find dialog and it appears as active for the second instance (no documents loaded) but will actually search for words in the active document in the first instance.

The thing is that e.document.deactivated does not get fired for the active document in the first instance - and I guess your internal code keeps the Find dialog visible until this event.

To fix this I thought of finding if the dialog is active/visible and hiding it once I'm activating the second pxvControl (i.e. mimic e.document.deactivated).

Am hoping the above is clear and makes sense. Since you have no sample of working with multiple pxvControl instances I cannot reproduce in some sample projects.


zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hide the "Find" pane

Post by zarkogajic »

Ping...

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Hide the "Find" pane

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Well I gave you the way to find the dialog itself - I'm afraid that there are no methods to alter this aside from the mentioned one. I've checked - there are no settings or properties.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hide the "Find" pane

Post by zarkogajic »

Hi Alex,

I can get to the IUIX_Dialog via IUIX_EventMonitor and I can catch that the Find dialog is made visible or closed/hidden when pEvent.Code == e_Visible.

When I activate or close the Find dialog the e_Visible is fired 3 times - why?

I think pEvent.Param1 == 1 when made visible, and pEvent.Param1 = 0 when closed. I need your confirmation for this.

Further, it seems that each ipxvDocument has its own instance of the Find dialog - please confirm?

Can I get to the document from pTarget? Can I get to any other object (via QueryInterface) from pTarget (when pTarget is the Find dialog of course)?

p.s.
If each document has its own dialog, and I think it does (but need your confirmation as per above), then I can store the reference to the dialog object (upon first show) with the document and when needed I think I could close the dialog by sending "esc" key to the cb.findText or sending a raw click event to btn.close. I just need a few answers/confirmations for the above raised questions :)


-žarko
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hide the "Find" pane  SOLVED

Post by zarkogajic »

Hi Support,

Ok, here's what needs to be done.

1. Implement IUIX_EventMonitor for "DlgDocFind"
2. In OnEventMonitor when pEvent.Code = e_First (first time the dialog object is created for a particular document):
2.1. store the reference to the IUIX_Dialog (in [4])
2.2. get IPXV_DocumentView via Inst.GetDocViewFromUIObj from pTarget
2.3. from there we have the IPXV_DocumentView and the IPXV_Document
4. Have an internal list of IPXV_Document's along with their DlgDocFind dialogs.

When we need to close the DlgDocFind dialog, because switching to another instance of the pxvControl:

1. Iterate over IPXV_Document's in the active MainFrame (hence active pxvControl) via IPXV_MainView.IPXV_DocumentViewsArea.IPXV_DocViewsList.IPXV_DocumentView's

2. Get the "btn.close" IUIX_Obj/IUIX_Button on the dialog (stored above in [4]).
2.1. If IsVisible: (button's IUIX_Obj)
2.1.1. Use SendRawEvent to send UIX_Notify_Clicked to that button.

Find dialog gets closed.

Note that if you have multiple documents in MainView - meaning you can have multiple DlgDocFind dialogs (one for each document) - only one willl/can be visible at a time (for the active document) - and that one will be closed.

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Hide the "Find" pane

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply