/************************************************************************ Sort list ************************************************************************/ void ItemListBase::sortList(bool relayout) { std::sort(d_listItems.begin(), d_listItems.end(), getRealSortCallback()); if (relayout) { layoutItemWidgets(); } }
/************************************************************************ Perform child window layout ************************************************************************/ void ItemListBase::performChildWindowLayout(void) { Window::performChildWindowLayout(); // if we are not currently initialising if (!d_initialising) { // Redo the item layout. // We don't just call handleUpdateItemData, as that could trigger a resize, // which is not what is being requested. // It would also cause infinite recursion... so lets just avoid that :) layoutItemWidgets(); } }
/************************************************************************* Handler called internally when the list contents are changed *************************************************************************/ void ItemListBase::onListContentsChanged(WindowEventArgs& e) { // if we are not currently initialising we might have things todo if (!d_initialising) { invalidate(); // if auto resize is enabled - do it if (d_autoResize) sizeToContent(); // resort list if requested and enabled if (d_resort && d_sortEnabled) sortList(false); d_resort = false; // redo the item layout and fire our event layoutItemWidgets(); fireEvent(EventListContentsChanged, e, EventNamespace); } }
void PopupMenu::onParentSized(WindowEventArgs& e) { MenuBase::onParentSized( e ); layoutItemWidgets(); }