Automatically docking stamp palette

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

Automatically docking stamp palette

Post by lidds »

I was wondering if there is a way to do the following with the Stamp Palette:

1. Automatically make it dock to the right?
2. Set it maximum zoom out?

Thanks

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

Re: Automatically docking stamp palette

Post by Sasha - Tracker Dev Team »

Hello Simon,

I've asked a developer who is responsible for this to give you a small sample. Once he has a time to do so, we will post it here.

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

Re: Automatically docking stamp palette

Post by lidds »

Thanks Alex,

Much appreciated.

Cheers

Simon
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Automatically docking stamp palette

Post by Vasyl-Tracker Dev Team »

Hi Simon.

Here is piece of code that doing what you want:

Code: Select all

PDFXEdit.IPXV_View stampsView = pdfCtl.Inst.ActiveMainView.Panes.Active[pdfCtl.Inst.Str2ID("stampsView")];
if (stampsView != null)
{
    PDFXEdit.IUIX_Layout layout = pdfCtl.Inst.ActiveMainView.Panes.Layout;
    PDFXEdit.IUIX_LayoutItem stamps = layout.GetItem(stampsView.Obj);
    if (stamps != null)
    {
        PDFXEdit.IUIX_LayoutItem root = layout.Root; // root element of tree-like structure that describes layout of main panes inside frame
        // check if root-element already splits vertically its kids. If not - we must wrap all existing kids by additional container to keep
        // the current layout for them and then modify style of root element
        int st = root.Style;
        if (((st & (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_Splitted) == 0) || ((st & (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_VertSplitters) == 0))
        {
            layout.WrapAllChildrenByNewSubContainer(root, st);
            st = (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_Splitted | (int)PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_VertSplitters;
            root.SetStyle(st, st);
        }
        layout.MoveItem(stamps, root, -1); // dock the stamps palette to the right of control's frame
    }
}
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.
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Automatically docking stamp palette

Post by lidds »

Thank you, this is perfect.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Automatically docking stamp palette

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply