OVERRIDE METHOD

OVERRIDE METHOD

Postby jicorral » Thu Mar 05, 2009 10:43 am

I'm trying to replace HaldleEvento from TControl:

Code: Select all  Expand view
function Main()

   lChDir(cFilePath(HB_ARGV(0)))

   OVERRIDE METHOD HandleEvent IN CLASS TControl WITH ControlHE // <--------------

   SET HELPFILE TO "ayuda1.chm"  
    SetHelpPopup('Ayuda.txt')

   DEFINE WINDOW oWnd FROM 1, 1 TO 40, 120 ;
      MENU BuildMenu()
    oWnd:nHelpID := 'Intro'

   ACTIVATE WINDOW oWnd

return nil

......

static function ControlHE( nMsg, nWParam, nLParam )
   local Self := HB_QSelf()
...
 


But I'm getting this error:

Code: Select all  Expand view
ayuda1.PRG(17) Error E0030  Syntax error "syntax error at 'METHOD'"


Any idea?
Jorge Ignacio Corral
Enjoy it :)
User avatar
jicorral
 
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am

Re: OVERRIDE METHOD

Postby Enrico Maria Giordano » Thu Mar 05, 2009 11:55 am

Please include

#include "Hbclass.ch"

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

Re: OVERRIDE METHOD

Postby jicorral » Thu Mar 05, 2009 4:39 pm

I have it included:

Code: Select all  Expand view
#include "FiveWin.ch"
#include "InKey.ch"
#include "hbclass.ch"
#include "..\res\resources.h"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   lChDir(cFilePath(HB_ARGV(0)))

    OVERRIDE METHOD HandleEvent IN CLASS TControl WITH ControlHE

   SET HELPFILE TO "ayuda1.chm"  
    SetHelpPopup('Ayuda.txt')

   DEFINE WINDOW oWnd FROM 1, 1 TO 40, 120 ;
      MENU BuildMenu()
    oWnd:nHelpID := 'Intro'

   ACTIVATE WINDOW oWnd

return ni
Jorge Ignacio Corral
Enjoy it :)
User avatar
jicorral
 
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am

Re: OVERRIDE METHOD

Postby Enrico Maria Giordano » Thu Mar 05, 2009 6:28 pm

Are you using Harbour or xHarbour?

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

Re: OVERRIDE METHOD

Postby jicorral » Fri Mar 06, 2009 9:51 am

Harbour 902
Jorge Ignacio Corral
Enjoy it :)
User avatar
jicorral
 
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am

Re: OVERRIDE METHOD

Postby Antonio Linares » Fri Mar 06, 2009 10:03 am

Jorge Ignacio,

Harbour does not support OVERRIDE METHOD yet

You need to use xHarbour to have it
regards, saludos

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

Re: OVERRIDE METHOD

Postby jicorral » Fri Mar 06, 2009 10:16 am

Oppss. Thx a lot.

So there is no way to replace a class method with harbour? I have found way to do it with an object but I need to do it with the class on application scope.
Jorge Ignacio Corral
Enjoy it :)
User avatar
jicorral
 
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am

Re: OVERRIDE METHOD

Postby Enrico Maria Giordano » Fri Mar 06, 2009 11:25 am

This is from Przemek:

Code: Select all  Expand view
#xcommand OVERRIDE METHOD <!Message!> [IN] CLASS <!Class!> WITH [METHOD] ;
                          <!Method!> [SCOPE <Scope>] => ;
          __clsModMsg( <Class>():classH, #<Message>, @<Method>(), ;
                       IIF( <.Scope.>, <Scope>, HB_OO_CLSTP_EXPORTED ) )


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

Re: OVERRIDE METHOD

Postby jicorral » Fri Mar 06, 2009 12:46 pm

Great! Do it! Thx a lot.
Jorge Ignacio Corral
Enjoy it :)
User avatar
jicorral
 
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am

Re: OVERRIDE METHOD

Postby Antonio Linares » Fri Mar 06, 2009 6:39 pm

Enrico,

Thanks! :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests