searchView "results" tree - handle OnItemClick to custom open document / navigate to a page  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

searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi support,

I need to be in control what happens when a tree item is clicked in the searchView results tree.

What happens now: document gets open (+ navigated to the page where the searched for term is found).

This does not use "cmd.open" - so custom handling it does not help.

Why: when working with multiple instances of the pxv_control, if a resulting document DocA is already opened in FrameA and I'm searching in FrameB and DocA is in results - I want the copy to be opened in FrameB and not FrameA activated....

p.s.
Yes, I can implement IUIX_TreeCallbacks for the "results" tree - but no help here as opening (+navigating to a page) of document happens behind the scenes (I cannot get to the Tree's internal data).


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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Btw,

If "e.searchView.resultSelected" is to be used - please provide some info around it: how to get the selected item with its data required to navigate to (document + location).

It looks like this could used to get the IPXV_SearchEntry (and similar) - just am not sure how.



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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

Just checked the inner code - the document is being opened on item click if the item is pointing to the other document. You can prohibit it's opening by catching the e.operBeforeExecute event and checking whether it's an op.openDoc operation and act accordingly.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

Thanks, that's something.

Need more help though :)

What is pEvent in this case?

Once I have it (IOperation) I can get to the actual file using InstAFS.DefaultFileSys.NameToString(IAFS_Name) if op.Params.Root['Input'] is IAFS_Name.

However, when search results tree is clicked, it will open a file but also go to specific location - how can I get that also?

Also, how do I know in what MainFrame this is happening (search results pane)?

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

To add complexity to this question (any hopefully explain myself better):

1. Document_A is opened in Frame_A
2. SearchView is used in Frame_B (searching in folders) - Frame_B is active
3. Search results include Document_A
4. Clicking on a search result entry connected to Document_A will activate Frame_A

I simply must stop this from happening and open the document (and navigate to result item) in the calling MainFrame (where the searchView is used / initiated) - Frame_B.

So, I'm looking for how to be notified, but also be able to react, when clicking on a search result item.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi support,

I've jumped over many hurdles while adjusting to how the SDK works when I have many PXV_Controls that I want to run separately from others (so, multiple control instances, calling each one "Control" here).

So far so good, I'm in control over document opening, I can handle events specific to the Control in which the even occurs, ...

I'm now in front of the wall and the wall is "searchView" - and after a few days of trying crazy different approaches it seems I cannot jump over that one.

Searching in the active document is ok - no issues here.

The first issue is searching "In all open documents" - if I have 2 Controls and each has one document (Control_A has Doc_A and Control_B has Doc_B), the search pane will display "In all open documents (2)" - and the results will include both documents. If I'm searching in Control_A - I'm in trouble as clicking on a search result for Doc_B will activate Control_B - and for me this is a biiig issue - no auto activating of different Controls must happen for me.

I think I could overcome this (have not actually started coding) by handling the "e.operBeforeExecute" for "op.search" and checking what's inside Input array (ipxv_documents) and clear / setup array to only list documents in the Control where the operation is executed.
But, I do not know how to get from the IOperation to where it is being executed / in what Control (to know what documents to feed it with)? Let's say that would be Active control (ActiveMainFrm) .. so maybe this will work. ? Also, "who" initiated the "op.search", the "Search" button in searchView or was it executed by some other means...

The "search in folder" is even more complex - no going into details until some feedback.

So, please ... some feedback here...


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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

OK, first, you can get the MainView from the SearchView that is being clicked on - by getting the tree's UIObj on click and then getting the MainView from that object. Sadly, no way of getting the information directly from the operBeforeExecute event - as the pFrom is IOperation. But, you can store some kind of marker what search view was clicked and then act accordingly. Also, I think that the ActiveMainView would also be correct as someone clicked on the view thus the operation was launched so the active view should be the one that you need.

How the entire opening process looks like:
1) The user clicks on the item in the search list.
2) If the item is document then the we'll try to obtain the document - either from the IPXV_Inst (that checks whether it's already opened) or from the IAFS_Name (if it was not opened). Here, when the document was not yet being opened, the ActiveFrame is being used. Thus intercepting the click on the search item and making the needed frame active (if it is not) and then continuing with the original on click can cause opening of the document in the active/activated frame.
3) If we open document from IAFS_Name, then first we are opening the IPXC_Document. This will launch the op.openDoc operation (that you can intercept) after which we obtain the resulting IPXC_Document.
4) Then the document is being opened in the ActiveView using the enabled mode (single doc, new frame etc) and we get the IPXV_Document.
5) And then the SearchView uses it's inner data to go to the needed position in that IPXV_Document.

