本文整理汇总了C++中CButtonUI::SetBkColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CButtonUI::SetBkColor方法的具体用法?C++ CButtonUI::SetBkColor怎么用?C++ CButtonUI::SetBkColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButtonUI
的用法示例。
在下文中一共展示了CButtonUI::SetBkColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitWindow
void CColorPicker::InitWindow()
{
CVerticalLayoutUI* pColorContiner = static_cast<CVerticalLayoutUI*>(GetPaintMgr()->FindControl(_T("color")));
for (int i = 0; (i < 5) && (pColorContiner != NULL); i ++)
{
CHorizontalLayoutUI* pLine = new CHorizontalLayoutUI();
pLine->SetFixedHeight(12);
pColorContiner->Add(pLine);
for (int j = 0; j < 8; j++)
{
CButtonUI* pOne = new CButtonUI();
pOne->ApplyAttributeList(_T("bordersize=\"1\" bordercolor=\"#FF000000\" width=\"10\" height=\"10\""));
pOne->SetBkColor(Colors[i][j]);
pLine->Add(pOne);
if (i < 7)
{
CControlUI* pMargin = new CControlUI();
pMargin->SetFixedWidth(2);
pLine->Add(pMargin);
}
}
}
SIZE size = GetPaintMgr()->GetInitSize();
MoveWindow( based_point_.x - static_cast<LONG>(size.cx / 2), based_point_.y - size.cy, size.cx, size.cy, FALSE);
}
示例2:
CContainerUI * CScalableLayout::CreateLayout( CScalableNode::Ptr pNode,int nLevel )
{
CContainerUI *pLayout = pNode->IsHor ?
static_cast<CContainerUI*>(new CHorizontalLayoutUI) :
static_cast<CContainerUI*>(new CVerticalLayoutUI);
pLayout->SetBkColor(pNode->BkColor);
for (CScalableNode::Iter i = pNode->ChildBegin();
i != pNode->ChildEnd();
i++)
{
bool bLeaf = true;
for (CScalableNode::Iter j = (*i)->ChildBegin();
j != (*i)->ChildEnd();
j++)
{
if ((*j)->Level == nLevel)
{
bLeaf = false;
break;
}
}
if (bLeaf)
{
CContainerUI *pItemContainer = new CContainerUI;
CButtonUI *pItem = new CButtonUI;
pItem->SetName((*i)->Name);
pItem->SetBkColor((*i)->BkColor);
pItem->SetShowHtml();
pItem->SetTextStyle(DT_CENTER|DT_VCENTER);
CDuiString sText;
if ((*i)->Text.IsEmpty())
{
sText.Format(_T("{p}{c #FFCCCCCC}%s{/c}{/p}"),
(LPCTSTR)(*i)->Description);
}
else
{
sText.Format(_T("{p}%s{n}{c #FFCCCCCC}%s{/c}{/p}"),
(LPCTSTR)(*i)->Text,(LPCTSTR)(*i)->Description);
}
pItem->SetText(sText);
pItemContainer->Add(pItem);
pLayout->Add(pItemContainer);
}
else
{
pLayout->Add(CreateLayout(*i,nLevel));
}
}
if (!pNode->Description.IsEmpty())
{
CVerticalLayoutUI *pWrapper = new CVerticalLayoutUI;
pWrapper->Add(pLayout);
pLayout->SetInset(CDuiRect(5,5,5,0));
CLabelUI *pDescription = new CLabelUI;
pDescription->SetFixedHeight(20);
pDescription->SetTextStyle(DT_CENTER);
pDescription->SetBkColor(pNode->BkColor);
pDescription->SetText(pNode->Description);
pWrapper->Add(pDescription);
return pWrapper;
}
return pLayout;
}