Show properties commandBar

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

Show properties commandBar

Post by lidds »

I am trying to show just the horizontal properties command bar that appears when place items, as shown in the below image:
propBar.png
I am using the following code, but this seems to add the various panes, but not the properties bar

Code: Select all

    Public Sub viewerConfigure()
        Me.docPreview.ShowPane("pageThumbnailsView", True)
        Me.docPreview.ShowPane("commentsView", True)
        Me.docPreview.ShowPane("propertiesView", True)

        Me.docPreview.VisibleCmdPanes = CUInt(PDFXEdit.PXV_VisibleCmdPanes.PXV_VisibleCmdPanes_All)

        ShowCmdBar(IDS.cmdbar_properties, True)
    End Sub

    Private Sub ShowCmdBar(barID As IDS, bShow As Boolean)
        Me.docPreview.Inst.ShowCmdBar2(nIDS(CInt(barID)), bShow)
    End Sub
Thanks in advance

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

Re: Show properties commandBar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Please download a FullDemo application - there is a code that does that.

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

Re: Show properties commandBar

Post by lidds »

Hi Alex,

I know there is the example in the FullDemo of this functionality, I have taken this code into my application and this is the code snippet that I posted. My question is if I am doing something wrong as it should be working the same as in FullDemo??

For example, the below code from my code snippet does not display the main command panes, which I guess it should?

Code: Select all

Me.docPreview.VisibleCmdPanes = CUInt(PDFXEdit.PXV_VisibleCmdPanes.PXV_VisibleCmdPanes_All)
So therefore is there something that you know of that would affect this. I do have another PDF XChange control on this forms midiParent, but I guess that would not affect things??

Thanks

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

Re: Show properties commandBar

Post by Sasha - Tracker Dev Team »

Hello Simon,

There was a problem with the multiple controls and VisibleCmdPanes. This was fixed and the fix will be available from the next release 323. For now, try resetting the settings before each launch - this should help. For this, use this code:

Code: Select all

