本文整理汇总了C++中GroupCell::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ GroupCell::Draw方法的具体用法?C++ GroupCell::Draw怎么用?C++ GroupCell::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupCell
的用法示例。
在下文中一共展示了GroupCell::Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPrintPage
bool MathPrintout::OnPrintPage(int num)
{
double screenScaleX, screenScaleY;
double ppiScale;
GroupCell* tmp;
wxDC* dc = GetDC();
int marginX, marginY;
GetPageMargins(&marginX, &marginY);
ppiScale = GetPPIScale();
GetScreenScale(&screenScaleX, &screenScaleY);
marginX += SCALE_PX(MC_BASE_INDENT, ppiScale);
dc->SetUserScale(screenScaleX, screenScaleY);
// Go to current page
tmp = (GroupCell *)m_pages[num - 1];
// Print page
if (tmp != NULL)
{
if (tmp->GetGroupType() == GC_TYPE_PAGEBREAK)
tmp = (GroupCell *)tmp->m_next;
if (tmp == NULL)
return true;
wxPoint point;
point.x = marginX;
point.y = marginY + tmp->GetMaxCenter() + GetHeaderHeight();
wxConfigBase* config = wxConfig::Get();
int fontsize = 12;
int drop = tmp->GetMaxDrop();
config->Read(wxT("fontsize"), &fontsize);
PrintHeader(num, dc, ppiScale);
CellParser parser(*dc, ppiScale);
parser.SetIndent(marginX);
while (tmp != NULL && tmp->GetGroupType() != GC_TYPE_PAGEBREAK)
{
tmp->Draw(parser, point, fontsize, false);
if (tmp->m_next != NULL) {
point.x = marginX;
point.y += drop + tmp->m_next->GetMaxCenter();
point.y += SCALE_PX(MC_GROUP_SKIP, ppiScale);
drop = tmp->m_next->GetMaxDrop();
}
tmp = (GroupCell *)tmp->m_next;
if (tmp == NULL || tmp->BreakPageHere())
break;
}
return true;
}
return false;
}
示例2: OnPrintPage
bool MathPrintout::OnPrintPage(int num)
{
double screenScaleX, screenScaleY;
double ppiScale;
GroupCell* tmp;
wxDC* dc = GetDC();
int marginX, marginY;
GetPageMargins(&marginX, &marginY);
ppiScale = GetPPIScale();
GetScreenScale(&screenScaleX, &screenScaleY);
marginX += SCALE_PX(MC_BASE_INDENT, ppiScale);
dc->SetUserScale(screenScaleX, screenScaleY);
// Go to current page
tmp = (GroupCell *)m_pages[num - 1];
// Print page
if (tmp != NULL)
{
if (tmp->GetGroupType() == GC_TYPE_PAGEBREAK)
tmp = (GroupCell *)tmp->m_next;
if (tmp == NULL)
return true;
wxPoint point;
point.x = marginX;
point.y = marginY + tmp->GetMaxCenter() + GetHeaderHeight();
wxConfigBase* config = wxConfig::Get();
int fontsize = 12;
int drop = tmp->GetMaxDrop();
config->Read(wxT("fontsize"), &fontsize);
PrintHeader(num, dc, ppiScale);
CellParser parser(*dc, ppiScale);
parser.SetIndent(marginX);
// Inform the output routines that we are printing
parser.SetPrinter(true);
// Make sure that during print nothing is outside the crop rectangle
MathCell::ClipToDrawRegion(true);
while (tmp != NULL && tmp->GetGroupType() != GC_TYPE_PAGEBREAK)
{
// The following line seems to misteriously fix the "subsequent text
// cells aren't printed" problem on linux.
// No Idea why, though.
dc->SetPen(wxPen(wxT("light grey"), 1, wxPENSTYLE_SOLID));
tmp->Draw(point, fontsize);
if (tmp->m_next != NULL) {
point.x = marginX;
point.y += drop + tmp->m_next->GetMaxCenter();
point.y += SCALE_PX(MC_GROUP_SKIP, ppiScale);
drop = tmp->m_next->GetMaxDrop();
}
tmp = (GroupCell *)tmp->m_next;
if (tmp == NULL || tmp->BreakPageHere())
break;
}
MathCell::ClipToDrawRegion(false);
return true;
}
MathCell::ClipToDrawRegion(false);
return false;
}