Page 1 of 1

Force comments pane to dock at bottom

Posted: Wed Aug 02, 2017 10:40 am
by lidds
I am opening the comments docking pane using the below command. I was wondering if there is a way to tell it to dock at the bottom?

Code: Select all

Me.docPreview.ShowPane("commentsView", True)
Thanks

Simon

Re: Force comments pane to dock at bottom

Posted: Fri Aug 04, 2017 7:33 am
by Sasha - Tracker Dev Team
Hello Simon,

I will have to ask a developer who is responsible for this feature, whether this is possible to do via the SDK. Once he replies i will write back.

Cheers,
Alex

Re: Force comments pane to dock at bottom

Posted: Thu Aug 10, 2017 6:35 pm
by Vasyl-Tracker Dev Team
Hi Simon.

Sorry for delay with answer. The working code for your case:

Code: Select all

PDFXEdit.IPXV_Document doc = pdfCtl.Doc;

PDFXEdit.IUIX_Obj pane = doc.ActiveView.CommentsView.Obj;
PDFXEdit.IUIX_Layout layout = doc.ActiveView.Panes.Layout;
PDFXEdit.IUIX_LayoutItem root = layout.Root;

// layout's root element by default contains list of sub-elements with vertical splitters between each one
// firstly we must 'encapsulate' all existing root's children to separate sub-container with the same style with vertical splitters
layout.WrapAllChildrenByNewSubContainer(root, root.Style); 
// currently is safe to change root's style to get horizontal splitters
root.Style = root.Style & (int)~PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_VertSplitters;

// find corresponding layout item for pane and keep some attributes of it
PDFXEdit.IUIX_LayoutItem oldLI = layout.GetItem(pane);
string title = oldLI.Title;
string tooltip = oldLI.Tooltip;
int style = oldLI.Style;

// remove pane from layout
oldLI.Remove();

PDFXEdit.tagSIZE sz;
sz.cx = sz.cy = 200;

// add pane bottom
PDFXEdit.IUIX_LayoutItem newLI = layout.Insert(pane, title, root, ref sz, style);
HTH