Page 1 of 1

Retain panel position

Posted: Tue Oct 26, 2010 11:50 am
by Bryan641
It's nice that when I don't lock a panel in place I can move it at run-time. But when I click the submit button and the panel is redisplayed, it goes back to its original position. How can I have it retain its position?

I tried binding the window TOP and LEFT to variables, but when I set them, the contents don't appear within the window, and the variables aren't returning the current position values when the submit button is pressed.

--Bryan

Re: Retain panel position

Posted: Wed Oct 27, 2010 12:47 pm
by David
You're on the right track with top and left.

However, I think you have bound the wrong top and left properties to the RPG fields. You've probably done this on the panel widget, causing it to be shifted relative to ths screen, causing the content to appear outside the panel.

What you want to do is instead bind to the "window top" and "window left" properties which are at the record format level.

Using these will correctly cause the entire record format (panel, fields, and all) to be offset using the values fed in through RPG.

This will allow you to control where the window appears correctly, but unfortunatley it still won't "stick" where the user moved it because the "window top" and "window left" properties are not updated and sent back to RPG. So, your program will send the old values back, causing the window to go back to it's original position.

We do plan to make these fields update and submit back to RPG in a future release. This would allow the window to "stick" properly.

I would recommend setting up the binding as described -- that way when the update is available your windows will start working the way you want them to.

Re: Retain panel position

Posted: Wed Oct 27, 2010 1:01 pm
by Bryan641
Thanks for the info.

Re: Retain panel position

Posted: Wed Oct 27, 2010 1:51 pm
by Alex
Some good news... in our upcoming update, the "window top" and "window left" values will be sent back to the appropriate RPG variables when you move the window.