Need help with the printing sample (wxLua)

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
In need of some credit
In need of some credit
Posts: 1
Joined: Wed May 01, 2019 10:19 am

Need help with the printing sample (wxLua)

Post by antiker23 » Wed May 01, 2019 11:05 am

[email protected],

in my app there is a wxDialog window and it is something like a form that you can fill out with some wxStaticText and wxTextCtrl controls etc. On the bottom of this dialog page there is a button called "print form". The goal is it to print out the form that someone has filled out before.

My first step was it to modify the default printing sample so it can print the complete content of this wxDialog window. The problem is that the default printing sample is using a paint DC with these circles and so on. All my attempts to adapt to my needs failed. (i never used printing output functionality in my apps)

It would be really great if someone could rewrite the default sample (link) so that it prints a wxdialog window so that i can learn how it works.

Big Thanks in advance for your help.


User avatar
Posts: 15654
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Need help with the printing sample (wxLua)

Post by doublemax » Wed May 01, 2019 7:42 pm

There is no easy way to just transfer a GUI built with standard controls to a printer output. You have to draw everything onto a wxDC.

If you know some HTML, you should try wxHtmlEasyPrinting, that's definitely much easier than drawing all texts directly onto a wxDC (because you'll need to do all coordinate calculations yourself). It seems there is no wxLua sample that shows how to use wxHtmlEasyPrinting, so you'll have to check the C++ documentation and sample for that.
Use the source, Luke!

Post Reply