2007-09-13 10:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* source/rtl/getsys.prg
   * source/rtl/tgetlist.prg
   * source/debug/debugger.prg
     ! Fixed scope violation in debugger by creating 
       a new :Get() method for HBGetList().
     ! Fixed some minor issues.
     % Minor optimization. Like dropping HBGetList():ReadExit() 
       which was just a wrapper to SET( _SET_EXIT ).
     ! Replaced a few remaining external HBGetList() var accesses 
       with :ReadStats() calls.
     ! TGetList():GetApplyKey() parameter list rearranged after 
       yesterday to keep it compatible with previous versions.
       This also avoids a crash in the debugger.
This commit is contained in:
Viktor Szakats
2007-09-13 09:00:40 +00:00
parent 175821531e
commit 205a90cd0c
4 changed files with 67 additions and 55 deletions

View File

@@ -8,6 +8,21 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-09-13 10:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/getsys.prg
* source/rtl/tgetlist.prg
* source/debug/debugger.prg
! Fixed scope violation in debugger by creating
a new :Get() method for HBGetList().
! Fixed some minor issues.
% Minor optimization. Like dropping HBGetList():ReadExit()
which was just a wrapper to SET( _SET_EXIT ).
! Replaced a few remaining external HBGetList() var accesses
with :ReadStats() calls.
! TGetList():GetApplyKey() parameter list rearranged after
yesterday to keep it compatible with previous versions.
This also avoids a crash in the debugger.
2007-09-13 04:42 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/memoedit.prg
* source/rtl/teditor.prg

View File

@@ -760,35 +760,35 @@ METHOD CommandWindowProcessKey( nKey ) CLASS HBDebugger
CASE nKey == K_UP .OR. nKey == K_F3
IF ::nCommand > 1
::oGetListCommand:oGet:Assign()
::aLastCommands[ ::nCommand ] := Trim( ::oGetListCommand:oGet:VarGet() )
::oGetListCommand:Get():Assign()
::aLastCommands[ ::nCommand ] := Trim( ::oGetListCommand:Get():VarGet() )
::nCommand--
cCommand := PadR( ::aLastCommands[ ::nCommand ], nWidth )
::oGetListCommand:oGet:VarPut( cCommand )
::oGetListCommand:oGet:Buffer := cCommand
::oGetListCommand:oGet:Pos := Len( ::aLastCommands[ ::nCommand ] ) + 1
::oGetListCommand:oGet:Display()
::oGetListCommand:Get():VarPut( cCommand )
::oGetListCommand:Get():Buffer := cCommand
::oGetListCommand:Get():Pos := Len( ::aLastCommands[ ::nCommand ] ) + 1
::oGetListCommand:Get():Display()
ENDIF
CASE nKey == K_DOWN
IF ::nCommand < Len( ::aLastCommands )
::oGetListCommand:oGet:Assign()
::aLastCommands[ ::nCommand ] := Trim( ::oGetListCommand:oGet:VarGet() )
::oGetListCommand:Get():Assign()
::aLastCommands[ ::nCommand ] := Trim( ::oGetListCommand:Get():VarGet() )
::nCommand++
cCommand := PadR( ::aLastCommands[ ::nCommand ], nWidth )
::oGetListCommand:oGet:VarPut( cCommand )
::oGetListCommand:oGet:Buffer := cCommand
::oGetListCommand:oGet:Pos := Len( ::aLastCommands[ ::nCommand ] ) + 1
::oGetListCommand:oGet:Display()
::oGetListCommand:Get():VarPut( cCommand )
::oGetListCommand:Get():Buffer := cCommand
::oGetListCommand:Get():Pos := Len( ::aLastCommands[ ::nCommand ] ) + 1
::oGetListCommand:Get():Display()
ENDIF
CASE nKey == K_ENTER
/* We must call :Assign() before :VarGet(), because it's no longer
* called on every change */
::oGetListCommand:oGet:Assign()
cCommand := Trim( ::oGetListCommand:oGet:VarGet() )
::oGetListCommand:Get():Assign()
cCommand := Trim( ::oGetListCommand:Get():VarGet() )
IF ! Empty( cCommand )
IF ( n := AScan( ::aLastCommands, cCommand ) ) > 0 .AND. n < Len( ::aLastCommands )
@@ -805,10 +805,10 @@ METHOD CommandWindowProcessKey( nKey ) CLASS HBDebugger
DispOutAt( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 1, "> ",;
__DbgColors()[ 2 ] )
cCommand := Space( nWidth )
::oGetListCommand:oGet:VarPut( cCommand )
::oGetListCommand:oGet:Buffer := cCommand
::oGetListCommand:oGet:Pos := 1
::oGetListCommand:oGet:Display()
::oGetListCommand:Get():VarPut( cCommand )
::oGetListCommand:Get():Buffer := cCommand
::oGetListCommand:Get():Pos := 1
::oGetListCommand:Get():Display()
OTHERWISE
::oGetListCommand:GetApplyKey( nKey )
@@ -2289,8 +2289,8 @@ METHOD SaveAppScreen() CLASS HBDebugger
nTop := 1
nRight := ::nMaxCol
::oWndCommand:Resize( ::nMaxRow - 5, 0, ::nMaxRow - 1, ::nMaxCol )
::oGetListCommand:oGet:Row := ::oWndCommand:nBottom - 1
::oGetListCommand:oGet:Col := ::oWndCommand:nLeft + 3
::oGetListCommand:Get():Row := ::oWndCommand:nBottom - 1
::oGetListCommand:Get():Col := ::oWndCommand:nLeft + 3
::oBrwStack:nTop := 2
::oBrwStack:nLeft := ::nMaxCol - 14
::oBrwStack:nRight := ::nMaxCol - 1

View File

@@ -64,6 +64,11 @@
#include "common.ch"
#ifdef HB_COMPAT_C53
#define SLUPDATED 1
#define SOACTIVEGET 8
#define SXREADVAR 9
FUNCTION ReadModal( GetList, nPos, oMenu, nMsgRow, nMsgLeft, nMsgRight, cMsgColor )
#else
FUNCTION ReadModal( GetList, nPos )
@@ -80,9 +85,11 @@ FUNCTION ReadModal( GetList, nPos )
oGetList := HBGetList():New( GetList )
oSaveGetList := __GetListActive( )
// oSaveGetList:lUpdated := .F.
// oSaveGetList:xReadVar := ReadVar( "" )
// oSaveGetList:oActiveGet := GetActive( NIL )
#ifdef HB_COMPAT_C53
// oSaveGetList:ReadStats( SLUPDATED, .F. )
// oSaveGetList:ReadStats( SXREADVAR, ReadVar( "" ) )
// oSaveGetList:ReadStats( SOACTIVEGET, GetActive( NIL ) )
#endif
__GetListSetActive( oGetList )
__GetListLast( oGetList )
@@ -94,9 +101,11 @@ FUNCTION ReadModal( GetList, nPos )
#endif
__GetListSetActive( oSaveGetList )
// oSaveGetList:lUpdated := oGetList:Updated()
// ReadVar( oSaveGetList:xReadVar )
// GetActive( oSaveGetList:oActiveGet )
#ifdef HB_COMPAT_C53
// oSaveGetList:ReadStats( SLUPDATED, oGetList:Updated() )
// ReadVar( oSaveGetList:ReadStats( SXREADVAR ) )
// GetActive( oSaveGetList:ReadStats( SOACTIVEGET ) )
#endif
SetPos( MaxRow() - 1, 0 )
@@ -152,9 +161,9 @@ PROCEDURE GetApplyKey( oGet, nKey )
IF oGetList != NIL
#ifdef HB_COMPAT_C53
oGetList:GetApplyKey( oGet, nKey, oMenu, aMsg )
oGetList:GetApplyKey( nKey, oGet, oMenu, aMsg )
#else
oGetList:GetApplyKey( oGet, nKey )
oGetList:GetApplyKey( nKey, oGet )
#endif
ENDIF
@@ -203,11 +212,7 @@ FUNCTION ReadInsert( lInsert )
FUNCTION Updated()
LOCAL oGetList := __GetListLast()
IF oGetList != NIL
RETURN oGetList:Updated()
ENDIF
RETURN .F.
RETURN iif( oGetList != NIL, oGetList:Updated(), .F. )
PROCEDURE __KillRead()
LOCAL oGetList := __GetListActive()
@@ -369,20 +374,12 @@ PROCEDURE GUIApplyKey( oGet, oGUI, oGetList, nKey, oMenu, aMsg )
FUNCTION GUIPreValidate( oGet, oGUI, aMsg )
LOCAL oGetList := __GetListActive()
IF oGetList != NIL
RETURN oGetList:GUIPreValidate( oGet, oGUI, aMsg )
ENDIF
RETURN .F.
RETURN iif( oGetList != NIL, oGetList:GUIPreValidate( oGet, oGUI, aMsg ), .F. )
FUNCTION GUIPostValidate( oGet, oGUI, aMsg )
LOCAL oGetList := __GetListActive()
IF oGetList != NIL
RETURN oGetList:GUIPostValidate( oGet, oGUI, aMsg )
ENDIF
RETURN .F.
RETURN iif( oGetList != NIL, oGetList:GUIPostValidate( oGet, oGUI, aMsg ), .F. )
PROCEDURE TBApplyKey( oGet, oTB, oGetList, nKey, aMsg )

