本文整理汇总了C++中CContainerUI::SetTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::SetTag方法的具体用法?C++ CContainerUI::SetTag怎么用?C++ CContainerUI::SetTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::SetTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddNode
bool CBookClient::AddNode(BOOK_INFO *item)
{
if (item == NULL) return false;
BOOK_INFO *node = new BOOK_INFO;
node->strName = item->strName;
node->nImage = item->nImage;
node->strPath = item->strPath;
node->nBookmark = item->nBookmark;
CContainerUI* pDesk = NULL;
if( !m_dlgBuilder.GetMarkup()->IsValid() )
{
pDesk = static_cast<CContainerUI*>(m_dlgBuilder.Create(_T("iBook.xml"), (UINT)0, NULL, &m_pm));
}
else
{
pDesk = static_cast<CContainerUI*>(m_dlgBuilder.Create((UINT)0, &m_pm));
}
if( pDesk != NULL )
{
this->Add(pDesk);
CButtonUI* btn = static_cast<CButtonUI*>(m_pm.FindSubControlByName(pDesk, _T("btnBookEx")));
CLabelUI *text = static_cast<CLabelUI*>(m_pm.FindSubControlByName(pDesk, _T("labelBookEx")));
CButtonUI *btnEdit = static_cast<CButtonUI*>(m_pm.FindSubControlByName(pDesk, _T("btnbookdel")));
if (btn == NULL || text == NULL || btnEdit == NULL) return false;
CDuiString strImage;
strImage.Format(_T("book\\%02d.png"), node->nImage);
btn->SetBkImage(strImage);
text->SetText(node->strName);
btnEdit->SetVisible(m_bEdit);
pDesk->SetTag((UINT_PTR)node);
}
else
{
delete node;
node = NULL;
return false;
}
return true;
}
示例2: AddComboboxItem
void CMainDialog::AddComboboxItem()
{
CComboUI* pcbx2 = static_cast <CComboUI*> (m_pm.FindControl(_T("combo2")));
assert (pcbx2);
if (pcbx2) {
CDialogBuilder builder;
CContainerUI* pItem = static_cast <CContainerUI*> (builder.Create(_T("comboitem.xml"), 0));
pItem->GetItemAt(0)->SetBkImage(_T ("icon_home.png"));
if (pcbx2->GetCount() % 2 == 0) {
pItem->GetItemAt(1)->SetText(_T ("百度一下,你就知道了"));
pItem->GetItemAt(2)->SetText(_T ("http://www.baidu.com"));
}
else {
pItem->GetItemAt(1)->SetText(_T ("360搜索 - 干净、安全、可信任的搜索引擎"));
pItem->GetItemAt(2)->SetText(_T ("http://www.so.com/"));
}
pItem->SetTag(pcbx2->GetCount());
pItem->OnEvent += MakeDelegate (this, &CMainDialog::OnClickItem);
pcbx2->Add(pItem);
}
}