mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Report: WhenPage
git-svn-id: svn://ultimatepp.org/upp/trunk@6578 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
27d2f55f9f
commit
ba3baa6cbd
2 changed files with 16 additions and 16 deletions
|
|
@ -51,15 +51,23 @@ void Report::PaintHF(Draw& w, int y, const char *qtf, int i)
|
|||
txt.Paint(w, 0, y, GetSize().cx);
|
||||
}
|
||||
|
||||
void Report::Flush()
|
||||
{
|
||||
if(pagei >= 0) {
|
||||
Drawing dw = GetResult();
|
||||
page.At(pagei).Append(dw);
|
||||
Create(GetSize());
|
||||
}
|
||||
}
|
||||
|
||||
void Report::StartPage(int i)
|
||||
{
|
||||
DrawingDraw dw;
|
||||
PaintHF(dw, 0, header, i);
|
||||
PaintHF(dw, GetSize().cy - footercy, footer, i);
|
||||
Drawing& g = page.At(i);
|
||||
g = dw;
|
||||
g.SetSize(GetSize());
|
||||
DrawingDraw dw(GetSize());
|
||||
page.At(i) = dw;
|
||||
Create(GetSize());
|
||||
WhenPage();
|
||||
PaintHF(*this, 0, header, i);
|
||||
PaintHF(*this, GetSize().cy - footercy, footer, i);
|
||||
y = GetPageRect().top;
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +80,6 @@ Draw& Report::Page(int i)
|
|||
while(page.GetCount() <= pagei)
|
||||
StartPage(page.GetCount());
|
||||
y = GetPageRect().top;
|
||||
Create(GetSize());
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
|
@ -127,15 +134,6 @@ void Report::RestartPage()
|
|||
StartPage(pagei);
|
||||
}
|
||||
|
||||
void Report::Flush()
|
||||
{
|
||||
if(pagei >= 0) {
|
||||
Drawing dw = GetResult();
|
||||
page.At(pagei).Append(dw);
|
||||
Create(GetSize());
|
||||
}
|
||||
}
|
||||
|
||||
Report& Report::Landscape()
|
||||
{
|
||||
Size sz = GetSize();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ private:
|
|||
void RestartPage();
|
||||
|
||||
public:
|
||||
Callback WhenPage;
|
||||
|
||||
int GetCount() { Flush(); return page.GetCount(); }
|
||||
Drawing GetPage(int i) { Flush(); return page[i]; }
|
||||
Drawing operator[](int i) { return GetPage(i); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue