Re: Problem printing text with wxWidgets 3.2.2.1

Fulvio Senore <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Il 15/09/2023 14:36, Vadim Zeitlin ha scritto:
> On Fri, 15 Sep 2023 10:19:11 +0200 Fulvio Senore wrote:
> 
> FS> Anyway, I was thinking of this class of a simple way to print simple
> FS> documents, mainly text-based. Just think of a report. In this case it
> FS> ought to be enough to support text, some simple graphic primitives and
> FS> images in a few standard formats.
> 
>   Unfortunately I don't think you can define the boundaries of "simple".
> Even the simplest reports may want to embed a logo, so now you also need to
> allow printing bitmaps. And you need lines to draw around tables. And so
> on.
> 
> FS> This is surely a good idea. We could also add a function to get the wxDC.
> 
>   I do think we need to keep using wxDC, it's just everything else (i.e.
> page setup mostly, I think) that it would be nice to simplify.
> 

I had an idea to make things simpler to code and keep them reasonably 
simple for users.
My first goal is to hide wxPrintout that makes things rather complicated.

We could create a printing class with a Print() method to start printing 
and a virtual PrintPage() method to be implemented by descendant classes.
When printing this class could create a wxPrintout and the 
wxPrintout::PrintPage() function could call the same function in the new 
class.

The user's code is almost surely inside a class: just derive the user's 
class from the printing class, add the PrintPage() implementation and 
call the Print() method.

This is just a quick explanation: feel free to ask for mere details.

Do you think that this could be a good idea?

Regards

Fulvio

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/eb238e1c-b2dd-4940-99b4-f69f3932bad2%40fsoft.it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.