View File

@@ -98,7 +98,7 @@ CREATE CLASS HBGetList
#endif
METHOD Settle( nPos, lInit )
METHOD Reader( oMenu, aMsg )
METHOD GetApplyKey( oGet, nKey, oMenu, aMsg )
METHOD GetApplyKey( nKey, oGet, oMenu, aMsg )
METHOD GetPreValidate( oGet, aMsg )
METHOD GetPostValidate( oGet, aMsg )
METHOD GetDoSetKey( bKeyBlock, oGet )
@@ -111,9 +111,9 @@ CREATE CLASS HBGetList
METHOD ShowScoreBoard()
METHOD ReadUpdated( lUpdated )
METHOD ReadVar( cNewVarName )
METHOD ReadExit( lNew )
METHOD SetFocus()
METHOD Updated()
METHOD Updated() // returns ::lUpdated
METHOD Get() // returns ::oGet
METHOD GUIReader( oGet, oMenu, aMsg )
METHOD GUIApplyKey( oGet, oGUI, nKey, oMenu, aMsg )
@@ -236,12 +236,12 @@ METHOD ReadModal( nPos ) CLASS HBGetList
RETURN Self
METHOD ReadExit( lNew ) CLASS HBGetList
RETURN iif( ISLOGICAL( lNew ), Set( _SET_EXIT, lNew ), Set( _SET_EXIT ) )
METHOD Updated() CLASS HBGetList
RETURN ::lUpdated
METHOD Get() CLASS HBGetList
RETURN ::oGet
METHOD SetFocus() CLASS HBGetList
__GetListSetActive( Self )
@@ -288,9 +288,9 @@ METHOD Reader( oMenu, aMsg ) CLASS HBGetList
SetCursor( iif( ::nSaveCursor == SC_NONE, SC_NORMAL, ::nSaveCursor ) )
nKey := Inkey( 0 )
SetCursor( SC_NONE )
::GetApplyKey( oGet, nKey, oMenu, aMsg )
::GetApplyKey( nKey, oGet, oMenu, aMsg )
#else
::GetApplyKey( oGet, Inkey( 0 ), oMenu, aMsg )
::GetApplyKey( Inkey( 0 ), oGet, oMenu, aMsg )
#endif
nRow := Row()
nCol := Col()
@@ -325,7 +325,7 @@ METHOD Reader( oMenu, aMsg ) CLASS HBGetList
RETURN Self
METHOD GetApplyKey( oGet, nKey, oMenu, aMsg ) CLASS HBGetList
METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList
LOCAL cKey
LOCAL bKeyBlock
@@ -709,14 +709,14 @@ METHOD Settle( nPos, lInit ) CLASS HBGetList
ENDCASE
IF nPos == 0
IF ! ::ReadExit() .AND. ! ::lBumpBot
IF ! Set( _SET_EXIT ) .AND. ! ::lBumpBot
::lBumpTop := .T.
nPos := ::nLastPos
nExitState := GE_DOWN
ENDIF
ELSEIF nPos == Len( ::aGetList ) + 1
IF ! ::ReadExit() .AND. nExitState != GE_ENTER .AND. ! ::lBumpTop
IF ! Set( _SET_EXIT ) .AND. nExitState != GE_ENTER .AND. ! ::lBumpTop
::lBumpBot := .T.
nPos := ::nLastPos
nExitState := GE_UP
@@ -1577,7 +1577,7 @@ METHOD ReadStats( nElement, xNewValue ) CLASS HBGetList
CASE nElement == SNLASTEXIT ; ::nLastExitState := xNewValue
CASE nElement == SNLASTPOS ; ::nLastPos := xNewValue
CASE nElement == SOACTIVEGET ; ::oActiveGet := xNewValue
CASE nElement == SXREADVAR ; ::cVarName := xNewValue
CASE nElement == SXREADVAR ; ::xReadVar := xNewValue
CASE nElement == SCREADPROCNAME ; ::cReadProcName := xNewValue
CASE nElement == SNREADPROCLINE ; ::nReadProcLine := xNewValue
CASE nElement == SNNEXTGET ; ::nNextGet := xNewValue