FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TDialog ON CLICK bug
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TDialog ON CLICK bug
Posted: Mon Apr 10, 2006 09:11 AM
This is the sample (click has no effect):

#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:

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TDialog ON CLICK bug
Posted: Mon Apr 10, 2006 09:50 AM
Enrico,

many thanks for your fix. This code looks like a better one:
      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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TDialog ON CLICK bug
Posted: Mon Apr 10, 2006 10:01 AM
Antonio Linares wrote:Enrico,

many thanks for your fix. This code looks like a better one:
      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

Continue the discussion