本文整理汇总了C++中CTreeNode::GetCascadedposition方法的典型用法代码示例。如果您正苦于以下问题:C++ CTreeNode::GetCascadedposition方法的具体用法?C++ CTreeNode::GetCascadedposition怎么用?C++ CTreeNode::GetCascadedposition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTreeNode
的用法示例。
在下文中一共展示了CTreeNode::GetCascadedposition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Fmt
// This function is a callback from LineServices (the pfnFmt callback)
// Line services calls this to get the formattnig information for
// a non-text object in the layout, i.e. an image or a table or a div.
// We create a dobj and give it back to LS here.
// This is like a dobj constructor.
LSERR WINAPI CEmbeddedILSObj::Fmt(/*[in]*/PCFMTIN pfmtin, /*[out]*/FMTRES* pfmtres)
{
LSTRACE(Fmt);
BOOL fOwnLine;
INT xMinWidth;
LONG cchSite;
LONG xWidth, yHeight;
OBJDIM objdim;
stylePosition bPositionType;
LSERR lserr = lserrNone;
CLineServices* pLS = _pLS;
CFlowLayout* pFlowLayout = pLS->_pFlowLayout;
PLSRUN plsrun = PLSRUN(pfmtin->lsfrun.plsrun);
CLayout* pLayout = plsrun->GetLayout(pFlowLayout);
CElement* pElementLayout;
CTreeNode* pNodeLayout;
const CCharFormat* pCF;
const CFancyFormat* pFF;
CEmbeddedDobj* pdobj = new CEmbeddedDobj(this, pfmtin->plsdnTop);
if(!pdobj)
{
lserr = lserrOutOfMemory;
goto Cleanup;
}
// pLayout is the guy we're being asked to format here.
Assert(pLayout && pLayout!=pFlowLayout);
pElementLayout = pLayout->ElementOwner();
pNodeLayout = pElementLayout->GetFirstBranch();
pCF = pNodeLayout->GetCharFormat();
pFF = pNodeLayout->GetFancyFormat();
bPositionType = pNodeLayout->GetCascadedposition();
// for overlapping layouts curtail the range of characters measured
cchSite = pLS->GetNestedElementCch(pElementLayout);
ZeroMemory(&objdim, sizeof(OBJDIM));
// Let's see if this an 'ownline' thingy. Note that even if the element
// is not by default and 'ownline' element, we may have morphed it into
// one -- then too it has to be a block element. If it is not one (like
// a span, then it will not live on its own line). Check here.
fOwnLine = pLS->IsOwnLineSite(plsrun);
Assert(pElementLayout->IsInlinedElement());
// Certain sites that only Microsoft supports can break with any
// characters, so we hack that in right here.
// BUGBUG (cthrash) This is goofy. We should have a better way to
// determine this than checking tag types.
pdobj->_fIsBreakingSite= pElementLayout->Tag()==ETAG_OBJECT
|| pElementLayout->Tag()==ETAG_MARQUEE
// This is really unfortunate -- if a site is percent sized then it becomes a breaking
// site inside table cells. This is primarily for IE4x compat. See IE bug 42336 (SujalP)
|| pFF->_cuvWidth.GetUnitType()==CUnitValue::UNIT_PERCENT
// One last thing - if we have a morphed non-ownline element inside
// a table, it's considered a breaking site.
|| (!fOwnLine && !pElementLayout->_fSite);
// If it's on its own line, and not first on line, FetchRun should have
// terminated the line before we got here.
// Assert( !( fOwnLine && !pfmtin->lsfgi.fFirstOnLine) );
pFlowLayout->GetSiteWidth(pLayout, pLS->_pci,
pLS->_lsMode==CLineServices::LSMODE_MEASURER,
pLS->_xWrappingWidth,
&xWidth, &yHeight, &xMinWidth);
// v-Dimension computed in VerticalAlignObjects
// BUGBUG (cthrash) We have rounding errors in LS; don't pass zero
objdim.heightsRef.dvAscent = 1;
objdim.heightsRef.dvDescent = 0;
objdim.heightsRef.dvMultiLineHeight = 1;
if(_pLS->_fMinMaxPass)
{
objdim.heightsPres = objdim.heightsRef;
}
if(pLS->_fIsRuby && !pLS->_fIsRubyText)
{
pLS->_yMaxHeightForRubyBase = max(pLS->_yMaxHeightForRubyBase, yHeight);
}
// We need to store two widths in the dobj: The width corresponding to
// the wrapping width (urColumnMax) and the minimum width. LsGetMinDur,
// however, does not recognize two widths for ILS objects. We therefore
// cache the difference, and account for these in an enumeration callback
// after the LsGetMinDur pass.
if(!pLS->_fMinMaxPass)
{
pdobj->_dvMinMaxDelta = 0;
objdim.dur = xWidth;
}
//.........这里部分代码省略.........