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

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

Post by zarkogajic » Mon Sep 16, 2019 12:20 pm

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 1640 times

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

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

Post by zarkogajic » Mon Sep 16, 2019 2:16 pm

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


User avatar
Sasha - Tracker Dev Team
User
Posts: 4885
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 » Mon Sep 16, 2019 2:52 pm

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

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

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

Post by zarkogajic » Tue Sep 17, 2019 9:25 am

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 1626 times

Sort the tabs:

image.png

and the TabBarGripperBtn gets visible again.

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

I want to remove that gripper button for good!

User avatar
Sasha - Tracker Dev Team
User
Posts: 4885
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 » Tue Sep 17, 2019 11:08 am

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

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

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

Post by zarkogajic » Tue Sep 17, 2019 11:48 am

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 1620 times
How to not allow the above?

User avatar
Sasha - Tracker Dev Team
User
Posts: 4885
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 » Wed Sep 18, 2019 7:21 am

Hello zarkogajic,

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

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

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

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

Post by zarkogajic » Thu Sep 26, 2019 3:39 pm

Hi Alex,

Any news here?


User avatar
Sasha - Tracker Dev Team
User
Posts: 4885
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 » Fri Sep 27, 2019 7:58 am

Hello zarkogajic,

Reminded him about this one - waiting for the reply.

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

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1983
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 » Wed Oct 02, 2019 2:05 am

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: 649
Joined: Thu Sep 05, 2019 12:35 pm

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

Post by zarkogajic » Wed Oct 02, 2019 8:26 am

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 1355 times
So, case closed :)

-žarko

User avatar
Sasha - Tracker Dev Team
User
Posts: 4885
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 » Wed Oct 02, 2019 8:45 am

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

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1983
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 » Wed Oct 02, 2019 6:39 pm

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: 649
Joined: Thu Sep 05, 2019 12:35 pm

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

Post by zarkogajic » Thu Oct 03, 2019 8:32 am

Hi Vasyl,

Great. Eagerly waiting for the next update...

-žarko

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14035
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 » Thu Oct 03, 2019 11:48 am

:D

Post Reply