Automatically docking stamp palette

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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: 417
Joined: Sat May 16, 2009 1:55 pm

Automatically docking stamp palette

Post by lidds » Mon Feb 26, 2018 11:11 am

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

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

Re: Automatically docking stamp palette

Post by Sasha - Tracker Dev Team » Wed Feb 28, 2018 7:26 am

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

lidds
User
Posts: 417
Joined: Sat May 16, 2009 1:55 pm

Re: Automatically docking stamp palette

Post by lidds » Wed Feb 28, 2018 10:25 am

Thanks Alex,

Much appreciated.

Cheers

Simon

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

Re: Automatically docking stamp palette

Post by Vasyl-Tracker Dev Team » Thu Mar 01, 2018 2:07 am

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: 417
Joined: Sat May 16, 2009 1:55 pm

Re: Automatically docking stamp palette

Post by lidds » Thu Mar 01, 2018 1:14 pm

Thank you, this is perfect.

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

Re: Automatically docking stamp palette

Post by Sasha - Tracker Dev Team » Thu Mar 01, 2018 1:22 pm

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply