Author Topic: Window titles  (Read 361 times)

0 Members and 1 Guest are viewing this topic.

Offline hreintke

Window titles
« on: April 12, 2017, 04:21:49 PM »
I have a number of local additions in my environment and like to make some updates to the window titles of factories and halts.
(in this case adding "area" information to factories & halts)

F.e the texts in the attached pictures :

Papierfabriek Mechelen (48,272) -> Papierfabriek Mechelen (48,272), Area 0
Mechelen buiten halte (58,300) -> Mechelen buiten halte (58,300), Area 4

But I cannot find the location in the code where these texts are generated.
Anyone can point me to the location ?

Offline TurfIt

Re: Window titles
« Reply #1 on: April 12, 2017, 04:31:53 PM »
It's being set in the info windows contructor to the name of the halt. (and doesn't appear to be updated when the halt is renamed...)
   ./gui/halt_info.cc:93 -> gui_frame_t( halt->get_name(), ...

For an example of updating the Window title upon renaming see:
   ./gui/fabrik_info.cc:279 -> fabrik_info_t::update_info()

Similar would work for what you want, but:
   Papierfabriek Mechelen, Area 0   (48,272)    should be relatively trivial (depending on where the area info comes from...)
   Papierfabriek Mechelen (48,272), Area 0      would require much more significant changes.

Offline hreintke

Re: Window titles
« Reply #2 on: April 12, 2017, 09:46:02 PM »
Thanks,

Didn't see it before because I was looking for a concatenation of name and position.

Now checking the options I see now
- Adding it to the gui_frame_t name -> need to do for each window type
- Updating the koord::get_fullstr() -> will get into the (xxx,yyy) part -> generic solution, but need to check whether this has side effects
- Updating it to the location where the (xxx,yyy) is added to the title -> do you know where that is done.

On updating on changing name :
Sometimes it is updated directly when editing, sometimes only after finished updating.
Can't figure out (yet) what causes the yes/no updating