2008-10-17 12:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/debug/debugger.prg
* changed __dbgInput() to return logical value and set edit value in
variable passed by reference
* harbour/source/debug/dbgtobj.prg
* harbour/source/debug/dbgthsh.prg
* harbour/source/debug/dbgtarr.prg
! fixed typo in VALID block declaration - it was array by mistake
* removed unnecessary code related to GET behavior
* use new __dbgInput() format
This commit is contained in:
@@ -8,6 +8,18 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2008-10-17 12:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/source/debug/debugger.prg
|
||||
* changed __dbgInput() to return logical value and set edit value in
|
||||
variable passed by reference
|
||||
|
||||
* harbour/source/debug/dbgtobj.prg
|
||||
* harbour/source/debug/dbgthsh.prg
|
||||
* harbour/source/debug/dbgtarr.prg
|
||||
! fixed typo in VALID block declaration - it was array by mistake
|
||||
* removed unnecessary code related to GET behavior
|
||||
* use new __dbgInput() format
|
||||
|
||||
2008-10-17 10:16 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* source/debug/dbgtobj.prg
|
||||
* source/debug/dbgthsh.prg
|
||||
|
||||
@@ -157,7 +157,6 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbArray
|
||||
|
||||
METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbArray
|
||||
|
||||
LOCAL nKey
|
||||
LOCAL oErr
|
||||
LOCAL cValue := PadR( __dbgValToStr( pItem[ nSet ] ),;
|
||||
oBrowse:nRight - oBrowse:nLeft - oBrowse:GetColumn( 1 ):width )
|
||||
@@ -166,10 +165,8 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbArray
|
||||
oBrowse:forceStable()
|
||||
// if confirming new record, append blank
|
||||
|
||||
cValue := __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, cValue, ;
|
||||
{ iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } )
|
||||
|
||||
IF LastKey() == K_ENTER
|
||||
IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, @cValue, ;
|
||||
{ | cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } )
|
||||
BEGIN SEQUENCE WITH {|oErr| break( oErr ) }
|
||||
pItem[ nSet ] := &cValue
|
||||
RECOVER USING oErr
|
||||
@@ -177,12 +174,6 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbArray
|
||||
END SEQUENCE
|
||||
ENDIF
|
||||
|
||||
// check exit key from get
|
||||
nKey := LastKey()
|
||||
IF nKey == K_UP .OR. nKey == K_DOWN .OR. nKey == K_PGUP .OR. nKey == K_PGDN
|
||||
KEYBOARD Chr( nKey )
|
||||
ENDIF
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, aArray ) CLASS HBDbArray
|
||||
|
||||
@@ -162,7 +162,6 @@ METHOD addWindows( hHash, nRow ) CLASS HBDbHash
|
||||
|
||||
METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbHash
|
||||
|
||||
LOCAL nKey
|
||||
LOCAL oErr
|
||||
LOCAL cValue := PadR( __dbgValToStr( HB_HValueAt( pItem, nSet ) ),;
|
||||
oBrowse:nRight - oBrowse:nLeft - oBrowse:GetColumn( 1 ):width )
|
||||
@@ -171,10 +170,8 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbHash
|
||||
oBrowse:forceStable()
|
||||
// if confirming new record, append blank
|
||||
|
||||
cValue := __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, cValue, ;
|
||||
{ iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } )
|
||||
|
||||
IF LastKey() == K_ENTER
|
||||
IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, @cValue, ;
|
||||
{ | cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } )
|
||||
BEGIN SEQUENCE WITH {|oErr| break( oErr ) }
|
||||
HB_HValueAt( pItem, nSet, &cValue )
|
||||
RECOVER USING oErr
|
||||
@@ -182,12 +179,6 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbHash
|
||||
END SEQUENCE
|
||||
ENDIF
|
||||
|
||||
// check exit key from get
|
||||
nKey := LastKey()
|
||||
IF nKey == K_UP .OR. nKey == K_DOWN .OR. nKey == K_PGUP .OR. nKey == K_PGDN
|
||||
KEYBOARD Chr( nKey )
|
||||
ENDIF
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, hHash ) CLASS HBDbHash
|
||||
|
||||
@@ -177,7 +177,6 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbObject
|
||||
METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbObject
|
||||
|
||||
LOCAL column
|
||||
LOCAL nKey
|
||||
LOCAL cValue
|
||||
LOCAL lCanAcc
|
||||
LOCAL oErr
|
||||
@@ -197,10 +196,8 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbObject
|
||||
ENDIF
|
||||
cValue := PadR( __dbgValToStr( cValue ), column:Width )
|
||||
|
||||
cValue := __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, cValue, ;
|
||||
{ iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } )
|
||||
|
||||
IF LastKey() == K_ENTER
|
||||
IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, @cValue, ;
|
||||
{ | cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } )
|
||||
BEGIN SEQUENCE WITH {|oErr| break( oErr ) }
|
||||
__dbgObjSetValue( ::TheObj, pitem[ nSet, 1 ], &cValue )
|
||||
RECOVER USING oErr
|
||||
@@ -208,12 +205,6 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbObject
|
||||
END SEQUENCE
|
||||
ENDIF
|
||||
|
||||
// check exit key from get
|
||||
nKey := LastKey()
|
||||
IF nKey == K_UP .OR. nKey == K_DOWN .OR. nKey == K_PGUP .OR. nKey == K_PGDN
|
||||
KEYBOARD Chr( nKey )
|
||||
ENDIF
|
||||
|
||||
RETURN NIL
|
||||
|
||||
METHOD SetsKeyPressed( nKey, oBrwSets, nSets, aArray ) CLASS HBDbObject
|
||||
|
||||
@@ -1092,12 +1092,10 @@ METHOD EditColor( nColor, oBrwColors ) CLASS HBDebugger
|
||||
oBrwColors:RefreshCurrent()
|
||||
oBrwColors:ForceStable()
|
||||
|
||||
cColor := __dbgInput( Row(), Col() + 15,, cColor, ;
|
||||
{ | cColor | iif( Type( cColor ) != "C", ;
|
||||
( __dbgAlert( "Must be string" ), .F. ), .T. ) }, ;
|
||||
SubStr( ::ClrModal(), 5 ) )
|
||||
|
||||
IF LastKey() != K_ESC
|
||||
IF __dbgInput( Row(), Col() + 15,, @cColor, ;
|
||||
{ | cColor | iif( Type( cColor ) != "C", ;
|
||||
( __dbgAlert( "Must be string" ), .F. ), .T. ) }, ;
|
||||
SubStr( ::ClrModal(), 5 ) )
|
||||
::aColors[ nColor ] := &cColor
|
||||
ENDIF
|
||||
|
||||
@@ -1114,12 +1112,10 @@ METHOD EditSet( nSet, oBrwSets ) CLASS HBDebugger
|
||||
oBrwSets:RefreshCurrent()
|
||||
oBrwSets:ForceStable()
|
||||
|
||||
cSet := __dbgInput( Row(), Col() + 13,, cSet, ;
|
||||
{ | cSet | iif( Type( cSet ) != cType, ;
|
||||
( __dbgAlert( "Must be of type '" + cType + "'" ), .F. ), .T. ) }, ;
|
||||
SubStr( ::ClrModal(), 5 ) )
|
||||
|
||||
IF LastKey() != K_ESC
|
||||
IF __dbgInput( Row(), Col() + 13,, @cSet, ;
|
||||
{ | cSet | iif( Type( cSet ) != cType, ;
|
||||
( __dbgAlert( "Must be of type '" + cType + "'" ), .F. ), .T. ) }, ;
|
||||
SubStr( ::ClrModal(), 5 ) )
|
||||
Set( nSet, &cSet )
|
||||
ENDIF
|
||||
|
||||
@@ -1518,8 +1514,8 @@ METHOD InputBox( cMsg, uValue, bValid, lEditable ) CLASS HBDebugger
|
||||
IF cType != "C" .OR. Len( uValue ) < nWidth
|
||||
uTemp := PadR( uValue, nWidth )
|
||||
ENDIF
|
||||
uTemp := __dbgInput( nTop + 1, nLeft + 1, nWidth, uTemp, bValid, ;
|
||||
__DbgColors()[ 5 ], Max( Max( nWidth, Len( uTemp ) ), 256 ) )
|
||||
__dbgInput( nTop + 1, nLeft + 1, nWidth, @uTemp, bValid, ;
|
||||
__DbgColors()[ 5 ], Max( Max( nWidth, Len( uTemp ) ), 256 ) )
|
||||
SWITCH cType
|
||||
CASE "C" ; uTemp := AllTrim( uTemp ) ; EXIT
|
||||
CASE "D" ; uTemp := CToD( uTemp ) ; EXIT
|
||||
@@ -3309,7 +3305,7 @@ STATIC FUNCTION strip_path( cFileName )
|
||||
FUNCTION __dbgInput( nRow, nCol, nWidth, cValue, bValid, cColor, nSize )
|
||||
|
||||
LOCAL nOldCursor := SetCursor( SC_NORMAL )
|
||||
LOCAL cTemp := cValue
|
||||
LOCAL lOK := .F.
|
||||
LOCAL nKey
|
||||
LOCAL oGet
|
||||
|
||||
@@ -3325,7 +3321,8 @@ FUNCTION __dbgInput( nRow, nCol, nWidth, cValue, bValid, cColor, nSize )
|
||||
EXIT
|
||||
ELSEIF nKey == K_ENTER
|
||||
IF bValid == NIL .OR. Eval( bValid, oGet:getValue() )
|
||||
cTemp := oGet:getValue()
|
||||
cValue := oGet:getValue()
|
||||
lOK := .T.
|
||||
EXIT
|
||||
ENDIF
|
||||
ELSE
|
||||
@@ -3335,7 +3332,7 @@ FUNCTION __dbgInput( nRow, nCol, nWidth, cValue, bValid, cColor, nSize )
|
||||
|
||||
SetCursor( nOldCursor )
|
||||
|
||||
RETURN cTemp
|
||||
RETURN lOK
|
||||
|
||||
|
||||
FUNCTION __dbgAchoice( nTop, nLeft, nBottom, nRight, aItems, cColors )
|
||||
|
||||
Reference in New Issue
Block a user