本文整理汇总了C++中nsTableFrame::GetColFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ nsTableFrame::GetColFrame方法的具体用法?C++ nsTableFrame::GetColFrame怎么用?C++ nsTableFrame::GetColFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsTableFrame
的用法示例。
在下文中一共展示了nsTableFrame::GetColFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
nscoord
GetSpaceBetween(PRInt32 aPrevColIndex,
PRInt32 aColIndex,
PRInt32 aColSpan,
nsTableFrame& aTableFrame,
nscoord aCellSpacingX,
bool aIsLeftToRight,
bool aCheckVisibility)
{
nscoord space = 0;
PRInt32 colX;
if (aIsLeftToRight) {
for (colX = aPrevColIndex + 1; aColIndex > colX; colX++) {
bool isCollapsed = false;
if (!aCheckVisibility) {
space += aTableFrame.GetColumnWidth(colX);
}
else {
nsTableColFrame* colFrame = aTableFrame.GetColFrame(colX);
const nsStyleVisibility* colVis = colFrame->GetStyleVisibility();
bool collapseCol = (NS_STYLE_VISIBILITY_COLLAPSE == colVis->mVisible);
nsIFrame* cgFrame = colFrame->GetParent();
const nsStyleVisibility* groupVis = cgFrame->GetStyleVisibility();
bool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE ==
groupVis->mVisible);
isCollapsed = collapseCol || collapseGroup;
if (!isCollapsed)
space += aTableFrame.GetColumnWidth(colX);
}
if (!isCollapsed && aTableFrame.ColumnHasCellSpacingBefore(colX)) {
space += aCellSpacingX;
}
}
}
else {
PRInt32 lastCol = aColIndex + aColSpan - 1;
for (colX = aPrevColIndex - 1; colX > lastCol; colX--) {
bool isCollapsed = false;
if (!aCheckVisibility) {
space += aTableFrame.GetColumnWidth(colX);
}
else {
nsTableColFrame* colFrame = aTableFrame.GetColFrame(colX);
const nsStyleVisibility* colVis = colFrame->GetStyleVisibility();
bool collapseCol = (NS_STYLE_VISIBILITY_COLLAPSE == colVis->mVisible);
nsIFrame* cgFrame = colFrame->GetParent();
const nsStyleVisibility* groupVis = cgFrame->GetStyleVisibility();
bool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE ==
groupVis->mVisible);
isCollapsed = collapseCol || collapseGroup;
if (!isCollapsed)
space += aTableFrame.GetColumnWidth(colX);
}
if (!isCollapsed && aTableFrame.ColumnHasCellSpacingBefore(colX)) {
space += aCellSpacingX;
}
}
}
return space;
}