hide some buttons in Thumbnails 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
kyo
User
Posts: 130
Joined: Mon Oct 31, 2016 11:58 am

hide some buttons in Thumbnails pane

Post by kyo »

Dear All,
I want to hide or remove some buttons in the Editor SDK's Thumbnails pane,because I do not want the end users to use them.

I have upload a image to indicate that which buttons need to be shown and which buttons need to be hidden or removed.

Please give me some advise or sample.

Thanks in advance.
Attachments
1.rar
(731.43 KiB) Downloaded 97 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: hide some buttons in Thumbnails pane  SOLVED

Post by Sasha - Tracker Dev Team »

Hello kyo,

Here's the sample that I have that removes Delete command from the Thumbnails View:

Code: Select all

PDFXEdit.IUIX_ScrollContainer scrollContainer = GetParentScrollContainer(pdfCtl.Doc.ActiveView.PageThumbsView.Obj);
PDFXEdit.IUIX_CmdLine line = scrollContainer.CmdPaneTop[0];
PDFXEdit.IUIX_CmdBar bar = line[0];
PDFXEdit.IUIX_CmdItem item = bar.FindFirstItemByCmdName("cmd.delete");
item.Delete();
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
kyo
User
Posts: 130
Joined: Mon Oct 31, 2016 11:58 am

Re: hide some buttons in Thumbnails pane

Post by kyo »

Hello,
Oh,I am very sorry.I made a mistake that I want to hide buttons in Bookmarks pane not the Thumbnails pane.

Does your sample code can be applied to Bookmarks pane either?

You'd better download the attachment that you can understand my requirement easily.

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

Re: hide some buttons in Thumbnails pane

Post by Sasha - Tracker Dev Team »

Hello kyo,

Yes, this code can be applied to any pane.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
kyo
User
Posts: 130
Joined: Mon Oct 31, 2016 11:58 am

Re: hide some buttons in Thumbnails pane

Post by kyo »

Code: Select all

PDFXEdit.IUIX_ScrollContainer scrollContainer = GetParentScrollContainer(pdfCtl.Doc.ActiveView.PageThumbsView.Obj);
PDFXEdit.IUIX_CmdLine line = scrollContainer.CmdPaneTop[0];
PDFXEdit.IUIX_CmdBar bar = line[0];
PDFXEdit.IUIX_CmdItem item = bar.FindFirstItemByCmdName("cmd.delete");
item.Delete();
I guess that maybe the GetParentScrollContainer method is a recursive method.
How to implement the GetParentScrollContainer method? Please give me a sample.

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

Re: hide some buttons in Thumbnails pane

Post by Sasha - Tracker Dev Team »

Hello kyo,

Forgot to include that one. Here you go:

Code: Select all

PDFXEdit.IUIX_ScrollContainer GetParentScrollContainer(PDFXEdit.IUIX_Obj obj)
{
	if (obj.Parent != null)
	{
		IntPtr outPtr;
		obj.Parent.QueryImpl(typeof(PDFXEdit.IUIX_ScrollContainer).GUID, null, out outPtr);
		PDFXEdit.IUIX_ScrollContainer sc = (PDFXEdit.IUIX_ScrollContainer)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
		if (sc != null)
			return sc;
		return GetParentScrollContainer(obj.Parent);
	}
	return null;
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply