From 68997e7ec63c8f1111a4c49e59e241b92b20da2c Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 26 Jul 2010 21:56:58 +0000 Subject: [PATCH] 2010-07-26 14:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbpmenubar.prg % Fixed: a nasty bug. --- harbour/ChangeLog | 4 ++++ harbour/contrib/hbxbp/xbpmenubar.prg | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 894f8e94e0..77477f4bb2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-26 14:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbpmenubar.prg + % Fixed: a nasty bug. + 2010-07-26 23:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/postinst.hbs ! Typo fixed. diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index ae0d07e5b3..0002fe850a 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -535,22 +535,22 @@ METHOD xbpMenuBar:selectItem( nItemIndex ) METHOD xbpMenuBar:execSlot( cSlot, p ) LOCAL nIndex - IF cSlot == "triggered(bool)" - if ( nIndex := ascan( ::aMenuItems, {|e_| e_[ 2 ] == p } ) ) > 0 + IF ! empty( p ) .AND. ( nIndex := ascan( ::aMenuItems, {|e_| iif( hb_isNumeric( e_[ 2 ] ), e_[ 2 ] == p, .f. ) } ) ) > 0 + IF cSlot == "triggered(bool)" IF hb_isBlock( ::aMenuItems[ nIndex,4 ] ) eval( ::aMenuItems[ nIndex,4 ] ) + ELSE ::itemSelected( nIndex ) - ENDIF - ENDIF - ELSEIF cSlot == "hovered()" - IF !empty( p ) - IF ( nIndex := ascan( ::aMenuItems, {|e_| iif( hb_isNumeric( e_[ 2 ] ), e_[ 2 ] == p, .f. ) } ) ) > 0 + ENDIF + + ELSEIF cSlot == "hovered()" + IF !empty( p ) ::itemMarked( nIndex ) + ENDIF ENDIF - ENDIF RETURN nil