Reuse wxCaret object

Add page break specification
Optimize drawing after character input


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-10-30 17:51:38 +00:00
parent 391bf008a7
commit ea160b2e92
5 changed files with 232 additions and 22 deletions

View File

@@ -80,18 +80,22 @@ void wxRichTextPrintout::OnPreparePrinting()
// child is a paragraph
wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
wxASSERT (child != NULL);
wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst();
while (node2)
{
wxRichTextLine* line = node2->GetData();
// Set the line to the page-adjusted position
line->SetPosition(wxPoint(line->GetPosition().x, line->GetPosition().y - yOffset));
int lineY = child->GetPosition().y + line->GetPosition().y;
if ((lineY + line->GetSize().y) > rect.GetBottom())
// Break the page if either we're going off the bottom, or this paragraph specifies
// an explicit page break
if (((lineY + line->GetSize().y) > rect.GetBottom()) ||
((node2 == child->GetLines().GetFirst()) && child->GetAttributes().HasPageBreak()))
{
// New page starting at this line
int newY = rect.y;