Page 1 of 1

How to minimize the main toolbar

Posted: Tue Jun 04, 2019 5:51 pm
by coblejesse
Hi Alex,

How do you minimize the main toolbar like in the attached pictures?

2019-06-04 13_47_21-Window.png
2019-06-04 13_47_59-Window.png
(11.5 KiB) Not downloaded yet

Re: How to minimize the main toolbar

Posted: Wed Jun 05, 2019 7:26 am
by Sasha - Tracker Dev Team
Hello Jesse,

This method should help:
https://sdkhelp.pdf-xchange.com/vi ... r_Minimize

Cheers,
Alex

Re: How to minimize the main toolbar

Posted: Thu Jun 06, 2019 1:58 pm
by coblejesse
I've tried the minimize method but it's making the whole CmdBar just disappear. Here is my code:

Code: Select all

public void ShowDocViewToolbar()
        {
            IsMainToolBarShowing = true;
            InitialHideMainMenus();
            PDFXEdit.IUIX_Cmd cmd;
            ShowCmdBar(IDS.cmdbar_file, false);
            ShowCmdBar(IDS.cmdbar_menubar, true);
            ShowCmdBar(IDS.cmdbar_standard, false);
            ShowCmdBar(IDS.cmdbar_properties, false);
            ShowCmdBar(IDS.cmdbar_commenting, false);
            ShowCmdBar(IDS.cmdbar_measurement, false);
            ShowCmdBar(IDS.cmdbar_view, false);
            ShowCmdBar(IDS.cmdbar_form, false);

            IsInfoToolBarHidden = true;

            cmd = GetIUIX_Cmd("cmd.view.lockUnlockAllCmdPanes");
            ExecuteIUIX_Cmd(cmd.ID);

            cmd = GetIUIX_Cmd("cmd.view.lockUnlockAllCmdBars");
            ExecuteIUIX_Cmd(cmd.ID);

            PDFXEdit.IUIX_CmdBar cmdBarQuickFind = PDFXEditor.Inst.ActiveMainView.CmdBar["cmdbar.quickFind"]; //Quick Find Bar
            cmdBarQuickFind.Hide();

            cmd = GetIUIX_Cmd("cmd.tool.editContent");
            cmd.Hidden = true;

            IsRightClickContextMenuEnabled = false;
            
            cmd = GetIUIX_Cmd("cmd.find");
            cmd.Hidden = true;


            PDFXEditor.Inst.LockCmdCustomizationEvent();
            uiInst.CmdManager.LockAllPanesUpdates();
            var rect = new tagRECT
            {
                top = 100,
                left = 100
            };

            rect.bottom = rect.top + 25;
            rect.right = rect.left + 100;

            var cusCmdBar = uiInst.CreateCmdBar(PDFXEditor.Inst.ActiveMainView.Obj, rect, "124", "CustomBar");

            var newbox = cusCmdBar.InsertNewBox("Custom");
            newbox.ItemsLowerSize = UIX_CmdItemSize.UIX_CmdItemSize_Small;
            newbox.ItemsIdealSize = UIX_CmdItemSize.UIX_CmdItemSize_Medium;

            cmd = GetIUIX_Cmd("cmd.saveAs");
            cmd.SetTitle(0, "Export Copy As...");
            newbox.InsertItem(cmd, 0);

            cmd = GetIUIX_Cmd("cmd.print");
            newbox.InsertItem(cmd);

            cmd = GetIUIX_Cmd("cmd.zoom.level.actual");
            newbox.InsertItem(cmd);

            cmd = GetIUIX_Cmd("cmd.zoom.level.fitWidth");
            newbox.InsertItem(cmd);

            cmd = GetIUIX_Cmd("cmd.zoom.level.fitPage");
            newbox.InsertItem(cmd);

            cmd = GetIUIX_Cmd("cmd.zoomIn");
            newbox.InsertItem(cmd);

            cmd = GetIUIX_Cmd("cmd.zoomOut");
            newbox.InsertItem(cmd);

            cmd = GetIUIX_Cmd("cmd.search");
            newbox.InsertItem(cmd);

            PDFXEdit.IUIX_CmdBar cmdBarContentEditing = PDFXEditor.Inst.ActiveMainView.CmdBar["cmdbar.contentEditing"]; //Content Editing Bar
            cmdBarContentEditing.Line.InsertBar(cusCmdBar, 0);
            cmdBarContentEditing.DeleteBoxes(0);

            cusCmdBar.Minimize();
            
            uiInst.CmdManager.UnlockAllPanesUpdates();
            PDFXEditor.Inst.UnlockCmdCustomizationEvent();
        }
2019-06-06 09_56_51-Window.png
(9.95 KiB) Not downloaded yet

Re: How to minimize the main toolbar

Posted: Thu Jun 06, 2019 2:09 pm
by coblejesse
Also, this is what it looks like without the cusCmdBar.Minimize();
2019-06-06 10_07_43-Window.png
(11.23 KiB) Not downloaded yet

Re: How to minimize the main toolbar

Posted: Mon Jun 10, 2019 7:08 am
by Sasha - Tracker Dev Team
Hello Jesse,

Have you tried looking into the FullDemo application? There are many samples on how to work with the command bars - probably there is what you are looking for.

Cheers,
Alex

Re: How to minimize the main toolbar

Posted: Mon Jun 10, 2019 8:08 pm
by coblejesse
Alex,

I don't see what I'm looking for in the demo anywhere. I'm guessing the CmdBars are surrounded by something and that's what I need to close. Can you please point me in the right direction?

Thanks

Re: How to minimize the main toolbar

Posted: Tue Jun 11, 2019 9:05 pm
by Vasyl-Tracker Dev Team
Hi Jesse.

Try this one:

Code: Select all

PDFXEdit.IUIX_CmdPane topCmdPane = pdfCtl.Frame.View.CmdPane[PDFXEdit.UIX_CmdPaneSides.UIX_CmdPaneSide_Top];
if (topCmdPane != null)
{
    if (!topCmdPane.IsMinimized)
        topCmdPane.Minimize();
    else
        topCmdPane.Expand();
}
HTH.