本文整理汇总了C++中HTMLDocument::ScrollToDefaultAnchor方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLDocument::ScrollToDefaultAnchor方法的具体用法?C++ HTMLDocument::ScrollToDefaultAnchor怎么用?C++ HTMLDocument::ScrollToDefaultAnchor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLDocument
的用法示例。
在下文中一共展示了HTMLDocument::ScrollToDefaultAnchor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Format
//.........这里部分代码省略.........
// check to see if we just need to update positioned child formatting
if (mFlowFlags & (FD_FLAG_FLOW_CHILD_STYLE_MODIFIED|
FD_FLAG_LOCAL_STYLE_MODIFIED|
FD_FLAG_PARENT_STYLE_MODIFIED))
{
DISPLAY_INT iContentWidth;
MarginContext margin (marginLeftValue + paddingLeftValue,
viewportWidth - (marginRightValue + paddingRightValue) - 1, this);
// Format the flow content
miContentHeight = FormatFlowContent (&margin,
marginLeftValue + paddingLeftValue,
marginTopValue + paddingTopValue, &iContentWidth);
// update miContentHeight to include anything in the margins
DISPLAY_INT topPad = marginTopValue + paddingTopValue;
DISPLAY_INT clearedHeight = margin.ClearAll(topPad + miContentHeight) - topPad;
if (clearedHeight > miContentHeight)
{
miContentHeight = clearedHeight;
}
// set this element's height
UpdateHeight(0, 0);
}
// Format positioned elements
FormatContextFactory childContextFactory;
if (mPositionedChildFormatContext)
{
WebRect oldRect;
mPositionedChildFormatContext->getContainingBlock(&oldRect);
if (!oldRect.Equals(&rect) ||
miContentHeight != mPositionedChildFormatContext->getAutoIndentTop())
{
mPositionedChildFormatContext->release();
mPositionedChildFormatContext = 0;
}
}
WEBC_BOOL reformatPositionedChildren = (mFlowFlags & FD_FLAG_POS_CHILD_STYLE_MODIFIED) != 0;
if (!mPositionedChildFormatContext)
{
mPositionedChildFormatContext = childContextFactory.newPositioned (
&rect, // containingBlock,
WEBC_FALSE, // parentHeightIsAuto,
TU_DIR_LTR, // textDirection,
0, // parentBorderLeft,
0, // parentBorderTop,
0, // parentBorderRight,
0, // parentBorderBottom,
marginLeftValue, // autoIndentLeft,
miContentHeight, // autoIndentTop,
marginRightValue // autoIndentRight
);
reformatPositionedChildren = (mPositionedChildFormatContext != WEBC_NULL);
}
if (reformatPositionedChildren)
{
HTMLFlowDisplayFormatContext formatCtx;
BeginFormatPositionedChildren(&formatCtx);
FormatPositionedChildren (
mPositionedChildFormatContext,
mPositionedChildFormatContext,
&childContextFactory
);
EndFormatPositionedChildren(&formatCtx);
}
mFlowFlags &= ~(FD_FLAG_POS_CHILD_STYLE_MODIFIED|
FD_FLAG_FLOW_CHILD_STYLE_MODIFIED|
FD_FLAG_LOCAL_STYLE_MODIFIED|
FD_FLAG_PARENT_STYLE_MODIFIED);
}
WEBC_ASSERT(!NeedsFormat());
// handles the case where HTMLDocument::ScrollToAnchor is called before the
// document's content has been formatted.
if (mpHtmlElement)
{
HTMLDocument* document = mpHtmlElement->GetDocument();
if (document)
{
document->ScrollToDefaultAnchor();
document->SetQueuedFocus();
}
}
WEBC_DEBUG_LOG_TIME_EXIT(TimeInside,"HTMLBodyDisplay::Format", " ")
}
}