can anyone show working printing class based on wx.Printout?
not from wiki
···
--
WBR, sector119
can anyone show working printing class based on wx.Printout?
not from wiki
--
WBR, sector119
I have attached a "small" example of a report printout class that uses
line-by-line formatting. If run as a stand-alone module, it creates a short
report to display as an example.
There are several steps in the process.
1. Define a series of Styles that will be applied to the report. (A Style
for this purpose consists of a wxFont object, an alignment constant, and an
indent value.)
2. Define a data structure that consists of a series of tuples made up of
the style name and the text that style should be applied to. Each tuple
defines a "line" in the report, though the text can actually span several
lines on the printed page. (I know, it's confusing terminology. The demo
makes it clearer.)
3. Pass the data structure from Step 2 to the "PrepareData" method. This
converts the data into a specialized structure that represents the content
of each page in the report.
4. Create a "MyPrintout" object based on the objects returned from
PrepareData.
5. Preview or print the MyPrintout object.
I am currently working on coverting this module to something that can print
RTF files. It should only take a few hours to complete, but I've got two
conferences in the next two weeks and it might take me a few weeks to get it
finished.
Hope this helps.
David
ReportPrintout.zip (9.12 KB)
-----Original Message-----
From: Sergei Levchenko [mailto:serg@city.gov.te.ua]
Sent: Tuesday, April 06, 2004 9:20 AM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] can anyone show working printing class based
on wx.Printout
can anyone show working printing class based on wx.Printout?
not from wiki
--
WBR, sector119
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
wxPyPlot has a working print framework as well. It could be an instructive example.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception