Recent

Author Topic: Struggling with TPageSetUpDialog  (Read 7162 times)

Spoonhorse

  • Jr. Member
  • **
  • Posts: 52
Struggling with TPageSetUpDialog
« on: June 18, 2021, 07:27:25 pm »
Windows 10, latest FPC/Lazarus. A TPageSetUpDialog has a dropdown menu for the various paper sizes, and two radio buttons for portrait/landscape orientation.

Now first of all these don't seem to be part of the properties of the dialog, which is ... weird. I can't see them anywhere, I can't figure out how to get the values out once the user has set them. Maybe that's just me being dumb.

But when I tried to paper over the problem by just disabling these bits of the dialog, none of the disable options work. Surely that's a bug? They don't hide the options or even stop the users from setting them.

And none of the events fire, when I write event handlers for them nothing happens.

Thanks for any help and/or advice.

jamie

  • Hero Member
  • *****
  • Posts: 4732
Re: Struggling with TPageSetUpDialog
« Reply #1 on: June 18, 2021, 11:24:51 pm »
Yup, strange. I just checked that in 2.0.4 and trunk, does pretty much what you say.. events don't work..

did you include the Printer4Lazarus and Printers unit in your uses list?
The only true wisdom is knowing you know nothing

Spoonhorse

  • Jr. Member
  • **
  • Posts: 52
Re: Struggling with TPageSetUpDialog
« Reply #2 on: June 19, 2021, 10:39:49 am »
If it's not just me then maybe someone will fix it. Whom does one tell?

I didn't have Printers 'cos I hadn't tried to print anything but I added it and it made no difference. And after all, why would it? If something important was missing from a uses clause that would show up at compile time.

winni

  • Hero Member
  • *****
  • Posts: 2482
Re: Struggling with TPageSetUpDialog
« Reply #3 on: June 19, 2021, 11:48:39 am »
I If something important was missing from a uses clause that would show up at compile time.

Hi!

That is wrong. Your code compiles fine without Printers4Lazarus but will not work at run time.

Winni

Alextp

  • Hero Member
  • *****
  • Posts: 1322
    • UVviewsoft
Re: Struggling with TPageSetUpDialog
« Reply #4 on: June 19, 2021, 12:02:14 pm »
I made a fix for TPageSetupDialog on win32
https://bugs.freepascal.org/view.php?id=39020
Now psoDisable* options work on Win10.

Spoonhorse

  • Jr. Member
  • **
  • Posts: 52
Re: Struggling with TPageSetUpDialog
« Reply #5 on: June 19, 2021, 03:00:23 pm »
Alextp. Thank you! That all works except that it doesn't recognize the constant PSD_NONETWORKBUTTON, and sure enough it isn't defined in my copy of defines.inc with the other PSD_* constants. Can you tell me what it should be? Thanks again. (But then, I can't see a "network button" that could be disabled, is that also a bug? So it works fine for me if I just comment that bit out.)

And can you shed some light on the original problem? The reason I wanted to shut those things off was that I can't see any way to get information in or out of them. I'd be quite happy to have them enabled if there was some way I could see and respond to the users' selections ...

Winni, thanks. I still have much to learn alas.

Alextp

  • Hero Member
  • *****
  • Posts: 1322
    • UVviewsoft
Re: Struggling with TPageSetUpDialog
« Reply #6 on: June 19, 2021, 05:36:21 pm »
My patch defines that constant! In the beginning of the same function, it declares this value PSD_NONETWORKBUTTON.
« Last Edit: June 19, 2021, 08:39:05 pm by Alextp »

Alextp

  • Hero Member
  • *****
  • Posts: 1322
    • UVviewsoft
Re: Struggling with TPageSetUpDialog
« Reply #7 on: June 19, 2021, 05:37:38 pm »
About "TPageSetupDialog don't have enough properties"-- it has enough. look at the Delphi7 - same properties. all you need is Paper size x/y, and you have it. Portrait/etc - do you need them?

Spoonhorse

  • Jr. Member
  • **
  • Posts: 52
Re: Struggling with TPageSetUpDialog
« Reply #8 on: June 19, 2021, 08:11:12 pm »
Oh, sorry, I missed it.

No, if the feature aren't there * shrug *.

Alextp

  • Hero Member
  • *****
  • Posts: 1322
    • UVviewsoft
Re: Struggling with TPageSetUpDialog
« Reply #9 on: June 19, 2021, 08:40:05 pm »
Why do you need more properties?

>About "TPageSetupDialog don't have enough properties"-- it has enough. look at the Delphi7 - same properties. all you need is Paper size x/y, and you have it.

 

TinyPortal © 2005-2018