Hide tab close button on document bar

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
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Hide tab close button on document bar

Post by lidds »

Is there a way to hide the close tab button on the multi document bar. Not the close tab button that exists on the tab itself, I can hide this, I am talking about the one shown in the image below?
tabCloseButton.png
tabCloseButton.png (2.55 KiB) Viewed 2060 times
Thanks

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

Re: Hide tab close button on document bar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Same code, only with UIX_LayoutItemStyle_CloseActiveTabBtn

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Hide tab close button on document bar

Post by lidds »

Alex,

I have tried the following but it is still showing the close button

Code: Select all

Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(1).View.DocViewsArea.Panes.Layout
            layout.Root(0).SetStyle(CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn), CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn))
Any ideas? Does this have to be called after opening each document or something?

Thanks

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

Re: Hide tab close button on document bar

Post by Sasha - Tracker Dev Team »

Hello Simon,

If I remember correctly, I already told this one before, though I will duplicate it again - yes, you should use that code in the e.document.viewingStarted event.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Hide tab close button on document bar

Post by lidds »

Alex,

I have also tried this under the viewingStarted event, however it still appears.

Please see image below of test within the FullDemo project:
fullDemoCloseTab.png
Using the below code:

Code: Select all

else if (e.nEventID == nIDS[(int)IDS.e_document_viewingStarted])
            {
                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);
                    layout.Root[0].SetStyle(Convert.ToInt32(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn), Convert.ToInt32(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn));
            }
Thanks

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

Re: Hide tab close button on document bar

Post by Sasha - Tracker Dev Team »

Hello Simon,

First of all that's one nice if clause - expect a crash soon.
Second, you have added the Close Active Tab Button not removed it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Hide tab close button on document bar

Post by lidds »

Thanks for the update, let's get back to VB where I am more comfortable.

I have tried the following, but this does not work, obviously I am doing something wrong?

Code: Select all

        ElseIf e.nEventID = nIDS(CInt(IDS.e_document_viewingStarted)) Then
            Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(1).View.DocViewsArea.Panes.Layout

            For Each docLayout As PDFXEdit.IUIX_LayoutItem In layout.Root
                docLayout.SetStyle(CInt(False), CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn))
            Next
Thanks

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

Re: Hide tab close button on document bar

Post by Sasha - Tracker Dev Team »

Hello Simon,

We've put this into the schedule list and will look at it when we have time.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Hide tab close button on document bar

Post by lidds »

Alex,

A bit more information. I am running the following code.

These lines work as expected:

layout.Root(0).SetStyle(False, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_AddNewTabBtn))
layout.Root(0).SetStyle(True, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_HideCloseTabsBtn))

These lines seem to have no affect:

layout.Root(0).SetStyle(True, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoFloat))
layout.Root(0).SetStyle(True, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_TabsNoReorder))
layout.Root(0).SetStyle(False, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn))

Code: Select all

        ElseIf e.nEventID = nIDS(CInt(IDS.e_document_viewingStarted)) Then
            Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(1).View.DocViewsArea.Panes.Layout

            For Each docLayout As PDFXEdit.IUIX_LayoutItem In layout.Root
                layout.Root(0).SetStyle(False, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_AddNewTabBtn))
                layout.Root(0).SetStyle(True, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_HideCloseTabsBtn))
                layout.Root(0).SetStyle(True, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoFloat))
                layout.Root(0).SetStyle(True, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_TabsNoReorder))
                layout.Root(0).SetStyle(False, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_CloseActiveTabBtn))
            Next
Really hoping for a fix on this as this could cause errors in my tool.

Thanks

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

Re: Hide tab close button on document bar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Are you testing this on VB.Net or VB6?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Hide tab close button on document bar

Post by lidds »

Alex,

.NET

Thanks

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

Re: Hide tab close button on document bar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Everything's working on our side:
^C5175398C94AB99FBD07535D869C2926479F01B8F315B5B25B^pimgpsh_fullsize_distr.png
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply