本文整理汇总了C++中nsBoxLayoutState::LayoutFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ nsBoxLayoutState::LayoutFlags方法的具体用法?C++ nsBoxLayoutState::LayoutFlags怎么用?C++ nsBoxLayoutState::LayoutFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsBoxLayoutState
的用法示例。
在下文中一共展示了nsBoxLayoutState::LayoutFlags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
NS_IMETHODIMP
nsDeckFrame::DoLayout(nsBoxLayoutState& aState)
{
// Make sure we tweak the state so it does not resize our children.
// We will do that.
uint32_t oldFlags = aState.LayoutFlags();
aState.SetLayoutFlags(NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_VISIBILITY);
// do a normal layout
nsresult rv = nsBoxFrame::DoLayout(aState);
// run though each child. Hide all but the selected one
nsIFrame* box = nsBox::GetChildBox(this);
nscoord count = 0;
while (box)
{
// make collapsed children not show up
if (count != mIndex)
HideBox(box);
box = GetNextBox(box);
count++;
}
aState.SetLayoutFlags(oldFlags);
return rv;
}
示例2: rect
nsresult
nsBox::SyncLayout(nsBoxLayoutState& aState)
{
/*
if (IsCollapsed()) {
CollapseChild(aState, this, true);
return NS_OK;
}
*/
if (GetStateBits() & NS_FRAME_IS_DIRTY)
Redraw(aState);
RemoveStateBits(NS_FRAME_HAS_DIRTY_CHILDREN | NS_FRAME_IS_DIRTY
| NS_FRAME_FIRST_REFLOW | NS_FRAME_IN_REFLOW);
nsPresContext* presContext = aState.PresContext();
uint32_t flags = 0;
GetLayoutFlags(flags);
uint32_t stateFlags = aState.LayoutFlags();
flags |= stateFlags;
nsRect visualOverflow;
if (ComputesOwnOverflowArea()) {
visualOverflow = GetVisualOverflowRect();
}
else {
nsRect rect(nsPoint(0, 0), GetSize());
nsOverflowAreas overflowAreas(rect, rect);
if (!DoesClipChildren() && !IsCollapsed()) {
// See if our child frames caused us to overflow after being laid
// out. If so, store the overflow area. This normally can't happen
// in XUL, but it can happen with the CSS 'outline' property and
// possibly with other exotic stuff (e.g. relatively positioned
// frames in HTML inside XUL).
nsLayoutUtils::UnionChildOverflow(this, overflowAreas);
}
FinishAndStoreOverflow(overflowAreas, GetSize());
visualOverflow = overflowAreas.VisualOverflow();
}
nsIView* view = GetView();
if (view) {
// Make sure the frame's view is properly sized and positioned and has
// things like opacity correct
nsContainerFrame::SyncFrameViewAfterReflow(presContext, this, view,
visualOverflow, flags);
}
return NS_OK;
}
示例3: rect
nsresult
nsBox::SyncLayout(nsBoxLayoutState& aState)
{
/*
PRBool collapsed = PR_FALSE;
IsCollapsed(aState, collapsed);
if (collapsed) {
CollapseChild(aState, this, PR_TRUE);
return NS_OK;
}
*/
if (GetStateBits() & NS_FRAME_IS_DIRTY)
Redraw(aState);
RemoveStateBits(NS_FRAME_HAS_DIRTY_CHILDREN | NS_FRAME_IS_DIRTY
| NS_FRAME_FIRST_REFLOW | NS_FRAME_IN_REFLOW);
nsPresContext* presContext = aState.PresContext();
PRUint32 flags = 0;
GetLayoutFlags(flags);
PRUint32 stateFlags = aState.LayoutFlags();
flags |= stateFlags;
nsRect rect(nsPoint(0, 0), GetSize());
if (ComputesOwnOverflowArea()) {
rect = GetOverflowRect();
}
else {
if (!DoesClipChildren() && !IsCollapsed(aState)) {
// See if our child frames caused us to overflow after being laid
// out. If so, store the overflow area. This normally can't happen
// in XUL, but it can happen with the CSS 'outline' property and
// possibly with other exotic stuff (e.g. relatively positioned
// frames in HTML inside XUL).
nsIFrame* box = GetChildBox();
while (box) {
nsRect bounds = box->GetOverflowRect() + box->GetPosition();
rect.UnionRect(rect, bounds);
box = box->GetNextBox();
}
}
FinishAndStoreOverflow(&rect, GetSize());
}
nsIView* view = GetView();
if (view) {
// Make sure the frame's view is properly sized and positioned and has
// things like opacity correct
nsHTMLContainerFrame::SyncFrameViewAfterReflow(
presContext,
this,
view,
&rect,
flags);
}
return NS_OK;
}