Recent

Author Topic: Form: size and location on program start  (Read 6929 times)

pjensen

  • New member
  • *
  • Posts: 7
Form: size and location on program start
« on: July 29, 2007, 12:46:57 am »
Hi,

on linux / KDE one can change the size and the location (x,y) of an programm. On the next start of the program, it starts with the last used size and location.

Is this possible with lazarus? If yes how?

Regards, Peter
OpenSuse 10.2 --- KDE --- Lazarus 0.9.22 beta with gtk1

antitu

  • Newbie
  • Posts: 5
Window positions
« Reply #1 on: July 30, 2007, 12:38:10 am »
Howdy.

If you're asking about your application that you've created in lazarus, you can save out the window positions (left, top, width, height) to a config file.  Read the config file when the app launches and plug the config file values into the form's tRect.

If you're asking about the lazarus environment...  I never got them to stick by way of lazarus configuration.  You mentioned KDE, which is what I use, and there is a way to have KDE take care of saving window positions:

1) Right click on the title bar of the window.
2) Click Advanced -> Special Window Settings *
3) If needed, click the Geometry tab.
4) Enable Position and Size, selecting Remember from the drop down list.
5) Click Ok and repeat for each of the windows you'd like to have in the same spot.

* You can also try Special Application Settings but I never got it to work for all of the dialog/tool windows.

-Adam

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Window positions
« Reply #2 on: July 30, 2007, 11:43:02 am »
I think you can use this component to achieve that:

http://wiki.lazarus.freepascal.org/TXMLPropStorage

pjensen

  • New member
  • *
  • Posts: 7
Form: size and location on program start
« Reply #3 on: July 31, 2007, 09:21:20 am »
thanks to both answers.

the txmlprostorage was eaxctly what i was looking for.  :)

peter
OpenSuse 10.2 --- KDE --- Lazarus 0.9.22 beta with gtk1

 

TinyPortal © 2005-2018