Hmg3 method incompatibility
Posted: Sun Sep 04, 2011 9:10 am
Hi friends
I found an incompatibility between a HMG3 method and HMG4 method. Please take a look to this code from control
But I found this
As you can see, the 2nd means start and stop. This is a problem, because we can't use Enabled (from control) to know the status according to the original meaning of Qt.
I think this 2nd method must be renamed (ie started) and within hmg.ch we must recode ENABLED to STARTED.
But is a problem, because with OOP syntax we must use
and with XBase command style we must translate
On the other hand I think it's important to preserve the original QT meaning: enabled / disabled
Cheers
Cheers
I found an incompatibility between a HMG3 method and HMG4 method. Please take a look to this code from control
Code: Select all
METHOD Enabled( lValue ) CLASS CONTROL
IF PCOUNT() == 0
::lEnabled := IIF( hb_IsNil( ::lEnabled ) == .T., ::oQtObject:isEnabled(), ::lEnabled )
RETURN ::lEnabled
ELSEIF hb_IsLogical( lValue ) == .T.
::lEnabled := lValue
::oQTObject:SetEnabled( ::lEnabled )
ENDIF
RETURN NIL
Code: Select all
METHOD Enabled( lValue ) CLASS TIMER
IF hb_IsLogical( lValue )
IF lValue
IF ! ::oQTObject:isActive()
::oQTObject:disconnect( "timeout()" )
::oQTObject:connect( "timeout()", ::bOnInterval )
::oQTObject:start()
ENDIF
ELSE
IF ::oQTObject:isActive()
::oQTObject:disconnect( "timeout()" )
::oQTObject:stop()
ENDIF
ENDIF
::lEnabled := lValue
ENDIF
RETURN ::lEnabled
I think this 2nd method must be renamed (ie started) and within hmg.ch we must recode ENABLED to STARTED.
But is a problem, because with OOP syntax we must use
Code: Select all
WITH OBJECT Timer(...
:Started := .F.
....
Code: Select all
DEFINE TIMER
ENABLED .F. ===> :Started := .F.
Cheers
Cheers