Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1
  • 2

TOPIC:

Passing Fox arrays by ref or value 01 Nov 2021 17:14 #20204

  • robert
  • robert's Avatar


  • Posts: 3178
  • Karl-Heinz,
    I am not sure why you really want to write your own printer dialog.
    I think that most users would be perfectly happy with the normal printer dialog that is shown by the .net PrintDialog class.
    this has a property button and everything you could ever want.
    You can also enable / disable the various print range options with the properties on that class:


    VAR dlg := PrintDialog{}           
        dlg:AllowSelection := TRUE
        dlg:AllowSomePages := TRUE
        dlg:ShowDialog()


    Robert
    XSharp Development Team
    The Netherlands
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    Passing Fox arrays by ref or value 02 Nov 2021 08:13 #20206

    • Karl-Heinz
    • Karl-Heinz's Avatar
    • Topic Author


  • Posts: 773
  • Robert,

    since the APrinters()/Getprinter() internals are similar, and the .net PrintDialog can´t be customized to get the VFP look i tried it this way. But it´s ok, to stay with the .net Printdialog.

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    Passing Fox arrays by ref or value 02 Nov 2021 08:35 #20207

    • robert
    • robert's Avatar


  • Posts: 3178
  • Karl-Heinz

    VFP is 12 years old (at least). Why would you try to customize the dialog to look like an antique dialog, unless you're an archelogist ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Passing Fox arrays by ref or value 03 Nov 2021 14:36 #20217

    • Karl-Heinz
    • Karl-Heinz's Avatar
    • Topic Author


  • Posts: 773
  • Robert,

    The .net PrintDialog caption shows "Print", which i translate to: The intention is to print something after clicking the [Ok] button, and not to select a Printername only like the VFP GetPrinter() does. I think in the terms of VFP the GetPrinter() is used in this way:
    c = GetPrinter()
    
    if ! empty ( c ) 
       SET PRINTER TO NAME ( c ) 	
    
    endif

    Anyway, from my side the case is closed !

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    Last edit: by Karl-Heinz.

    Passing Fox arrays by ref or value 03 Nov 2021 16:35 #20223

    • Karl-Heinz
    • Karl-Heinz's Avatar
    • Topic Author


  • Posts: 773
  • Robert,

    after reading your reply once again, I still don't understand why you call me an "archelogist" when I try to point out possible VFP compatibility problems. If you don't like such reports, please say it loud so I don't waste my time any longer!

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    Passing Fox arrays by ref or value 03 Nov 2021 17:19 #20226

    • robert
    • robert's Avatar


  • Posts: 3178
  • Karl-Heinz,

    I am sorry if I have offended you. That was never my intention.
    What I tried to say was that we should not spend too much time to create exactly the same dialog that VFP has, when there is already a built-in dialog in Windows that you can call from C# which also has more functionality (like access to the properties dialog).
    By using the built-in dialog we will also "automatically" get new features when they arrive with updates of the OS.

    And I do not think that FoxPro has created a complete new dialog. I am pretty sure that the underlying code uses the
    PrintDlgA () function in the windows API and all they have done is to pass in PRINTDLGA structure that contains a a handle to a custom resource.

    The rest is driven by the normal PrintDlgA() function.

    You can see that resource if you open VFP9ENU.DLL in Visual Studio (with Open / File) and then expand the Dialog node in the resource viewer. The resource with number 1559 is the one that contains the dialog.
    As you can see in the image below they have moved the properties button outside of the visual area of the dialog, as well as the choices for paper size and source and orientation.



    I think if we want to do something similar we should use the standard print dialog and use a similar trick to send in a different template.

    Robert
    XSharp Development Team
    The Netherlands
    Attachments:

    Please Log in or Create an account to join the conversation.

    Passing Fox arrays by ref or value 03 Nov 2021 17:35 #20228

    • Chris
    • Chris's Avatar


  • Posts: 3653
  • Hi Karl-Heinz,

    Sorry for stepping in, but please be assured that Robert was joking, it was not meant in an offensive way at all. I know, in written text it's hard to tell intent sometimes, but knowing Robert in person well, I know he is typing/saying it in a light-hearted way.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    Passing Fox arrays by ref or value 04 Nov 2021 13:02 #20241

    • Karl-Heinz
    • Karl-Heinz's Avatar
    • Topic Author


  • Posts: 773
  • ok, may love and peace reign again ;-)

    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    Passing Fox arrays by ref or value 04 Nov 2021 15:23 #20247

    • Chris
    • Chris's Avatar


  • Posts: 3653
  • Karl-Heinz wrote: ok, may love and peace reign again ;-)


    :)
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    • 2