Beispiel #1
0
wxListItemAttr* NickListCtrl::GetItemAttr(long item) const
{
	if (item > -1 && item < (long)m_data.size() && m_data[item]) {
		const User& u = *m_data[item];
		wxString name = TowxString(u.GetNick());
		return HighlightItemUser(name);
	}
	return NULL;
}
wxListItemAttr * BattleroomListCtrl::GetItemAttr(long item) const
{
    if ( item == -1 || item >= (long)m_data.size())
        return NULL;

    const User& user = *GetDataFromIndex( item );
    bool is_bot = user.BattleStatus().IsBot();

    if ( !is_bot ) {
        return HighlightItemUser( user.GetNick() );
    }

    return NULL;
}
Beispiel #3
0
wxListItemAttr* BattleListCtrl::GetItemAttr(long item) const
{
    if ( item < (long)m_data.size() && item > -1 ) {
        const IBattle& b = *m_data[item];
        try
        {
					wxString host = b.GetFounder().GetNick();
					wxListItemAttr* attr = HighlightItemUser( host );
					if ( attr != NULL )
							return attr;

					//to avoid color flicker check first if highlighting should be done
					//and return if it should
					for ( unsigned int i = 0; i < b.GetNumUsers(); ++i){
							wxString name = b.GetUser(i).GetNick();
							attr = HighlightItemUser( name );
							if ( attr != NULL )
									return attr;

					}
				}catch(...){}
    }
    return NULL;
}