Page 1 of 1

TPrinter with GetWndDefault()

Posted: Sat Jan 12, 2008 10:35 pm
by Enrico Maria Giordano
In the following sample GetWndDefault() returns NIL after TPrinter is used and then it continues to return NIL:

Code: Select all

#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

Re: Bug in TPrinter with GetWndDefault()

Posted: Sun Jun 08, 2008 6:35 pm
by Enrico Maria Giordano
This bug is still unresolved.

EMG

Re: Bug in TPrinter with GetWndDefault()

Posted: Sat Jul 26, 2008 10:46 am
by Enrico Maria Giordano
Any news?

EMG

Re: TPrinter with GetWndDefault()

Posted: Sat Nov 28, 2009 9:27 pm
by Enrico Maria Giordano
Any news about this problem?

EMG

Re: TPrinter with GetWndDefault()

Posted: Thu Dec 03, 2009 10:33 am
by Antonio Linares
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() )

Re: TPrinter with GetWndDefault()

Posted: Thu Dec 03, 2009 11:27 am
by Enrico Maria Giordano
Ok, thank you.

EMG