I am trying to show a formInDialog in a particular place on the screen based on the location of element. I can account for the window position of the main window in case the user has moved the window, and I can add the width of my controller to the X position, but the presence or non-presence of toolbars is messing up my Y position.
Is there some way to get the screen location of an element, not just its form location?
var x = elements.test.getLocationX();
var y = elements.test.getLocationY();
var point = new java.awt.Point(x,y);
Packages.javax.swing.SwingUtilities.convertPointToScreen(point,elements.test);
Too advanced for me. I’ll have to become much more fluent in Java before things like this make sense to me. No worries, though since I already found a way around my immediate problem.
to the tools plugin. Will be available later this week
you can do this:
//calculate the new x coordinate of the dialog
var x = plugins.it2be_tools.getScreenX(elements.button) - elements.button.getLocationX();
//calculate the new y coordinate of the dialog
var y = plugins.it2be_tools.getScreenY(elements.button) + elements.button.getHeight() - elements.button.getLocationY();
application.showFormInDialog( forms.test2, x, y, -1, -1, ‘Test’, false,false,true);