How to minimize the main toolbar

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
coblejesse
User
Posts: 34
Joined: Thu May 16, 2019 7:44 pm

How to minimize the main toolbar

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to minimize the main toolbar

Post by Sasha - Tracker Dev Team »

Hello Jesse,

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

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
coblejesse
User
Posts: 34
Joined: Thu May 16, 2019 7:44 pm

Re: How to minimize the main toolbar

Post 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
coblejesse
User
Posts: 34
Joined: Thu May 16, 2019 7:44 pm

Re: How to minimize the main toolbar

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to minimize the main toolbar

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
coblejesse
User
Posts: 34
Joined: Thu May 16, 2019 7:44 pm

Re: How to minimize the main toolbar

Post 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
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: How to minimize the main toolbar

Post 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.
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.
Post Reply