mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
*Report: Fixed refresh issue
git-svn-id: svn://ultimatepp.org/upp/trunk@4973 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c8fd518d7e
commit
167e0dd45d
3 changed files with 723 additions and 719 deletions
1427
uppsrc/Core/Http.cpp
1427
uppsrc/Core/Http.cpp
File diff suppressed because it is too large
Load diff
|
|
@ -109,6 +109,7 @@ public:
|
|||
ReportView& Numbers(bool nums) { numbers = nums; Refresh(); return *this; }
|
||||
|
||||
void Set(Report& report);
|
||||
Report *Get() { return report; }
|
||||
int GetFirst() const { return sb / pagesize.cy * pvn; }
|
||||
|
||||
void ScrollInto(int toppage, int top, int bottompage, int bottom);
|
||||
|
|
@ -123,6 +124,7 @@ class ReportWindow : public WithReportWindowLayout<TopWindow> {
|
|||
void Numbers() { pg.Numbers(numbers); }
|
||||
void GoPage() { sw <<= ReportView::PG1; Pages(); }
|
||||
void Pdf();
|
||||
void ShowPage();
|
||||
|
||||
Array<Button> button;
|
||||
Report *report;
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ ReportWindow::ReportWindow()
|
|||
pg.WhenGoPage = THISBACK(GoPage);
|
||||
lbl.SetFont(Arial(20).Italic());
|
||||
lbl.SetAlign(ALIGN_CENTER);
|
||||
pg.WhenAction = Breaker(-1);
|
||||
pg.WhenAction = THISBACK(ShowPage);
|
||||
Sizeable();
|
||||
MaximizeBox();
|
||||
Icon(CtrlImg::smallreporticon());
|
||||
|
|
@ -247,6 +247,12 @@ void ReportWindow::SetButton(int i, const char *label, int id)
|
|||
AddChildBefore(&button[i], &cancel);
|
||||
}
|
||||
|
||||
void ReportWindow::ShowPage()
|
||||
{
|
||||
if(pg.Get())
|
||||
lbl = Format("%d / %d", pg.GetFirst() + 1, pg.Get()->GetCount());
|
||||
}
|
||||
|
||||
int ReportWindow::Perform(Report& report, int zoom, const char *caption)
|
||||
{
|
||||
this->report = &report;
|
||||
|
|
@ -261,11 +267,8 @@ int ReportWindow::Perform(Report& report, int zoom, const char *caption)
|
|||
ActiveFocus(pg);
|
||||
Title(caption);
|
||||
Open();
|
||||
int n = -1;
|
||||
for(;;) {
|
||||
int nn = pg.GetFirst() + 1;
|
||||
if(n != nn)
|
||||
lbl = Format("%d / %d", n = nn, report.GetCount());
|
||||
ShowPage();
|
||||
int c = Run();
|
||||
switch(c) {
|
||||
case IDCANCEL:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue