本文整理汇总了C++中UIElement::InvalidateArrange方法的典型用法代码示例。如果您正苦于以下问题:C++ UIElement::InvalidateArrange方法的具体用法?C++ UIElement::InvalidateArrange怎么用?C++ UIElement::InvalidateArrange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIElement
的用法示例。
在下文中一共展示了UIElement::InvalidateArrange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSize
void PlatformWindowSite::OnSize(gm::RectI r)
{
UIElement* uielement = dynamic_cast<UIElement*>(this);
// Done in OnSizing
#if 0
m_ownerVisual->OnWindowSizeChanged(windowWidth, windowHeight);
#endif
int clientWidth = r.Width;
int clientHeight = r.Height;
#if 0 // Event
m_ownerVisual->OnSize(m_ownerVisual);
#endif
// TODO, not here, like this ??
UIElement* child = GetRootElement();
if (child)
{
/*
m_ownerVisual->set_ActualWidth(windowWidth);
m_ownerVisual->set_ActualHeight(windowHeight);
child->DoLayoutSize(gm::SizeF(clientWidth, clientHeight));
*/
uielement->m_desiredSize = gm::SizeF(clientWidth, clientHeight);
uielement->m_availSize = gm::SizeF(clientWidth, clientHeight);
uielement->InvalidateMeasure();
uielement->InvalidateArrange();
}
}
示例2: OnComputedPropertyValueChanged
void UIElement::OnComputedPropertyValueChanged(PropertyValue* pPropertyVal, bool handled)
{
if (pPropertyVal->m_dp == get_CursorProperty())
{
IRootVisual* root = GetRoot();
if (root)
{
root->ElementSetMouseCursor(this);
}
}
else if (pPropertyVal->m_dp == get_ShadowTreeProperty())
{
if (!handled)
{
UIElement* shadowTree = get_ShadowTree();
if (shadowTree)
{
shadowTree->SetRoot(GetRoot());
shadowTree->set_ParentWindow(get_ParentWindow());
shadowTree->set_Parent(this);
shadowTree->set_TemplatedOwner(this);
InvalidateMeasure();
}
}
}
else if (pPropertyVal->m_dp == get_ParentProperty())
{
UIElement* parent = get_Parent();
if (parent)
{
SetTreeLevel(parent->get_TreeLevel()+1);
parent->InvalidateArrange();
}
else
{
set_TreeLevel(0);
}
}
else if (pPropertyVal->m_dp == get_ParentWindowProperty())
{
Window* parentwindow = get_ParentWindow();
UIElement* shadowTree = get_ShadowTree();
if (shadowTree)
{
shadowTree->set_ParentWindow(parentwindow);
}
size_t nchildren = GetChildrenCount();
for (size_t i = 0; i < nchildren; ++i)
{
Visual* child = GetChild(i);
ASSERT(child);
child->set_ParentWindow(parentwindow);
}
}
else if (pPropertyVal->m_dp == get_TemplatedOwnerProperty())
{
UIElement* owner = get_TemplatedOwner();
size_t nchildren = GetChildrenCount();
for (size_t i = 0; i < nchildren; ++i)
{
Visual* child = GetChild(i);
ASSERT(child);
child->set_TemplatedOwner(owner);
}
}
else if (pPropertyVal->m_dp == get_WidthProperty())
{
InvalidateMeasure();
/*
float minWidth = get_MinWidth();
float width = get_Width();
if (width < minWidth) width = minWidth;
set_ActualWidth(width);
*/
}
else if (pPropertyVal->m_dp == get_HeightProperty())
{
InvalidateMeasure();
/*
float minHeight = get_MinHeight();
float height = get_Height();
if (height < minHeight) height = minHeight;
set_ActualHeight(height);
*/
}
else if (pPropertyVal->m_dp == get_ActualWidthProperty() ||
pPropertyVal->m_dp == get_ActualHeightProperty())
{
//.........这里部分代码省略.........