I am now implementing a reordering/reparenting functionality for CEED C++ and I have a couple of suggestions:
1. In a current CEGUI, if you add a child anywhere except layout containers, the child is added to the end of the list. It makes sense, but I suggest to add CEGUI::Window::moveChildToIndex() and/or CEGUI::Window::addChildToIndex() methods. This will allow CEED users to explicitly reorder windows inside a parent for whatever reasons they have. It can be a convenience (group elements by function or sort alfabetically) or even an optimization, if order of children matters in some operations (like searching).
2. Let's replace Idx with Index in method names. We definitely can afford 2 more letters and it improves readability.
3. GridLayoutContainer has an auto-positioning feature that turned to be more pain than convenience. For example, removing a child from a full GLC and then adding it back (undo) causes a crash because GLC thinks it has no room for this child. Actually there are more problems. I suggest to drop auto-positioning in favour of a simple insertion scenario:
Code: Select all
addChildToCell(x, y)
Code: Select all
addChildToIndex(i)
Code: Select all
addChild()
Also a helper public method is offered:
Code: Select all
getFirstFreeCell(startCell, bool rowMajor)
This interface is expected to be more stable and predictable.
4. We also may add auto-grow feature to GLC. When it is full it can allocate a new row or column based on AutoPositioning(Majority) property. Auto-grow may be controlled with a bool property.