Exemplo n.º 1
0
void MainFrame::UpdateFriendsList()
{
	CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(paint_manager_.FindControl(kFriendsListControlName));
	if (pFriendsList != NULL)
	{
		if (!friends_.empty())
			friends_.clear();
		if (pFriendsList->GetCount() > 0)
			pFriendsList->RemoveAll();

		FriendListItemInfo item;

		item.id = _T("0");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("我的好友");

		Node* root_parent = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);

		item.id = _T("1");
		item.folder = false;		
		item.logo = _T("man.png");
		item.nick_name = _T("tojen");
		item.description = _T("*****@*****.**");

		myself_info_ = item;

		pFriendsList->AddNode(item, root_parent);
		friends_.push_back(item);

		item.id = _T("2");
		item.folder = false;
		item.logo = _T("default.png");
		item.nick_name = _T("achellies");
		item.description = _T("*****@*****.**");
		pFriendsList->AddNode(item, root_parent);
		friends_.push_back(item);

        item.id = _T("2");
        item.folder = false;
        item.logo = _T("default.png");
        item.nick_name = _T("wangchyz");
        item.description = _T("*****@*****.**");
        pFriendsList->AddNode(item, root_parent);
        friends_.push_back(item);

        for( int i = 0; i < 100; ++i )
        {
            item.id = _T("2");
            item.folder = false;
            item.logo = _T("default.png");
            item.nick_name = _T("duilib");
            item.description = _T("www.duilib.com");
            pFriendsList->AddNode(item, root_parent);
            friends_.push_back(item);
        }

		item.id = _T("3");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("企业好友");
		Node* root_parent2 = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);

		item.id = _T("4");
		item.folder = false;
		item.logo = _T("icon_home.png");
		item.nick_name = _T("腾讯企业QQ的官方展示号");
		item.description = _T("");
		pFriendsList->AddNode(item, root_parent2);
		friends_.push_back(item);

		item.id = _T("5");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("陌生人");
		Node* root_parent3 = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);


		item.id = _T("6");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("黑名单");
		Node* root_parent4 = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);
	}
}
Exemplo n.º 2
0
void CRichEditWnd::UpdateFriendsList()
{
	CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(GetPaintMgr()->FindControl(_T("LIST_FRIEND")));
	if (pFriendsList != NULL)
	{
		if (!friends_.empty())
			friends_.clear();
		if (pFriendsList->GetCount() > 0)
			pFriendsList->RemoveAll();

		FriendListItemInfo item;

		item.id = _T("0");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("我的好友");

		Node* root_parent = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);

		item.id = _T("1");
		item.folder = false;
		item.logo = _T("user.png");
		item.nick_name = _T("tojen");
		item.description = _T("北国风光,千里冰封,万里雪飘");

		myself_info_ = item;

		pFriendsList->AddNode(item, root_parent);
		friends_.push_back(item);

		item.id = _T("2");
		item.folder = false;
		item.logo = _T("users/175.png");
		item.nick_name = _T("achellies");
		item.description = _T("这个家伙很懒,什么也没留下。。。");
		pFriendsList->AddNode(item, root_parent);
		friends_.push_back(item);

		item.id = _T("3");
		item.folder = false;
		item.logo = _T("users/176.png");
		item.nick_name = _T("wangchyz");
		item.description = _T("*****@*****.**");
		pFriendsList->AddNode(item, root_parent);
		friends_.push_back(item);

		for (int i = 0; i < 100; ++i)
		{
			item.id = CDuiString::FormatString(_T("%d"), 4 + i);
			item.folder = false;
			item.logo = CDuiString::FormatString(_T("users/%d.png"), (int)Math::RangeRandom(175, 264));
			item.nick_name = _T("duilib");
			item.description = _T("www.duilib.com");
			pFriendsList->AddNode(item, root_parent);
			friends_.push_back(item);
		}

		item.id = _T("3");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("企业好友");
		Node* root_parent2 = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);

		item.id = _T("4");
		item.folder = false;
		item.logo = CDuiString::FormatString(_T("users/%d.png"), (int)Math::RangeRandom(175, 264));
		item.nick_name = _T("腾讯企业QQ的官方展示号");
		item.description = _T("");
		pFriendsList->AddNode(item, root_parent2);
		friends_.push_back(item);

		item.id = _T("5");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("陌生人");
		Node* root_parent3 = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);


		item.id = _T("6");
		item.folder = true;
		item.empty = false;
		item.nick_name = _T("黑名单");
		Node* root_parent4 = pFriendsList->AddNode(item, NULL);
		friends_.push_back(item);
	}
}