The International Simutrans Forum

 

Author Topic: [patch] Windows properties storage  (Read 3284 times)

0 Members and 1 Guest are viewing this topic.

Offline swed

  • *
  • Posts: 33
  • Languages: EN, FR
[patch] Windows properties storage
« on: June 27, 2010, 09:21:10 AM »
Hello,

Here is a patch I use to save my windows positions and sizes.

To enable properties storage, just add enable_winprop_storage("xxxx") in the window constructor (like i did in message_frame_t.cc for the example).
The parameter is a window ID, to identify it in the file (4length, lowercase).

How it works :
Startup = simuwins.tab is read in tabfile_obj
Win Destroy = properties stored in tabfile_obj
Win Create = properties restored from tabfile_obj
Quit = simuwins.tab overwrited with tabfile_obj content

See ya,
Marc.

Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: [patch] Windows properties storage
« Reply #1 on: June 27, 2010, 09:32:29 AM »
Nice idea :)

Offline swed

  • *
  • Posts: 33
  • Languages: EN, FR
Re: [patch] Windows properties storage
« Reply #2 on: June 29, 2010, 11:57:27 AM »
I'm asking myself how can we make that usefull for everyone.

I think it would be nice if, during game, the user can say :
- I want to save the ACTUAL position and size of THIS window
- I want to save the ACTUAL size of THIS window, but not the position (for 'multi instance' windows)
- I don't want to save no more properties of THIS window

But, how interact with the user ?
- A button on the window bar is not a good way (almost 'never used' button)
- Shortcuts are not a good way too, in my opinion.
- A context menu, opening on windowbar right-click should be great, but there is nothing like that yet.

So, I don't know how...

Is that an intersting functionality (may not be) ?
Do you have any suggestion ?

Bye.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10662
  • Languages: De,EN,JP
Re: [patch] Windows properties storage
« Reply #3 on: February 02, 2012, 10:42:08 PM »
During network games the windows actually save their position and content. Not sure how to continue with this.