Page 1 of 1
Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 2:40 pm
by sbe
Hello,
i want to change the command on the "Add new Tab"-Button.
Is that possible?
sbe
Re: Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 3:10 pm
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
Re: Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 3:22 pm
by sbe
Hello Alex!
I've already searched for the "Add New Tab" command in the command list and have not found it.
sbe
Re: Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 3:30 pm
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?
Re: Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 3:33 pm
by sbe
Ok, so how can I hide the button?
Re: Change Command on "Add new Tab"-Button SOLVED
Posted: Thu Nov 17, 2016 3:36 pm
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
Re: Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 3:40 pm
by sbe
Thank you.
That is perfect
sbe
Re: Change Command on "Add new Tab"-Button
Posted: Thu Nov 17, 2016 3:45 pm
by Sasha - Tracker Dev Team
Re: Change Command on "Add new Tab"-Button
Posted: Thu Sep 26, 2019 2:37 pm
by zarkogajic
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?
Re: Change Command on "Add new Tab"-Button
Posted: Fri Sep 27, 2019 7:56 am
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
Re: Change Command on "Add new Tab"-Button
Posted: Fri Sep 27, 2019 9:11 am
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?
-ž
Re: Change Command on "Add new Tab"-Button
Posted: Fri Sep 27, 2019 9:47 am
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
Re: Change Command on "Add new Tab"-Button
Posted: Fri Sep 27, 2019 2:07 pm
by zarkogajic
Alex,
Yes, that's it thanks.
-ž
Re: Change Command on "Add new Tab"-Button
Posted: Mon Sep 30, 2019 7:14 am
by Sasha - Tracker Dev Team