R – Progress ABL: How to have windows open in same position on the screen as they opened last time

openedgeprogress-4gl

We currently use this logic to center every new window:

ASSIGN {&WINDOW-NAME}:X =
(SESSION:WIDTH-PIXELS – {&WINDOW-NAME}:WIDTH-PIXELS) / 2
{&WINDOW-NAME}:Y =
(SESSION:HEIGHT-PIXELS – {&WINDOW-NAME}:HEIGHT-PIXELS) / 2.

However, the user want to position the window in a certain place. When they close the window and reopen the window later, they want it to appear in the same place they left it.

If I remove the above code, the new window appears randomly on the screen.

Using:
Windows XP
Progress Openedge 10.1C01

Best Answer

You need to record the X & Y position that the user moves it to and use that information to re-open it at that position the next time they start.

You could record the position at shutdown but that leaves the possibility of an abnormal shutdown not remembering. That might be what you want or it might not be.

Or you could detect moves and record the new position then. You'd probably want to use MOUSE-MOVE-UP.

Related Topic