Change Command on "Add new Tab"-Button  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
sbe
User
Posts: 13
Joined: Thu Sep 08, 2016 7:01 am

Change Command on "Add new Tab"-Button

Post by sbe »

Hello,

i want to change the command on the "Add new Tab"-Button.

Is that possible?

Image

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

Re: Change Command on "Add new Tab"-Button

Post by Sasha - Tracker Dev Team »

Hello sbe,

Well, depending on what do you want. For example, there was a sample on how to hide it - maybe this would suit your needs.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
sbe
User
Posts: 13
Joined: Thu Sep 08, 2016 7:01 am

Re: Change Command on "Add new Tab"-Button

Post by sbe »

Hello Alex!

I've already searched for the "Add New Tab" command in the command list and have not found it.

Image

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

Re: Change Command on "Add new Tab"-Button

Post by Sasha - Tracker Dev Team »

Because there is no such command. Referring to my previous post, there is a possibility of hiding the button itself. Do you have a need to reload it?
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
sbe
User
Posts: 13
Joined: Thu Sep 08, 2016 7:01 am

Re: Change Command on "Add new Tab"-Button

Post by sbe »

Ok, so how can I hide the button?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Change Command on "Add new Tab"-Button  SOLVED

Post by Sasha - Tracker Dev Team »

This piece of code will do this:

Code: Select all

PDFXEdit.IUIX_Layout layout = pdfCtl.Inst.MainFrm[0].View.DocViewsArea.Panes.Layout;
if (layout.Root.Count > 0)
	layout.Root[0].SetStyle(0, (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_AddNewTabBtn);
Note, that this will be only available when at least one document is already opened. Best to use this piece of code in the e_document_viewingStarted event.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
sbe
User
Posts: 13
Joined: Thu Sep 08, 2016 7:01 am

Re: Change Command on "Add new Tab"-Button

Post by sbe »

Thank you.
That is perfect :)

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

Re: Change Command on "Add new Tab"-Button

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: Change Command on "Add new Tab"-Button

Post by zarkogajic »

Sasha - Tracker Dev Team wrote: Thu Nov 17, 2016 3:30 pm Because there is no such command...
Hi Alex,

Is this still the case? No command for the "Add new tab" "+" sign?

Again, here also I have the problem with multiple PXV_Control instances. If a document docA is open in crlA, clicking the "+" in ctrlB and trying to open docA will just activate ctrlA. Like with the "cmd.open" - any handler to custom handle?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Change Command on "Add new Tab"-Button

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

In your case, it's better to disable it, as that is not a command and you cannot handle the execution.

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

Re: Change Command on "Add new Tab"-Button

Post by zarkogajic »

Alex,

Just to be certain of what you are saying: there's nothing a developer can do when that "+" button is clicked? From the click action to the final result - all is completely under psv_control and no event or something can be used to change anything here?

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

Re: Change Command on "Add new Tab"-Button

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

You can always add the DocumentViewsArea's object as a custom event target:

Code: Select all

IPXV_MainFrame mainFrm = pdfCtl.Inst.MainFrm[0] as IPXV_MainFrame;
IPXV_MainView view = mainFrm.View as IPXV_MainView;
IPXV_DocumentViewsArea docViewsArea = view.DocViewsArea as IPXV_DocumentViewsArea;
dvaET = new CustomEventTarget(docViewsArea.Obj, this);
Then listen to the OnEvent's

Code: Select all

if (pEvent.Code == (int)PDFXEdit.UIX_EventCodes.e_Notify)
			{
				IntPtr outPtr = new IntPtr(pEvent.Param1);
				PDFXEdit.UIX_NotifyInfo ni = (PDFXEdit.UIX_NotifyInfo)System.Runtime.InteropServices.Marshal.PtrToStructure(outPtr, typeof(PDFXEdit.UIX_NotifyInfo));
				if (ni.nCode == (int)PDFXEdit.UIX_NotifyCodes.UIX_Notify_Layout_AddNewTabs)
And you can show your own dialog here to open files, and use the pEvent.Handled = true; to break with your results

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

Re: Change Command on "Add new Tab"-Button

Post by zarkogajic »

Alex,

Yes, that's it thanks.


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

Re: Change Command on "Add new Tab"-Button

Post by Sasha - Tracker Dev Team »

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