本文整理汇总了C++中Cell::GetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ Cell::GetWidth方法的具体用法?C++ Cell::GetWidth怎么用?C++ Cell::GetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell::GetWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMaxPoint
void Emfout::GetMaxPoint(int *width, int *height)
{
Cell *tmp = m_tree;
int currentHeight = 0;
int currentWidth = 0;
*width = 0;
*height = 0;
bool bigSkip = false;
bool firstCell = true;
while (tmp != NULL)
{
if (!tmp->m_isBrokenIntoLines)
{
if (tmp->BreakLineHere() || firstCell)
{
firstCell = false;
currentHeight += tmp->GetMaxHeight();
if (bigSkip)
currentHeight += MC_LINE_SKIP;
*height = currentHeight;
currentWidth = tmp->GetWidth();
*width = MAX(currentWidth, *width);
}
else
{
currentWidth += (tmp->GetWidth());
*width = MAX(currentWidth, *width);
}
bigSkip = tmp->m_bigSkip;
}
tmp = tmp->m_nextToDraw;
}
}
示例2: BreakLines
void Emfout::BreakLines()
{
int fullWidth = 500;
int currentWidth = 0;
Cell *tmp = m_tree;
while (tmp != NULL)
{
if (!tmp->m_isBrokenIntoLines)
{
tmp->SoftLineBreak(false);
tmp->ResetData();
if (tmp->BreakLineHere() ||
(currentWidth + tmp->GetWidth() >= fullWidth))
{
currentWidth = tmp->GetWidth();
tmp->SoftLineBreak(true);
}
else
currentWidth += (tmp->GetWidth());
}
tmp = tmp->m_nextToDraw;
}
}
示例3: Draw
void Emfout::Draw()
{
Cell *tmp = m_tree;
if (tmp != NULL)
{
wxPoint point;
point.x = 0;
point.y = tmp->GetMaxCenter();
int fontsize = 12;
int drop = tmp->GetMaxDrop();
wxConfig::Get()->Read(wxT("fontSize"), &fontsize);
int mfontsize = fontsize;
wxConfig::Get()->Read(wxT("mathfontsize"), &mfontsize);
while (tmp != NULL)
{
if (!tmp->m_isBrokenIntoLines)
{
tmp->Draw(point);
if ((tmp->m_next != NULL) && (tmp->m_next->BreakLineHere()))
{
point.x = 0;
point.y += drop + tmp->m_next->GetMaxCenter();
if (tmp->m_bigSkip)
point.y += MC_LINE_SKIP;
drop = tmp->m_next->GetMaxDrop();
}
else
point.x += (tmp->GetWidth());
}
else
{
if ((tmp->m_next != NULL) && (tmp->m_next->BreakLineHere()))
{
point.x = 0;
point.y += drop + tmp->m_next->GetMaxCenter();
if (tmp->m_bigSkip)
point.y += MC_LINE_SKIP;
drop = tmp->m_next->GetMaxDrop();
}
}
tmp = tmp->m_nextToDraw;
}
}
}
示例4: BreakUpCells
void Emfout::BreakUpCells()
{
Cell *tmp = m_tree;
int fontsize = 12;
wxConfig::Get()->Read(wxT("fontSize"), &fontsize);
int mfontsize = fontsize;
wxConfig::Get()->Read(wxT("mathfontsize"), &mfontsize);
while (tmp != NULL)
{
if (tmp->GetWidth() > 500)
{
if (tmp->BreakUp())
{
tmp->RecalculateWidths(tmp->IsMath() ? mfontsize : fontsize);
tmp->RecalculateHeight(tmp->IsMath() ? mfontsize : fontsize);
}
}
tmp = tmp->m_nextToDraw;
}
}