Page 1 of 1

TDialog ON CLICK bug

Posted: Mon Apr 10, 2006 9:11 am
by Enrico Maria Giordano
This is the sample (click has no effect):

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    ACTIVATE DIALOG oDlg;
             ON CLICK MSGINFO( "Test" );
             CENTER

    RETURN NIL
And this is a possible solution:

Code: Select all

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TDialog

   do case
      case nMsg == WM_INITDIALOG
           return ::Initiate( nWParam, nLParam )

      case nMsg == WM_PAINT
           return ::Display()

      case nMsg == WM_PRINTCLIENT
           return ::PrintClient( nWParam )

      case nMsg == WM_LBUTTONDOWN
           if ::lHelpIcon
              ::Help()
           endif        

           return Super:HandleEvent( nMsg, nWParam, nLParam ) // EMG
           
      otherwise
           return Super:HandleEvent( nMsg, nWParam, nLParam )
   endcase

return nil
EMG

Posted: Mon Apr 10, 2006 9:50 am
by Antonio Linares
Enrico,

many thanks for your fix. This code looks like a better one:

Code: Select all

      case nMsg == WM_LBUTTONDOWN
           if ::lHelpIcon
              ::Help()
           else        
              return Super:HandleEvent( nMsg, nWParam, nLParam )
           endif   
Anyhow if you test it with the dialog.prg that we have sent you (not modified yet) you will see we help a help msg that should not happen.

Posted: Mon Apr 10, 2006 10:01 am
by Enrico Maria Giordano
Antonio Linares wrote:Enrico,

many thanks for your fix. This code looks like a better one:

Code: Select all

      case nMsg == WM_LBUTTONDOWN
           if ::lHelpIcon
              ::Help()
           else        
              return Super:HandleEvent( nMsg, nWParam, nLParam )
           endif   
Yes, definitely.
Antonio Linares wrote:Anyhow if you test it with the dialog.prg that we have sent you (not modified yet) you will see we help a help msg that should not happen.
Yes, confirmed. It shoud not happen.

EMG