Sadly, you cannot extract any information about the precise coordinates where the document should be opened. You can only tweak the document itself and the active view - that's all.

Basically what can be done is manually searching for the IPXV_Document by the resulting IPXC_Document and if it does exist - open it's duplicate in the frame you need (that all should be done in the e.operExecuted event after the operation was executed and the document was opened). If the document does not exists - then there won't be any problem as the active frame was clicked so the document will be opened in 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: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

Thanks for the input, mostly all I expected. I have no problems with opening documents from search results that are not already opened in any of the MainFrames.

My problem is with this part:
... either from the IPXV_Inst (that checks whether it's already opened...
When a document is already opened in a different MainFrame - you will activate that frame (and activate the document and go to the page with search result).

This is what I need to be able to stop if the found document is not in the MainFrame where the search operation was executed (and then I would open it in the needed Frame).

Your internal code is probably using something like FindDocBySrcFileName and you have your internal list of opened documents and then you compare by file name. You find the first match and activate (never mind in what Frame it is).

So an event like "e.FoundSearchResultsDocumentInSomeFrame" that I could use to say: "no, not that document".

Or in general, an event like "e.FoundDocumentInSomeFrame" raised by your code when you are searching for documents for whatever the reason (hint: link navigation) - would come more than handy in multiple controls scenarios.

p.s.
If I open a document by IStream it will have an empty string for CoreDoc.SrcInfo.ActualFileName. If such a document is opened in the active MainFrame and the search results have it, clicking on it in the search results - you will double open it - as you are "not" finding it.


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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

As I told before, you can get the resulting IPXC_Document in operExecuted event and see whether it is opened via the https://sdkhelp.pdf-xchange.com/vi ... cByCoreDoc method (or one that uses file path). Then you can duplicate it in the needed frame and then let the operation continue - then the API will try to find already opened document and will find it and hopefully will find it and will switch to the needed frame.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

I need to correct myself:
When a document is already opened in a different MainFrame - you will activate that frame (and activate the document and go to the page with search result).
That's actually not true. You will highlight search results in that different frame (if a document is already opened there) and "e.activeDocChanged" will *not* happen. if the search result points to a different page, this page will be set. However all this happens behind the scenes.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Sasha - Tracker Dev Team wrote: Tue Nov 12, 2019 3:30 pm As I told before, you can get the resulting IPXC_Document in operExecuted event and see whether it is opened via the https://sdkhelp.pdf-xchange.com/vi ... cByCoreDoc method (or one that uses file path). Then you can duplicate it in the needed frame and then let the operation continue - then the API will try to find already opened document and will find it and hopefully will find it and will switch to the needed frame.
Sorry Alex, I lost you now. I guess you are referring to e.operExecuted for op.openDoc ? The thing is that this will not happen if the document is already opened in another frame (and your API locates it there).

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

Let me try to "reset" this topic, since after quite some testing I think I know what would be the only possible solution (for my scenario).

Just to repeat: I'm working with multiple control instances and I want each control to be "on its own".

When using the SearchView and executing a search, the search operation is run / initiated in the active Main Frame.

Let's presume I have more than one MainFrame with some files opened in each.

Now, "Where would you like to search?" combo options:

In case of "In the Active Document" - no issue at all :)

In case of "In All Open Documents (X)" - this one is problematic. If I have 2 controls (/main frames) and a document in each, this option would search (and highlight results,...) in both (X=2) and this is what I would like to avoid.

If you could add one more entry to the combo: "In all documents in *this* window/frame" - problem solved, as I can remove the "in all open documents (x)" option from the drop down.
Or, not adding one more option to the combo, but adding a global setting that would work in that way ("ignore documents in other frames") - problem solved.

For the moment, if this option is selected I can handle e.operBeforeExecute and clear the Input array and fill it with only documents in the *active* MainFrame (where the search is being executed). I also need to edit the text (because of "(x)") in the cb.where combo in the searchView dialog - but I can live with that (needs to be done every time a document is opened or closed - the count of documents changes).

In case of "search in folder" - that's the most problematic one. The only solution here would be to have an option to ignore documents in other MainFrames. By ignoring I mean: when the search is executed and your internal code does the results highlighting (in opened documents) or opens a document (and then does highlighting) - to ignore those documents that are not in the "calling" frame. When a document, not opened in the active frame is selected, allow to open it in the active frame (never mind if already open in another).

