本文整理汇总了C++中nsIFrame::GetStyleMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ nsIFrame::GetStyleMargin方法的具体用法?C++ nsIFrame::GetStyleMargin怎么用?C++ nsIFrame::GetStyleMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsIFrame
的用法示例。
在下文中一共展示了nsIFrame::GetStyleMargin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: autoSpaceManager
//.........这里部分代码省略.........
reflowContent = PR_TRUE;
} else {
if (reflowContent) {
reflowContent = mContentFrame ?
(mContentFrame->GetStateBits()
& (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0 : PR_FALSE;
}
if (reflowLegend) {
reflowLegend = mLegendFrame ?
(mLegendFrame->GetStateBits()
& (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0 : PR_FALSE;
}
}
}
// availSize could have unconstrained values, don't perform any addition on them
nsSize availSize(aReflowState.mComputedWidth, aReflowState.availableHeight);
// get our border and padding
const nsMargin &borderPadding = aReflowState.mComputedBorderPadding;
const nsMargin &padding = aReflowState.mComputedPadding;
nsMargin border = borderPadding - padding;
if (aDesiredSize.mComputeMEW) {
aDesiredSize.mMaxElementWidth = borderPadding.left + borderPadding.right;
}
// Figure out how big the legend is if there is one.
// get the legend's margin
nsMargin legendMargin(0,0,0,0);
// reflow the legend only if needed
if (mLegendFrame) {
const nsStyleMargin* marginStyle = mLegendFrame->GetStyleMargin();
marginStyle->GetMargin(legendMargin);
if (reflowLegend) {
nsHTMLReflowState legendReflowState(aPresContext, aReflowState,
mLegendFrame, nsSize(NS_INTRINSICSIZE,NS_INTRINSICSIZE),
reason);
// always give the legend as much size as it needs
legendReflowState.mComputedWidth = NS_INTRINSICSIZE;
legendReflowState.mComputedHeight = NS_INTRINSICSIZE;
nsHTMLReflowMetrics legendDesiredSize(0,0);
ReflowChild(mLegendFrame, aPresContext, legendDesiredSize, legendReflowState,
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
#ifdef NOISY_REFLOW
printf(" returned (%d, %d)\n", legendDesiredSize.width, legendDesiredSize.height);
if (legendDesiredSize.mComputeMEW)
printf(" and maxEW %d\n",
legendDesiredSize.mMaxElementWidth);
#endif
// figure out the legend's rectangle
mLegendRect.width = legendDesiredSize.width + legendMargin.left + legendMargin.right;
mLegendRect.height = legendDesiredSize.height + legendMargin.top + legendMargin.bottom;
mLegendRect.x = borderPadding.left;
mLegendRect.y = 0;
nscoord oldSpace = mLegendSpace;
mLegendSpace = 0;
if (mLegendRect.height > border.top) {
// center the border on the legend
mLegendSpace = mLegendRect.height - border.top;