Hi. I'd like to see a command that could move a window relative to the display size. That is, if I want to move a window to the center of my display, the command might look like:
win << Move Window Relative(0.5, 0.5)
If the user has multiple displays, the command would assume the current display is being used.
Currently, if I want my script to center a window:
1. Create a dummy window that is assumed to be larger than any display (10k x 10k).
2. Get the resulting window's actual size. This is assumed to be the size of the user's display.
3. Close this window.
4. Now create the intended window and get its size.
5. Compute the desired new window upper-left corner coordinates using the display size and window size.
6. Move the new window using the << Move Window command.
I find that it helps to improve the users' experiences with the tools I'm developing if my windows always appear in the same place when they use it, rather than changing locations each time. Not being able to predict the users' display sizes necessitates the steps above however.
Hi @nikles , Danke für deinen Vorschlag! Wir haben Ihre Anfrage erfasst und werden sie berücksichtigen.
@nikles that is a clever way to get the display size. I would just add to this that it would be nice to have a command to learn the display size and also that it can be complicated if the user has more than one screen. Ability to learn the relevant info about any screens and use it locate a window would be great.
@hardner Danke! Ich habe festgestellt, dass meine Methode die Größe des Bildschirms ermittelt, auf dem JMP ursprünglich geöffnet wurde. Wenn der Benutzer also mehrere Bildschirme hat (wie ich) und die Fenster auf den anderen Bildschirm verschiebt, geht meine Methode immer noch vom ursprünglichen Bildschirm aus. Das ist ärgerlich, aber beherrschbar. Ja, ich stimme zu, es wäre schön, einen integrierten Befehl zu haben, der dies automatisch erledigt.