本文整理汇总了C++中UIControl::SetParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ UIControl::SetParameter方法的具体用法?C++ UIControl::SetParameter怎么用?C++ UIControl::SetParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIControl
的用法示例。
在下文中一共展示了UIControl::SetParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UIControlTabPage
bool UIControlTab::SetParameter(const wstring& _key, const ParamValue& _value)
{
if (L"addpage" == _key)
{
const ParamUIHandle& param = dynamic_cast<const ParamUIHandle&>(_value);
UIControl* page = new UIControlTabPage(this->m_ui, this->m_ui.NewHandle(), NULL);
if (false != this->SetParameter(L"addchild", ParamControlPtr(page)))
{
if (UIControl* control = this->m_ui.GetControl(param.Get()))
{
wstring name;
ParamWString nameparam(name);
if ((false != (control->GetParameter(L"name", nameparam)))
&& (false != (page->SetParameter(L"name", nameparam)))
&& (false != page->SetParameter(L"addchild", ParamControlPtr(control)))
&& (false != control->SetParameter(L"parent", ParamControlPtr(page))))
{
this->m_pages.push_back(page);
return true;
}
}
}
delete page;
return false;
}
else if (L"headerlocation" == _key)
{
const ParamWString& param = dynamic_cast<const ParamWString&>(_value);
const wstring headerlocation = param.Get();
if (L"left" == headerlocation)
{
this->m_headerlocation = HL_LEFT;
return true;
}
else if (L"right" == headerlocation)
{
this->m_headerlocation = HL_RIGHT;
return true;
}
else if (L"top" == headerlocation)
{
this->m_headerlocation = HL_TOP;
return true;
}
else if (L"bottom" == headerlocation)
{
this->m_headerlocation = HL_BOTTOM;
return true;
}
return false;
}
return UIControl::SetParameter(_key, _value);
}
示例2: Update
void UIControlTab::Update()
{
if (false != this->m_visible)
{
this->UpdateDirty();
this->UpdateHeaders();
if (this->m_currentpageindex < this->m_pages.size())
{
UIControl* page = this->m_pages[this->m_currentpageindex];
page->SetParameter(L"position", ParamPoint(D2D1::Point2F(this->m_startingpagepos.m_x, this->m_startingpagepos.m_y)));
page->SetParameter(L"size", ParamSize(D2D1::SizeF(this->m_pagesize.m_width, this->m_pagesize.m_height)));
page->Update();
}
}
}