TDialog ON CLICK bug

TDialog ON CLICK bug

Postby Enrico Maria Giordano » Mon Apr 10, 2006 9:11 am

This is the sample (click has no effect):

Code: Select all  Expand view
#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  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Mon Apr 10, 2006 9:50 am

Enrico,

many thanks for your fix. This code looks like a better one:
Code: Select all  Expand view
      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
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Mon Apr 10, 2006 10:01 am

Antonio Linares wrote:Enrico,

many thanks for your fix. This code looks like a better one:
Code: Select all  Expand view
      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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 45 guests