So, yes, I'm requesting some new features/options :)

For the moment I cannot use the "search in folder" at all (in my scenario, of course) - and that's a shame as this is a fantastic feature of the SDK (made me say "yes!" when I saw how it works).

So, pretty please :)

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

Have you tried using the Callback option of the https://sdkhelp.pdf-xchange.com/view/PXV:op_search operation? There, you can take the old callbacks and only execute them when the IPXV_SearchEntry matches your needs - else, you don't execute them that will result in no highlighting or adding to the list.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Thanks Alex, this sounds interesting...

The problem is that the search is running in different thread(s) and any access to any View/Frame from OnNewEntry results in Access Violation. :(

I can get to the ActiveMainFrame, I can also vDoc := FindDocBySrcFileName for the coredoc from IPXV_SearchPtr. So some of Inst methods run nevermind the thread.

But when I use GetMainViewFromUIObj(vDoc.ActiveView.Obj), to compare the Document's View with ActiveMainFrame.View, the AV happens.

Any ideas?

ps.
How can this be:

Inst.ActiveMainFrm.View.ActiveDocView.Doc - returns a document, but
Inst.ActiveMainFrm.View.DocViewsArea.DocViews.Count == 0 ? (as I wanted to go over all document views/documents)



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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi support,

Oh my, oh my ... there's much more happening behind the scenes than I can keep track of.

I need again to reset this topic, and go from the beginning :( Hopefully something can be done, or I can forget about the searchView functionality completely.

Here's the first thing I'd like to stop from happening:
image.png
Here's the scenario:

1. We have two Controls (2 MainFrames) Frame_1, Frame_2
2. A document is opened in Frame_1 (in the picture on the right)
3. Search (in active document) is initiated
3.1 SearcView tree gets populated with results
3.2 Document chunks get highlighted (+ vertical scroll bar nicely gives visual clues to where the search results in the document are)

So far so good. Now comes the "funny" (I mean "oh, no") part:

4. The same document is opened in Frame_1, just opened, nothing more. (in the picture on the left)
5. Upon opening, document chunks get highlighted (+ scroll clues).

I need this not to happen.

How to stop this from happening?


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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi support,

I'm stuck with this .. so please an answer if possible :)

How to stop the auto-highlight of newly opened document chunks when a document is the same document opened in another frame and was a part of the last search result set ... as explained graphically in my previous post...


Btw, It seems I can "solve" this if I close OR hide the search pane in the Frame where the search was initiated - as this will "reset" the search (clear out results and highlights). So basically, when I switch to another Frame I would hide/close the searchView for all other frames (at that moment not active frames).

Still, can the auto-highlight-stop be done from code even if the searchView (having results as explained) is visible in another frame?

p.s.
To overcome the threading problem I'm now using IPXV_ThreadSafeCallback with ThreadSafeCall to check if the document in result is in my ActiveFrame ... but more on that later...
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

Are these different IPXV_Documents on your screenshot - or is it a same one (codewise)?

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

Same file (in terms of file name) opened in two Frames - 2 different ipxv documents.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

If you control how the highlighters are added then you can just simply skip the adding process. This can be done by using the callbacks for the search operation. Here's the sample that I had:

Code: Select all

public class SearchCallback : PDFXEdit.IPXV_SearchCallback
{
	PDFXEdit.IPXV_Inst m_Inst = null;
	//This array will tell us whether we already have visited this document so only the first search result will be shown
	List<uint> m_aDocuments = new List<uint>();
	public SearchCallback(PDFXEdit.IPXV_Inst Inst)
	{
		m_Inst = Inst;
	}
	public void OnFinish(int nResCode)
	{

	}

	//public void OnNewEntry(PDFXEdit.IPXV_SearchEntry pEntry)
	//{
	//	//Highlighting first item in the first document
	//	uint i = 0;
	//	PDFXEdit.IPXC_Document doc = null;
	//	PDFXEdit.IPXV_Document vDoc = null;
	//	PDFXEdit.IPXC_Page page = null;
	//	while (i < pEntry.Count)
	//	{
	//		PDFXEdit.IPXV_SearchEntryItem item = pEntry[i];
	//		PDFXEdit.IPXV_SearchPtr ptr = item.Ptr;
	//		uint nDocID = 0;
	//		for (uint j = 0; j < ptr.Count; j++)
	//		{
	//			PDFXEdit.PXV_SearchPtrChunk chunk = ptr[j];
	//			//First we get the document
	//			if (chunk.nType == (uint)PDFXEdit.PXV_SearchPtrChunkType.PXV_SearchPtrChunk_Document)
	//			{
	//				nDocID = chunk.nValue;
	//				doc = ptr.Doc[chunk.nValue];
	//				vDoc = m_Inst.FindDocByCoreDoc(doc);
	//			}
	//			else if (chunk.nType == (uint)PDFXEdit.PXV_SearchPtrChunkType.PXV_SearchPtrChunk_Page)
	//			{
	//				if (m_aDocuments.Contains(nDocID))
	//					break;
	//				if (doc != null)
	//					page = doc.Pages[chunk.nValue];
	//				if (page != null)
	//				{
	//					m_aDocuments.Add(nDocID);
	//					if (vDoc != null)
	//					{
	//						//Setting the current page of the document to the one with the results
	//						vDoc.ActiveView.PagesView.Layout.CurrentPage = page.Number;
	//					}

	//				}

	//			}
	//		}
	//		i++;
	//	}
	//}
	public void OnNewEntry(PDFXEdit.IPXV_SearchEntry pEntry)
	{
		//Highlighting items in the document
		uint i = 0;
		PDFXEdit.IPXC_Document doc = null;
		PDFXEdit.IPXV_Document vDoc = null;
		PDFXEdit.IPXC_Page page = null;
		PDFXEdit.IPXV_DocHighlighter highlighter = null;
		while (i < pEntry.Count)
		{
			PDFXEdit.IPXV_SearchEntryItem item = pEntry[i];
			PDFXEdit.IPXV_SearchPtr ptr = item.Ptr;
			for (uint j = 0; j < ptr.Count; j++)
			{
				PDFXEdit.PXV_SearchPtrChunk chunk = ptr[j];
				//First we get the document
				if (chunk.nType == (uint)PDFXEdit.PXV_SearchPtrChunkType.PXV_SearchPtrChunk_Document)
				{
					doc = ptr.Doc[chunk.nValue];
					vDoc = m_Inst.FindDocByCoreDoc(doc);
					//Now we'll need to check whether the document is opened so that we can highlight it
					if (vDoc != null)
					{
						highlighter = vDoc.AddNewHighlighter(PDFXEdit.PXV_DocHighlightType.PXV_DocHighlight_Page);
					}
				}
				else if (chunk.nType == (uint)PDFXEdit.PXV_SearchPtrChunkType.PXV_SearchPtrChunk_Page)
				{
					if (doc != null)
						page = doc.Pages[chunk.nValue];
					if (page != null)
					{
						//Now we have the page where the text is found
						for (uint k = 0; k < item.TextRangesCount; k++)
						{
							//Now we need to get the coordinates of the highlight boxes
							PDFXEdit.IPXC_QuadsF quads = item.GetTextRangeQuads(k);
							//Highlighting the search results
							if (highlighter != null)
							{
								PDFXEdit.PXV_DocHighlightAdvanced ha = new PDFXEdit.PXV_DocHighlightAdvanced();
								highlighter.Add(page, quads, null, null, ref ha, 0);
								//Setting the current page of the document to the one with the results
								vDoc.ActiveView.PagesView.Layout.CurrentPage = page.Number;
							}
						}
					}

				}
			}
			i++;
		}
	}

	public void OnStart()
	{

	}

	public void OnStartPtr(PDFXEdit.IPXV_SearchPtr pPtr)
	{

	}

	public void OnStopPtr(PDFXEdit.IPXV_SearchPtr pPtr, bool bIncomplete)
	{

	}
}

private void SearchOperation(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.search", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	input.Add().v = Doc.CoreDoc;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["AND"].Add().v = "stream";
	options["AND"].Add().v = "is";
	options["AND"].Add().v = "defined";
	SearchCallback clbk = new SearchCallback(pdfCtl.Inst);
	options["Callback"].v = clbk;
	options["Flags"].v = (int)PDFXEdit.PXV_SearchFlags.PXV_SearchFlag_GetTextQuads | (int)PDFXEdit.PXV_SearchFlags.PXV_SearchFlag_IncludePageText;
	Op.Do();
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

Thanks, I knew this.

I am not controlling it - I'm leaving it to the default implementation.

The thing is that when a document is opened your internal code somehow figures out there was a search operation and directly highlights results in this new (but same file name) document - even if the search happened in a different frame.

This auto highlight is something I must be able to stop somehow.

I was hoping I could use something like RemoveHighlighter, if your internal code uses AddNewHighlighter, but I do not have access to something we could call "current" highlighter for a document.


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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

That's the thing - right now there is no possibility to remove the highlighter if you don't have a pointer to it. I will ask whether it would be possible to add such properties/methods to the IPXV_Document interface.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

Thanks.

One great addition to the SDK would be to be able to react when your internal code is looking for an existing document (by file name, for whatever the reason) in any of Frames - so a developer could say "no, not there".

Example: document A has a link to document B. A opened in Frame_A, B opened in Frame_B. When the A to B link is clicked (in Frame_A) - your internal code would locate B in Frame_B and activate it (and navigate to the corresponding location in it).
Being able to "cancel" the result of your internal search would help a lot - so I could cancel your result and specify: "no, B is not in to be located in Frame B, because the source of the action is in Frame_A" and you will not activate it, rather the process will continue and a duplicate of B will be open in Frame A (or action canceled or whatever).

The same applies for search results navigation. When searching in a folder, if the resulting document is opened in Frame_A and the search operation (by the means of searchView, so UI) is initiated in Frame_B - clicking on the search results will activate Frame_A. Again I would like to be able to "cancel" your internal "LookForDocumentByFileName" and say that no it is not open in the Frame where the search results are being navigated to.

I hope you get my point...

I will "solve" this topic - as my general conclusion (how I understand what you said) is that this auto-results-highlight-when-the-same-document-opens-in-another-frame cannot be canceled. Or?



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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

Hello žarko,

That is correct - that kind of advanced logic is not available via the SDK.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Alex,

OK, thanks.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Support,
...right now there is no possibility to remove the highlighter if you don't have a pointer to it. I will ask whether it would be possible to add such properties/methods to the IPXV_Document interface....
Has this been considered? RemoveHighlighter() ?

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Vasyl-Tracker Dev Team »

Hi zarko.

According to the initial question that sounds like "how to completely isolate mainframes and their docs from other mainframes and its docs?". I believe we touched that problem in the past here: here and I suggested to add a global option like "IsolateFrameDocs" or something similar. This option may solve all your problems related to using multiple frames that must be 'isolated' in your scenarios. Do you agree with that idea? If yes - we can add such option in the upcoming 355 build..

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Vasyl,

Yes, that should be it for that purpose.

Still, access to "your" highlighters (so GetHighlighter) and being able to remove / modify (items) could also come handy. In that way, I could (I think) change the highlight pen/brush of some items if needed.

Though for the moment I do not have a need for it - but, you never know..

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Vasyl-Tracker Dev Team »

Hi zarko.

If we talking about highlighting of search-results on the pages - there no IPXV_DocHighlighter is used, but a different mechanism. So even you will have a possibility to remove/edit highlighters - it will not help you.
But if you want to just tune the colors of search highlighting - look here:

Misc.FindResFColor1 - highlight's fill color for FullSearch
Misc.FindResSColor1 - highlight's stroke color for FullSearch

Misc.FindResFColor2 - highlight's fill color for Find-feature
Misc.FindResSColor2 - highlight's stroke color for Find-feature

Here you can specify the following strings:

rgb(1,0,0.5)
rgbd(255,0,128)
g(0.5) // gray, equals to rgbd(128,128,128)
...

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page  SOLVED

Post by zarkogajic »

Hi Vasyl,

Ok, thanks for the additional info.

I was hoping to be able to change the color per item. If no go, ok :)

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

searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Vasyl-Tracker Dev Team »

Hi, žarko.

In the new 355 build we added the new "General.IsolatedMainFrames" boolean parameter, as promised. It has false value by default.

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

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Hi Vasyl,

Thanks for the heads up.

Btw, can you provide more details on what will be affected by "IsolatedMainFrames" wen set to "true".

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by Vasyl-Tracker Dev Team »

At the moment, if you set "General.IsolatedMainFrames" to true - then each file you opening (via toolbar, from Search pane etc) - will be opened in the current mainframe only, and it doesn't matter if the same file is already opened in other mainframes (ActiveX controls).
Cons.: when you open the same file twice in two different mainframes - you will not be able to save changes back to that file because it will be locked by another opened document(s)...
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.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

Post by zarkogajic »

Thanks Vasyl,

Eagerly waiting for it :)

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

searchView "results" tree - handle OnItemClick to custom open document / navigate to a page

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