Re[2]: Problem printing text with wxWidgets 3.2.2.1
Vadim Zeitlin <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 13 Sep 2023 22:28:08 +0200 Fulvio Senore wrote:
FS> I did not express myself well enough, sorry. When I asked "How should I
FS> discuss and design this code?" I was thinking at the tools to use: this
FS> mailing list, the wx-dev one or something else. I was also thinking at
FS> the procedures to follow.
Ah, sorry for misunderstanding you. The wx-dev list is probably the best
place for something like this.
FS> Create a class to encapsulate a print job. Add methods to start the job,
FS> write text and some graphics primitives, to start a new page and to end
FS> the job starting the real printing process.
FS>
FS> All method calls are stored in memory until the job is ended, then real
FS> printing begins. A printout is created and all the commands are
FS> retrieved from memory ed executed in the printout.
FS>
FS> This ought to shield the user from the complexity of printing,
FS> presenting a very simple interface.
FS>
FS> Do you think that this is a reasonable approach?
AFAICS this means reimplementing Windows metafiles in wxWidgets or, at
least, something very similar to it, and this is not easy to do at all and
all but impossible to do efficiently at our level.
I think we need to keep the idea of having some function called with wxDC
parameter and rendering onto it. But it could be a callback instead of a
virtual function, e.g. a std::function<void (int page, wxDC&)> or something
like this.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCZQIekAAKCRAG6kHeT2we humSAKCgNQcmzVaru7EFrX3a4Gs1Rh0TlwCeKMVGEazlJ+n9KZVOTC2jSXH//IE= =5PSh -----END PGP SIGNATURE-----