Change Command on "Add new Tab"-Button  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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 » Thu Nov 17, 2016 2:40 pm

Hello,

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

Is that possible?

Image

sbe

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

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

Post by Sasha - Tracker Dev Team » Thu Nov 17, 2016 3:10 pm

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 » Thu Nov 17, 2016 3:22 pm

Hello Alex!

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

Image

sbe

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

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

Post by Sasha - Tracker Dev Team » Thu Nov 17, 2016 3:30 pm

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?
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 » Thu Nov 17, 2016 3:33 pm

Ok, so how can I hide the button?

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

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

Post by Sasha - Tracker Dev Team » Thu Nov 17, 2016 3:36 pm

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 » Thu Nov 17, 2016 3:40 pm

Thank you.
That is perfect :)

sbe

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

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

Post by Sasha - Tracker Dev Team » Thu Nov 17, 2016 3:45 pm

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

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

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

Post by zarkogajic » Thu Sep 26, 2019 2:37 pm

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?

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

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

Post by Sasha - Tracker Dev Team » Fri Sep 27, 2019 7:56 am

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

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

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

Post by zarkogajic » Fri Sep 27, 2019 9:11 am

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?


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

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

Post by Sasha - Tracker Dev Team » Fri Sep 27, 2019 9:47 am

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

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

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

Post by zarkogajic » Fri Sep 27, 2019 2:07 pm

Alex,

Yes, that's it thanks.



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

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

Post by Sasha - Tracker Dev Team » Mon Sep 30, 2019 7:14 am

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply