本文整理汇总了C++中core::Element::GetBox方法的典型用法代码示例。如果您正苦于以下问题:C++ Element::GetBox方法的具体用法?C++ Element::GetBox怎么用?C++ Element::GetBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::Element
的用法示例。
在下文中一共展示了Element::GetBox方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
void ElementDataGrid::ProcessEvent(Core::Event& event)
{
Core::Element::ProcessEvent(event);
if (event == "columnadd")
{
if (event.GetTargetElement() == this)
{
root->RefreshRows();
DirtyLayout();
}
}
else if (event == "resize")
{
if (event.GetTargetElement() == this)
{
// commented this out because this bugs selection on overflowed
// datagrids contained within another overflowed element
//SetScrollTop(GetScrollHeight() - GetClientHeight());
for (int i = 0; i < header->GetNumChildren(); i++)
{
Core::Element* child = header->GetChild(i);
columns[i].current_width = child->GetBox().GetSize(Core::Box::MARGIN).x;
}
}
}
}
示例2: ProcessEvent
void ElementDataGrid::ProcessEvent(Core::Event& event)
{
Core::Element::ProcessEvent(event);
if (event == "columnadd")
{
if (event.GetTargetElement() == this)
{
root->RefreshRows();
DirtyLayout();
}
}
else if (event == "resize")
{
if (event.GetTargetElement() == this)
{
SetScrollTop(GetScrollHeight() - GetClientHeight());
for (int i = 0; i < header->GetNumChildren(); i++)
{
Core::Element* child = header->GetChild(i);
columns[i].current_width = child->GetBox().GetSize(Core::Box::MARGIN).x;
}
}
}
}
示例3: Render
// Renders any debug elements in the debug context.
void Plugin::Render()
{
// Render the outlines of the debug context's elements.
if (render_outlines &&
debug_context != NULL)
{
for (int i = 0; i < debug_context->GetNumDocuments(); ++i)
{
Core::ElementDocument* document = debug_context->GetDocument(i);
if (document->GetId().Find("rkt-debug-") == 0)
continue;
std::stack< Core::Element* > element_stack;
element_stack.push(document);
while (!element_stack.empty())
{
Core::Element* element = element_stack.top();
element_stack.pop();
if (element->IsVisible())
{
for (int j = 0; j < element->GetNumBoxes(); ++j)
{
const Core::Box& box = element->GetBox(j);
Geometry::RenderOutline(element->GetAbsoluteOffset(Core::Box::BORDER) + box.GetPosition(Core::Box::BORDER), box.GetSize(Core::Box::BORDER), Core::Colourb(255, 0, 0, 128), 1);
}
for (int j = 0; j < element->GetNumChildren(); ++j)
element_stack.push(element->GetChild(j));
}
}
}
}
// Render the info element's boxes.
if (info_element != NULL &&
info_element->IsVisible())
{
info_element->RenderHoverElement();
info_element->RenderSourceElement();
}
}