Multi tab: hide/disable "drag and drop all tabs"  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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Multi tab: hide/disable "drag and drop all tabs"

Post by zarkogajic »

Hi devs,

Using muti tab viewer (Docs.SingleWnd = false).

How would I programmatically hide/disable "Drag and Drop all tabs" "tab" ?
image.png
image.png (21.89 KiB) Viewed 4426 times
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by zarkogajic »

Ok, solved with the help of this post: viewtopic.php?f=66&t=26530&

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

Re: Multi tab: hide/disable "drag and drop all tabs"

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: Multi tab: hide/disable "drag and drop all tabs"

Post by zarkogajic »

Ah ...

So, hiding the "drag and drop all tabs" by handling the "e_document_viewingStarted" and setting the UIX_LayoutItemStyle_NoTabBarGripperBtn - kind of works.

The e_document_viewingStarted seems to get fired only when a new document is loaded.

Now, having multiple tabs/documents open:

image.png
image.png (15.77 KiB) Viewed 4412 times

Sort the tabs:

image.png

and the TabBarGripperBtn gets visible again.

image.png
image.png (12.37 KiB) Viewed 4412 times
Question: what else to handle (and when) to set the UIX_LayoutItemStyle_NoTabBarGripperBtn ?

I want to remove that gripper button for good!
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

The best way to ensure this would be to use the Custom Event Handler for the Document Views Area and listen to the:

Code: Select all

if (ni.nCode == (int)PDFXEdit.UIX_NotifyCodes.UIX_Notify_Layout_Changed)
From what I see, this will be fired all of the times that layout is being changed (even if you switch between the documents).

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

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by zarkogajic »

Hi Alex,

Thanks. This seems to do the trick.

Sadly, not 100%.

I can still reorder tabs by drag and drop - I'm ok with this and yes, I do not want to disable this by using UIX_LayoutStyle_PanesNoReorder.

But, I simply must disable drag-dropping a tab to move out of the main frame and open/goto/display another view (frame, window, however this is called) of the editor.
image.png
image.png (37.37 KiB) Viewed 4406 times
How to not allow the above?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

I've forwarded this to the appropriate developer, waiting for the reply.

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

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by zarkogajic »

Hi Alex,

Any news here?

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

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Reminded him about this one - waiting for the reply.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Vasyl-Tracker Dev Team »

Hi zarkogajic.

Sorry for delay with answer.

To hide the unnecessary buttons use it once:

Code: Select all

PDFXEdit.IUIX_LayoutItem tabsContainer = pdfCtl.Frame.View.DocViewsArea.Panes.Layout.Root[0];
int st = (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoTabBarGripperBtn;
int stm = (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoTabBarGripperBtn | (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_ShowSortedTabsBtn;
tabsContainer.SetStyle(st, stm);
To prevent undocking the document tabs but keep ability to reorder them:

Code: Select all

public partial class MyEventCallback : PDFXEdit.IEventHandler
{
	public int documentView_ready = 0;

	public void Start(PDFXEdit.IPXV_Inst inst)
	{
		documentView_ready = inst.Str2ID("e.documentView.ready");
		inst.EventServer.RegisterNativeEventHandler(documentView_ready, this);
	}
	// PDFXEdit.IEventHandler
	public void OnEvent(int nEventID, PDFXEdit.IEvent pEvent, object pFrom)
	{
		if (nEventID == documentView_ready)
		{
			PDFXEdit.IPXV_DocumentView docView = (PDFXEdit.IPXV_DocumentView)pFrom;
			docView.Obj.Parent.LI.SetStyle((int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoFloat, (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoFloat);
		}
	}
}

....

MyEventCallback eh = new MyEventCallback();
eh.Start(pdfCtl.Inst);

....

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Multi tab: hide/disable "drag and drop all tabs"  SOLVED

Post by zarkogajic »

Hi Vasyl,

Fantastic, thanks! Works like a charm.

Btw,
To hide the unnecessary buttons use it once:..
Cannot be called once, as when tabs are rearranged (sorted) the gripper button will re-display.

So, this must be called in the IUIX_ObjImpl implementation when pEvent.Code = e_Notify and ni.nCode = UIX_Notify_Layout_Changed, and then with this style:

Code: Select all

layout.Root[0].SetStyle(UIX_LayoutItemStyle_NoTabBarGripperBtn, UIX_LayoutItemStyle_NoTabBarGripperBtn OR UIX_LayoutItemStyle_ShowTabsThumbsBtn)
As I want to be able to activate the items using this button:
image.png
image.png (19.29 KiB) Viewed 4141 times
So, case closed :)

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

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Vasyl-Tracker Dev Team »

Cannot be called once, as when tabs are rearranged (sorted) the gripper button will re-display.
Yes, you are right - this wrong behavior caused by using the "Sort All Tabs Alphabetically" menu-item from the context menu.

We will fix that issue in the near future and instead of using it:

Code: Select all

PDFXEdit.IUIX_LayoutItem tabsContainer = pdfCtl.Frame.View.DocViewsArea.Panes.Layout.Root[0];
int st = (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoTabBarGripperBtn;
int stm = (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoTabBarGripperBtn | (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_ShowSortedTabsBtn;
tabsContainer.SetStyle(st, stm);
you will be able to use once only the:

Code: Select all

int ncst = pdfCtl.Frame.View.DocViewsArea.Panes.Layout.NewContainerStyle;
ncst |= (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoTabBarGripperBtn;
ncst &= ~(int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_ShowSortedTabsBtn;
pdfCtl.Frame.View.DocViewsArea.Panes.Layout.NewContainerStyle = ncst;
Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by zarkogajic »

Hi Vasyl,

Great. Eagerly waiting for the next update...

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

Re: Multi tab: hide/disable "drag and drop all tabs"

Post by Tracker Supp-Stefan »

:D
Post Reply