diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7631b683a3..7416d58470 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,21 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-26 15:25 UTC+0100 Viktor Szakats (harbour syenar.net) + * src/rtl/dbedit.prg + + also accept function pointers as user functions + (not just codeblocks and macro strings) + + * src/rtl/achoice.prg + + ACHOICE() now supports the Harbour extension similar to + DBEDIT() where codeblocks and function pointers are + also accepted instead of macro strings for the + parameter that controls permission for items. + + * src/rtl/browse.prg + * contrib/hbwin/wapi_shellapi.c + * minor + 2012-11-26 14:43 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/xhb/xhberr.prg % optimized hb_macroBlock() calls to __dynsN2Sym() calls. diff --git a/harbour/contrib/hbwin/wapi_shellapi.c b/harbour/contrib/hbwin/wapi_shellapi.c index 88a043682c..6e548bc0cc 100644 --- a/harbour/contrib/hbwin/wapi_shellapi.c +++ b/harbour/contrib/hbwin/wapi_shellapi.c @@ -60,7 +60,7 @@ HB_FUNC( WAPI_SHELLEXECUTE ) { #if defined( HB_OS_WIN_CE ) - hb_retni( -1 ); + hb_retnint( -1 ); #else void * hOperation; void * hFile; @@ -74,10 +74,10 @@ HB_FUNC( WAPI_SHELLEXECUTE ) HB_PARSTR( 5, &hDirectory, NULL ), hb_parnidef( 6, SW_SHOWNORMAL ) /* nShowCmd */ ) ); - hb_strfree( hOperation ); - hb_strfree( hFile ); + hb_strfree( hOperation ); + hb_strfree( hFile ); hb_strfree( hParameters ); - hb_strfree( hDirectory ); + hb_strfree( hDirectory ); #endif } diff --git a/harbour/src/rtl/achoice.prg b/harbour/src/rtl/achoice.prg index 1b05ceb87d..37938ec041 100644 --- a/harbour/src/rtl/achoice.prg +++ b/harbour/src/rtl/achoice.prg @@ -28,6 +28,10 @@ #define INRANGE( xLo, xVal, xHi ) ( xVal >= xLo .AND. xVal <= xHi ) #define BETWEEN( xLo, xVal, xHi ) Min( Max( xLo, xVal ), xHi ) +/* NOTE: Extension: Harbour supports codeblocks and function pointers + as the xSelect parameter (both when supplied as is, or as an + array of codeblocks). [vszakats] */ + FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPos, nHiLiteRow ) LOCAL nNumCols // Number of columns in the window @@ -669,7 +673,9 @@ STATIC FUNCTION Ach_Select( alSelect, nPos ) IF nPos >= 1 .AND. nPos <= Len( alSelect ) sel := alSelect[ nPos ] - IF HB_ISSTRING( sel ) .AND. ! Empty( sel ) + IF HB_ISEVALITEM( sel ) + sel := Eval( sel ) + ELSEIF HB_ISSTRING( sel ) .AND. ! Empty( sel ) sel := Eval( hb_macroBlock( sel ) ) ENDIF IF HB_ISLOGICAL( sel ) diff --git a/harbour/src/rtl/browse.prg b/harbour/src/rtl/browse.prg index f6fbf4fb9d..ec68e97b34 100644 --- a/harbour/src/rtl/browse.prg +++ b/harbour/src/rtl/browse.prg @@ -350,7 +350,7 @@ STATIC FUNCTION DoGet( oBrw, lAppend ) ! Eval( hb_macroBlock( cForExp ) ) dbGoTop() ENDIF - IF ! lAppend .AND. ! Empty( cIndexKey ) .AND. ! xKeyValue == Eval( bIndexKey ) + IF ! lAppend .AND. ! Empty( bIndexKey ) .AND. ! xKeyValue == Eval( bIndexKey ) lSuccess := .T. ENDIF ENDIF diff --git a/harbour/src/rtl/dbedit.prg b/harbour/src/rtl/dbedit.prg index 17ebe1dedc..841852bda1 100644 --- a/harbour/src/rtl/dbedit.prg +++ b/harbour/src/rtl/dbedit.prg @@ -54,8 +54,8 @@ #include "inkey.ch" #include "setcurs.ch" -/* NOTE: Extension: Harbour supports codeblocks as the xUserFunc parameter - [vszakats] */ +/* NOTE: Extension: Harbour supports codeblocks and function pointers + as the xUserFunc parameter. [vszakats] */ /* NOTE: Clipper is buggy and will throw an error if the number of columns is zero. (Check: dbEdit(0,0,20,20,{})) [vszakats] */ /* NOTE: Clipper will throw an error if there's no database open [vszakats] */ @@ -312,7 +312,7 @@ STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag ) /* NOTE: CA-Cl*pper won't check the type of the return value here, and will crash if it's a non-NIL, non-numeric type. We're replicating this behavior. */ - nAction := iif( HB_ISBLOCK( xUserFunc ), ; + nAction := iif( HB_ISEVALITEM( xUserFunc ), ; Eval( xUserFunc, nMode, oBrowse:colPos ), ; iif( HB_ISSTRING( xUserFunc ) .AND. ! Empty( xUserFunc ), ; &xUserFunc( nMode, oBrowse:colPos ), ; /* NOTE: Macro operator! */