Skip to main content
Topic: [patch] Sticky windows implementation (Read 2862 times) previous topic - next topic

[patch] Sticky windows implementation

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.

Re: [patch] Sticky windows implementation

Reply #1
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.

Re: [patch] Sticky windows implementation

Reply #2
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.

 

Re: [patch] Sticky windows implementation

Reply #3
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!

Re: [patch] Sticky windows implementation

Reply #4
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.

Re: [patch] Sticky windows implementation

Reply #5
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.

Re: [patch] Sticky windows implementation

Reply #6
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.

Re: [patch] Sticky windows implementation

Reply #7
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.

Re: [patch] Sticky windows implementation

Reply #8
Ok, after some heavy modification: Added to SVN