wxPageSetupDialogData default data ?

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
fred666
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Feb 18, 2006 1:50 pm

wxPageSetupDialogData default data ?

Post by fred666 » Sat Feb 18, 2006 2:11 pm

I can get the user's choice of wxPageSetupDialogData from a wxPageSetupDialog. When I first show this dialog it comes up with default sensible data (in my case A4 size paper etc) - presumably from the system.

Is it possible to get this default data without showing a dialog, so the app can start with an appropriate size of paper? My system is WinXP, but the question is general, not platform specific.
---
I've also noticed that my app, and indeed the sample wxWidgets app, do not reliably transfer valid wxPageSetupDialogData into a wxPageSetupDialog. Is this a known issue?

Many thanks.

eco
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 203
Joined: Tue Aug 31, 2004 7:06 pm
Location: Behind a can of Mountain Dew
Contact:

Post by eco » Sun Feb 19, 2006 8:05 am

Use wxPageSetupDialogData::SetDefaultInfo(true) and pass it into an instance of wxPageSetupDialog to retrieve the default data. I'm not sure if you have to call Show() on the dialog or not for it to work but it won't show the dialog either way.

I've recently been having some trouble with the page setup data forgetting the printer that was selected. I've already submitted a patch (which was accepted and applied before 2.6.2) to fix a similar situations so I might look into this (if it is, indeed, the same problem). What exactly are the symptoms of the problem you are having?

fred666
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Feb 18, 2006 1:50 pm

Post by fred666 » Sun Feb 19, 2006 11:58 am

Thank you for this - it works, although unfortunately it seems to be Windows specific. It is not necessary to show the dialog. However to return to the normal dialog action it seems necessary to pass wxPageSetupDialogData with SetDefaultInfo(false) to a new dialog and *also show it*; it is not enough to simply create the dialog. (This is no problem as I now have the default info to pass.)

---

The issue with wxPageSetupDialogData not being reliably shown on the dialog: the sample 'printing' app has this (that prints out the 'wxWindows Roadmap'). It shows orientation and margins reliably - it is only the paper size it sometimes shows as default (about 1 in 3 times, and I can find no pattern). The information returned by the dialog is always correct, so it's not a disaster. WinXP and vc++6. wxWidgets 2.6.2

Thanks again for your help.

Post Reply