Add custom data to Properties 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.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Add custom data to Properties pane ?

Post by zarkogajic »

Hi support,

I'd like to add custom data to the Properties pane, say when "nothing" is selected I'd like to display some of document's properties like: Document Title, Author and stuff like which is available from the "Document properties" dialog. Possible?

So:
image.png

-žarko
You do not have the required permissions to view the files attached to this post.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add custom data to Properties pane ?

Post by zarkogajic »

Hi support,

?

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

Re: Add custom data to Properties pane ?

Post by Sasha - Tracker Dev Team »

Hello žarko,

Adding new groups via the IUIX_PropHost is not possible via the SDK (as it would be a correct method).
You can add a new group from the IUIX_List perspective though.

Code: Select all

int nID = pdfCtl.Inst.Str2ID("propertiesView");
PDFXEdit.IPXV_View view = pdfCtl.Frame.View.Panes.Active[nID];
if (view != null)
{
	IntPtr outPtr;
	view.Obj.QueryImpl(typeof(PDFXEdit.IUIX_PropList).GUID, null, out outPtr);
	PDFXEdit.IUIX_PropList propList = (PDFXEdit.IUIX_PropList)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
	if (propList != null)
	{
					
		IntPtr listPtr;
		propList.Obj.QueryImpl(typeof(PDFXEdit.IUIX_List).GUID, null, out listPtr);
		PDFXEdit.IUIX_List list = (PDFXEdit.IUIX_List)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(listPtr);
		if (list != null)
		{
			//Here we should use the new list callbacks that would call the old ones and also draw our new data
		
			//Here new group should be added and also the needed item count
			
			//By using the group's and item's param values, you can distinguish your group and elements from others and update it's text manually
			//The bad thing is that the OnDraw method is used for the items drawing and should be done via the IUIX_RenderContext methods like DrawText for the proper display.
			
			//This group should be added/updated each time the selection changes - as it will be removed from the list before the prop host update
		}
	}
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add custom data to Properties pane ?

Post by zarkogajic »

Hi Alex,

Thanks.

I'll give this a try. Btw,
The bad thing is that the OnDraw method is used for the items drawing and should be done via the IUIX_RenderContext methods like DrawText for the proper display.
Any code samples?

Anyhow, before I do any of this, I see that e.docSelection.changed is not fired when there's a document (hand tool active) and properties pane gets visible (so really no selection). General group will list "Inetial Scroll" and "Exclusive Mode". If I then switch to select text tool the properties pane will be refreshed and only "Exclusive mode" item will be displayed. Also, if I switch to Snapshoot Tool - again properties pane will be refreshed.

So: how to catch properties pane being refreshed when there's no selection? As this is when I want to add my data to the properties pane.

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

Re: Add custom data to Properties pane ?  SOLVED

Post by Sasha - Tracker Dev Team »

Hello žarko,

Sadly no code samples are available, because the callbacks were not working properly till some time (when I tried doing the sample for you).

You should listen to the List_OnChanged callback method - it should be called when any change has been made to the list itself.

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

Re: Add custom data to Properties pane ?

Post by zarkogajic »

Hi Alex,

OK, thanks. Sounds too complex for what I wanted to have so I will close the topic.

-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17949
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Add custom data to Properties pane ?

Post by Tracker Supp-Stefan »

Thanks Zarko!

Cheers,
Stefan