本文整理汇总了C++中ToolBar::set_pseudo_class方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolBar::set_pseudo_class方法的具体用法?C++ ToolBar::set_pseudo_class怎么用?C++ ToolBar::set_pseudo_class使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolBar
的用法示例。
在下文中一共展示了ToolBar::set_pseudo_class方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_resized
void ToolBar_Impl::on_resized()
{
Rect rect = toolbar->get_geometry();
int rect_width = rect.get_width();
int rect_height = rect.get_height();
if ( (rect_width > 0) && (rect_height > 0) ) // Only update if the geometry is valid
{
bool old_horiz = toolbar->get_pseudo_class("horizontal");
horizontal = (rect_width >= rect_height);
if (old_horiz != horizontal)
{
if (horizontal)
toolbar->set_pseudo_class("horizontal", true);
else
toolbar->set_pseudo_class("vertical", true);
}
need_layout_update = true;
}
}
示例2: create_parts
void ToolBar_Impl::create_parts()
{
toolbar->set_pseudo_class(CssStr::horizontal, true);
part_item_normal = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
part_item_normal.set_pseudo_class(CssStr::normal, true);
part_item_disabled = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
part_item_disabled.set_pseudo_class(CssStr::disabled, true);
part_item_pressed = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
part_item_pressed.set_pseudo_class(CssStr::pressed, true);
part_item_hot = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
part_item_hot.set_pseudo_class(CssStr::hover, true);
part_item_on = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
part_item_on.set_pseudo_class(CssStr::on, true);
size_icon.width = part_item_normal.get_property_int(CssStr::icon_width, "0");
size_icon.height = part_item_normal.get_property_int(CssStr::icon_height, "0");
std::string str_alignment = toolbar->get_property(CssStr::layout, "left");
if (str_alignment == "center")
layout = layout_center;
else
layout = layout_left;
need_layout_update = true;
}