TPrinter with GetWndDefault()

TPrinter with GetWndDefault()

Postby Enrico Maria Giordano » Sat Jan 12, 2008 10:35 pm

In the following sample GetWndDefault() returns NIL after TPrinter is used and then it continues to return NIL:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON "Print";
           ACTION PRINT()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


STATIC FUNCTION PRINT()

    LOCAL oPrn

    ? GETWNDDEFAULT()

    PRINT oPrn PREVIEW MODAL
        PAGE
        ENDPAGE
    ENDPRINT

    ? GETWNDDEFAULT()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8307
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia



Re: TPrinter with GetWndDefault()

Postby Enrico Maria Giordano » Sat Nov 28, 2009 9:27 pm

Any news about this problem?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8307
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TPrinter with GetWndDefault()

Postby Antonio Linares » Thu Dec 03, 2009 10:33 am

Enrico,

GetWndDefault() returns the most recently used window or dialog, so once the preview window is created then GetWndDefault() changes and finally it set to nil and the preview window is destroyed.

We don't keep a stack of previously used windows. In case you need to locate the current one you may use:

oWndFromHwnd( GetFocus() ) or

oDlgFromHwnd( GetFocus() )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41289
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain



Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 3 guests

cron