Copy link to clipboard
Copied
Hi all,
I’m working on a custom plugin for InDesign using the SDK and am trying to customize the behavior of a 9-grid reference point proxy widget (similar to the one used in the Transform panel). My goal is to display a vertical line spanning the middle column (Top Center, Center, Bottom Center points: 1, 4, 7) when one mode is active ("Height Only"), and a horizontal line spanning the middle row (Center Left, Center, Center Right points: 3, 4, 5) when another mode is active ("Width Only"). Currently, the proxy widget consistently activates only the middle column (1, 4, 7) in both modes, and I can’t get the horizontal line to activate the middle row.
I’m using the IProxyWidgetAttributes interface to set the appearance (e.g., kLine, kRow, or kColumn) and the active position (e.g., kCenterReferencePoint). I’ve implemented a custom method to handle the orientation, but it only works for the vertical (middle column) case. Here’s a generalized version of my approach:
private:
void SetCustomProxyOrientation(const WidgetID& widgetId, bool16 isVertical, const bool16 doEnable) {
do {
InterfacePtr<IPanelControlData> panelControl(this, UseDefaultIID());
InterfacePtr<IControlView> widgetView = panelControl->FindWidget(widgetId);
ASSERT(widgetView);
InterfacePtr<IProxyWidgetAttributes> proxyAttrs(widgetView, UseDefaultIID());
// Set to line appearance with center as anchor
proxyAttrs->SetProxyAppearance(IReferencePointData::kLine);
proxyAttrs->SetProxyPosition(IReferencePointData::kCenterReferencePoint);
// Attempt to adjust orientation
if (isVertical) {
// Vertical alignment (middle column: 1, 4, 7) works fine
// Currently active in both modes
} else {
// Horizontal alignment (middle row: 3, 4, 5) fails, still activates middle column
// Need help to reposition or reorient the line
}
// Notify UI update
InterfacePtr<ISubject> subject(widgetView, UseDefaultIID());
if (subject) {
subject->Change(kWidgetPositionChangedMessage, IID_IPROXYWIDGETATTRIBUTES, widgetView);
}
} while (false);
// Enable/disable the widget
// [EnableWidget logic omitted for brevity]
}
Questions:
I’ve tested this with kLine and kCenterReferencePoint, and the middle column (1, 4, 7) is active in both modes, but I need the middle row (3, 4, 5) for the horizontal case. Any insights, documentation references, or sample approaches to fix the horizontal alignment would be greatly appreciated!
Copy link to clipboard
Copied
There are only so many calls in that interface.
I'd try SetProxyReferenceAngle …
Find more inspiration, events, and resources on the new Adobe Community
Explore Now