示例#1
0
/************************************************************************
    Sort list
************************************************************************/
void ItemListBase::sortList(bool relayout)
{
    std::sort(d_listItems.begin(), d_listItems.end(), getRealSortCallback());
    if (relayout)
    {
        layoutItemWidgets();
    }
}
示例#2
0
/************************************************************************
	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();
	}
}
示例#3
0
/*************************************************************************
	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);
	}
}
示例#4
0
void PopupMenu::onParentSized(WindowEventArgs& e)
{
	MenuBase::onParentSized( e );
	layoutItemWidgets();
}