Page 1 of 1

Need help with the printing sample (wxLua)

Posted: Wed May 01, 2019 11:05 am
by antiker23
Hi@all,

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.

Greets

Re: Need help with the printing sample (wxLua)

Posted: Wed May 01, 2019 7:42 pm
by doublemax
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.