News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[patch] Sticky windows implementation

Started by swed, June 19, 2010, 03:23:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

swed

Hello guys,

I need sticky windows, and i heard a lot of people asking for that.
By clicking a new button on the window bar, you can stuck/unstuck each window :
-Backspace close all windows except those which are stuck
-Escape close current window, even if its stuck

So I did ;
Here are the patches for the sticky windows. (3 files, but minor modifications).

I think the only thing left todo is modifying the skins.dat and skins.png to have a nice button image ;
But i'm really not a graphist :)

What do you think about that ?
Thanks for your answers.

See ya,
Marc.

prissi

If we need to change skin.dat, I would also suggest introduction of skinned scroll bars ... So I put it here until at least a good graphic for the default skin.

Great addition.

knightly

Just a minor suggestion :) How about using "sticky" consistently in your code instead of "stuck"? Or, if you prefer, "stickied", which is usually used for sticky forums topics.

VS

Good idea, since in our local lingo: sticky = at the top, stuck = problems ;) For example "vehicles stuck in a traffic jam"...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

swed

Hello,
Thanks for your answers.

Here is what I did today :
- modified 'stuck' to 'sticky' in code (I'm not very good in english...)
- modified skins.png and skins.dat to get the new pin icon
- modified gui_button.cc/h to get rid of hard-coded get_bild values

My new sticky button looks nice now, with a pin icon ;)
Here is the complete patch, in attachment.

Pleaz, let me know what you think about that.
Thanks.

See ya,
Marc.

jamespetts

I like this idea! Help texts will need updating, though.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

swed

Note : For the new button icon, we need to increment by 1 all get_bild values (using vars from gui_button.h).

For example : window_skin->get_bild(10)->get_nummer();
Modified in : window_skin->get_bild(icon_right_normal)->get_nummer();

In those files :
vehikelbauer.cc
citylist_stats_t.cc
curiositylist_stats_t.cc
fahrplan_gui.cc
factorylist_stats_t.cc
labellist_stats_t.cc
message_stats_t.cc

See ya,
Marc.

prissi

Changing button numbers in skin.dat is a nono, otherwise many paks will cease working at once. Adding to the end is the only compatible way to do.

On a further note: Please use "SVN DIFF" to avoid getting lots of single patch files.

prissi

Ok, after some heavy modification: Added to SVN