private void ResetSettings(PDFXEdit.IPXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.settings.reset", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	Op.Do();
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Show properties commandBar

Post by lidds »

Alex,

That seems to have worked. However 2 small questions.

1. How do I hide the "Edit Form" button on the main toolbar? Basically I do not want to display the main toolbar at all, only the properties bar. What is the best way to do this?
2. How can I change the background colour of the menubar to pure white? At the moment I am running the following code, but this does not seem to affect the menubar background colour?

Code: Select all

Dim pr As PDFXEdit.ICabNode = Me.docPreview.Inst.Settings("CustomUI")

        Dim clrArr As PDFXEdit.ICabNode = pr("Colors")
        SetCustColor(clrArr, "base", "rgbd(255,255,255)")
        SetCustColor(clrArr, "face", "rgbd(255,255,255)")
        SetCustColor(clrArr, "window", "rgbd(255,255,255)")
        SetCustColor(clrArr, "main.bg", "rgbd(255,255,255)")
        SetCustColor(clrArr, "dlg.bg", "rgbd(255,255,255)")
        SetCustColor(clrArr, "pg.bg", "rgbd(255,255,255)")
        SetCustColor(clrArr, "hot", "rgbd(205,230,247)")

        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Main.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Main.ShowOverlay").v = False
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Pages.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Pages.ShowOverlay").v = False
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Dialog.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Dialog.ShowOverlay").v = False
Thanks in advance

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

Re: Show properties commandBar

Post by Sasha - Tracker Dev Team »

Hello Simon,

1. Try customizing the toolbars in the End-User Editor to find out which toolbar should be hidden.
2. The logic should be the same as here:
https://www.pdf-xchange.com/forum3 ... 87#p114696

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

Re: Show properties commandBar

Post by lidds »

Alex,

Almost there however for some reason the propertiesBar pane is not turning pure white for some reason. Please see image and code below:
propBarNotWhite.png

Code: Select all

Public Sub viewerConfigure()
        ' Change to single document mode
        Me.docPreview.Inst.Settings("General.AppTitle").v = "Ticodi MarkupInsight"
        Me.docPreview.Inst.Settings("MainFrm.TitleStyle").v = 1

        Dim pr As PDFXEdit.ICabNode = Me.docPreview.Inst.Settings("CustomUI")
        Dim clrArr As PDFXEdit.ICabNode = pr("Colors")
        SetCustColor(clrArr, "base", "rgbd(255,255,255)")
        SetCustColor(clrArr, "face", "rgbd(255,255,255)")
        SetCustColor(clrArr, "window", "rgbd(255,255,255)")
        SetCustColor(clrArr, "main.bg", "rgbd(255,255,255)")
        SetCustColor(clrArr, "dlg.bg", "rgbd(255,255,255)")
        SetCustColor(clrArr, "pg.bg", "rgbd(255,255,255)")
        SetCustColor(clrArr, "hot", "rgbd(205,230,247)")
        SetCustColor(clrArr, "tip", "rgbd(255,255,255)")
        SetCustColor(clrArr, "tip.dark", "rgbd(255,255,255)")
        SetCustColor(clrArr, "tip.light", "rgbd(255,255,255)")

        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Main.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Main.ShowOverlay").v = False
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Pages.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Pages.ShowOverlay").v = False
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Dialog.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Dialog.ShowOverlay").v = False

        uiInst = DirectCast(Me.docPreview.Inst.GetExtension("UIX"), PDFXEdit.IUIX_Inst)
        fsInst = DirectCast(Me.docPreview.Inst.GetExtension("AFS"), PDFXEdit.IAFS_Inst)
        auxInst = DirectCast(Me.docPreview.Inst.GetExtension("AUX"), PDFXEdit.IAUX_Inst)
        pxsInst = DirectCast(Me.docPreview.Inst.GetExtension("PXS"), PDFXEdit.IPXS_Inst)
        pxcInst = DirectCast(Me.docPreview.Inst.GetExtension("PXC"), PDFXEdit.IPXC_Inst)
        ixcInst = DirectCast(Me.docPreview.Inst.GetExtension("IXC"), PDFXEdit.IIXC_Inst)

        Me.docPreview.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_CustomUI)
        Me.docPreview.Inst.Settings("Docs.SingleWnd").v = True
        Me.docPreview.Inst.ActiveMainView.Panes.Layout.Obj.SetStyle(DirectCast(PDFXEdit.UIX_LayoutStyleFlags.UIX_LayoutStyle_Flat, Integer), DirectCast(PDFXEdit.UIX_LayoutStyleFlags.UIX_LayoutStyle_Flat, Integer))
        Me.docPreview.Doc.ActiveView.Panes.Layout.Obj.SetStyle(DirectCast(PDFXEdit.UIX_LayoutStyleFlags.UIX_LayoutStyle_Flat, Integer), DirectCast(PDFXEdit.UIX_LayoutStyleFlags.UIX_LayoutStyle_Flat, Integer))

        Me.docPreview.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Documents)

        ' Open docking panes
        Me.docPreview.ShowPane("pageThumbnailsView", True)
        Me.docPreview.ShowPane("commentsView", True)
        Me.docPreview.ShowPane("propertiesView", True)

        ' Hides menu items from options button at bottom left of designer control
        Dim cmd As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.view.signatures")
        cmd.Hidden = True
        cmd = uiInst.CmdManager.Cmds.Find("cmd.view.fields")
        cmd.Hidden = True
        cmd = uiInst.CmdManager.Cmds.Find("cmd.view.spellCheck")
        cmd.Hidden = True
        cmd = uiInst.CmdManager.Cmds.Find("cmd.docProps")
        cmd.Hidden = True
        cmd = uiInst.CmdManager.Cmds.Find("cmd.comments.summarize")
        cmd.Hidden = True
        cmd = uiInst.CmdManager.Cmds.Find("cmd.thumbnailsView.options")
        cmd.Hidden = True
        cmd = uiInst.CmdManager.Cmds.Find("cmd.launchExternalApp")
        cmd.Hidden = True

        Me.docPreview.VisibleCmdPanes = CUInt(PDFXEdit.PXV_VisibleCmdPanes.PXV_VisibleCmdPanes_All)
        Me.docPreview.LockedCmdPanes = True

        ShowCmdBar(IDS.cmdbar_menubar, False)
        ShowCmdBar(IDS.cmdbar_menubar, False)
        ShowCmdBar(IDS.cmdbar_file, False)
        ShowCmdBar(IDS.cmdbar_standard, False)
        ShowCmdBar(IDS.cmdbar_zoom, False)
        ShowCmdBar(IDS.cmdbar_commenting, False)
        ShowCmdBar(IDS.cmdbar_contentEditing, False)
        ShowCmdBar(IDS.cmdbar_measurement, False)
        ShowCmdBar(IDS.cmdbar_rotateView, False)
        ShowCmdBar(IDS.cmdbar_form, False)
    End Sub
Thanks for all your help.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Show properties commandBar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Apply the same logic to the properties bar.

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

Re: Show properties commandBar

Post by lidds »

Alex,

The problem is that I do not know the corresponding ID to modify the UI

Code: Select all

        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Pages.Style").v = "S"
        Me.docPreview.Inst.Settings("CustomUI.Backgrounds.Pages.ShowOverlay").v = False
I've also tried this, but it does not work

Code: Select all

Me.docPreview.Doc.ActiveView.Panes.Layout.Obj.SetStyle(DirectCast(PDFXEdit.UIX_LayoutStyleFlags.UIX_LayoutStyle_Flat, Integer), DirectCast(PDFXEdit.UIX_LayoutStyleFlags.UIX_LayoutStyle_Flat, Integer))
Thanks
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Show properties commandBar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Well, from what I have debugged there is a problem inside of our logic - I wrote about that to the developer who coded this and will write back as soon as he replies.

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

Re: Show properties commandBar

Post by lidds »

Thanks Alex,

I'll await your response.

Thanks

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

Re: Show properties commandBar

Post by Sasha - Tracker Dev Team »

Hello Simon,

Here's a way to do this, though this will require some manual theme modification. Here's what I mean:
1) Open the Resourced.dat file with zip.
2) There is a Theme.xml file inside that zip that basically holds all of the Editor UI settings.
3) Change this one:

Code: Select all

<brush id="cp.bg" type="linear" color1="id:base.light" color2="id:base.semiDark" point1="0;0" point2="0;H"/>
With this one:

Code: Select all

<brush id="cp.bg" type="solid" color="id:base"/>
4) Save the Theme.xml file and the Resources.dat file.
5) Use the newly modified Resources.dat file in your project

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply