Introduction
If you have an idea to further manipulate a Snapper's property and not use the green CoreProperty UI, double-clicking the Snapper and having a custom Dialog Window pop up and show a custom
An introduction to Place a Dialog Window that follows a snapper in your View Space. The key to this placement is to get access to the View.
Example
Assuming that the Dialog is required only in 3D, the following code snippet explains the process for placing the Dialog next to your Snapper on the screen. This example uses selected()
and places this in Fika's panel snapper (FOPanelFrame
):
public void selected() { View vw = activeView3D(); if (vw as View3D) { // Get the View position relative to the screen for the Window. pointI screenPos = vw.toScreen(center3D()); pointI viewPos = vw.window.toScreen(vw.window.pos); pointI windowPos = screenPos + viewPos; // Create and place Dialog Window. DialogWindow dialog(winActiveWindow, size=sizeI(200, 140)); dialog.at(windowPos.x, windowPos.y); } }
Comments
0 comments
Please sign in to leave a comment.