本文整理汇总了C++中Context::GetSkin方法的典型用法代码示例。如果您正苦于以下问题:C++ Context::GetSkin方法的具体用法?C++ Context::GetSkin怎么用?C++ Context::GetSkin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::GetSkin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void Gauge::Draw()
{
const Point activeOffset(GetActiveOffset());
const Point activeArea(GetActiveArea());
Context *c = GetContext();
const Skin &s = c->GetSkin();
s.DrawGaugeBackground(activeOffset, activeArea);
if (m_value > 0.0f) {
s.DrawGaugeMask(activeOffset, activeArea);
const Point size(activeArea.x * m_value, activeArea.y);
switch (m_style) {
case NORMAL:
s.DrawGaugeFillNormal(activeOffset, size);
break;
case WARNING:
s.DrawGaugeFillWarning(activeOffset, size);
break;
case CRITICAL:
s.DrawGaugeFillCritical(activeOffset, size);
break;
}
}
}
示例2: GetContext
List *List::AddOption(const std::string &text)
{
m_options.push_back(text);
Context *c = GetContext();
VBox *vbox = static_cast<VBox*>(m_container->GetInnerWidget());
int index = m_optionBackgrounds.size();
ColorBackground *background = c->ColorBackground(Color(0,0,0, m_selected == index ? c->GetSkin().AlphaSelect_ub() : c->GetSkin().AlphaNormal_ub()));
vbox->PackEnd(background->SetInnerWidget(c->Label(text)));
background->onMouseOver.connect(sigc::bind(sigc::mem_fun(this, &List::HandleOptionMouseOver), index));
background->onMouseOut.connect(sigc::bind(sigc::mem_fun(this, &List::HandleOptionMouseOut), index));
background->onClick.connect(sigc::bind(sigc::mem_fun(this, &List::HandleOptionClick), index));
m_optionBackgrounds.push_back(background);
GetContext()->RequestLayout();
return this;
}