Change parent on UI widgets

Bug #546799 reported by Raul Ferriz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Wishlist
Unassigned

Bug Description

It would be really cool to add void set_parent(Panel *nparent) to UI::Panel and needed descendants. With this feature would be really easy reuse diffrents panels throught buildings.

For example: with this addition I could develop only one panel to show soldiers on ms, ts and hq very shortly.

Tags: ui widget
Changed in widelands:
importance: High → Medium
Changed in widelands:
importance: Medium → Wishlist
Revision history for this message
Victor Pelt (victor-pelt) wrote :

so why can't you just redraw the panels?

Revision history for this message
Victor Pelt (victor-pelt) wrote :

answer (from irc, my interpretation): avoid code duplicantion. having different building types do the same thing

Revision history for this message
Raul Ferriz (raul.ferriz) wrote :

Yes, this bug is arised developing bug 536583.
What I want to achieve is:
1) headquarter_window inherits from warehouse_window
2) on creation of headquarter_window, call creator of warehouse_window
3) create a tabpanel (tp) and two boxes (wh_box and ms_box) inside
4) move all allready created items on headquarter_window but tp to wh_box (for every widget, widget->set_parent(wh_box))
5) create ms stuff on ms_box

Even better, if this is fixed, all visualization code between ts, ms, and hq could be shared reducing bugs and source lines to debug.

Revision history for this message
Raul Ferriz (raul.ferriz) wrote :

I have found another solution, seems to be far easier to implement and do not have disadvantages of memleaks.

Changed in widelands:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.