mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
reference: Report with Watermark example
git-svn-id: svn://ultimatepp.org/upp/trunk@7408 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5489acfee9
commit
6afde3e8e1
4 changed files with 53 additions and 0 deletions
17
reference/Watermark/Watermark.h
Normal file
17
reference/Watermark/Watermark.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef _Watermark_Watermark_h
|
||||
#define _Watermark_Watermark_h
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <Watermark/Watermark.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
class Watermark : public WithWatermarkLayout<TopWindow> {
|
||||
public:
|
||||
typedef Watermark CLASSNAME;
|
||||
Watermark();
|
||||
};
|
||||
|
||||
#endif
|
||||
13
reference/Watermark/Watermark.upp
Normal file
13
reference/Watermark/Watermark.upp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
description "Demostrates how to add watermark image to Report\377";
|
||||
|
||||
uses
|
||||
CtrlLib,
|
||||
Report;
|
||||
|
||||
file
|
||||
Watermark.h,
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI SSE2";
|
||||
|
||||
5
reference/Watermark/init
Normal file
5
reference/Watermark/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _Watermark_icpp_init_stub
|
||||
#define _Watermark_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#include "Report/init"
|
||||
#endif
|
||||
18
reference/Watermark/main.cpp
Normal file
18
reference/Watermark/main.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <Report/Report.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
void DrawWatermark(Report *report)
|
||||
{ // Draw something to the background
|
||||
report->DrawText(1000, 1000, 3000, "Watermark", Serif(1000), WhiteGray());
|
||||
}
|
||||
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
Report report;
|
||||
report.OnPage(callback1(DrawWatermark, &report)); // called after new page is created
|
||||
for(int i = 0; i < 100; i++)
|
||||
report << "Report with watermark";
|
||||
Perform(report);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue