enable "print current page" in wxPrintDialogData

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

enable "print current page" in wxPrintDialogData

Post by mael15 »

hi,
how can i enable the "current page" option in a print dialog?
currentPage.gif
currentPage.gif (17.08 KiB) Viewed 1054 times
i could not find a wxPrintDialogData::Enable...(bool) function like with all the other options.
thank you!
ebyrob
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Sep 28, 2016 8:27 pm

Re: enable "print current page" in wxPrintDialogData

Post by ebyrob »

This is years late, but:

Apparently wxWidgets uses PrintDlg() to show the print dialog, but only PrintDlgEx() can support "current page" selection.

In wxWidgets version 3.1.0.0 this is in src\msw\printdlg.cpp line 755:

Code: Select all

int wxWindowsPrintDialog::ShowModal()
{
    // ...
    bool ret = (PrintDlg( pd ) != 0);
    // ...
}
I've been trying to figure out if there is a way to get the desired behavior just using PringDlg() but so far nothing. In my application, I'll be calling PrintDlgEx() manually to get user options and then I'll just have wxWidgets do the printing silently.
Operating System: Windows 1-, 64-bit / macOS 13.4.1, Apple M1
Compiler: Visual Studio 2019 / Xcode 14.3.1
wxWidgets version: 3.1.0 / 3.2.2
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: enable "print current page" in wxPrintDialogData

Post by doublemax »

Could you modify the wx sources and create a patch?

If using PrintDlgEx has any side-effects, you could discuss it on the wx-dev mailing list first.
https://groups.google.com/forum/#!forum/wx-dev
Use the source, Luke!
Post Reply