diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5a4e99fe9f..de305b69e0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2012-09-03 10:05 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/main.prg + * contrib/hbxbp/listbox.prg + % Changed: XbpListBox():addItem( cItem, qIcon ) => :addItem( cItem ) + to confirm to Xbase++ calling arguments. + + Added: XbpListBox():setIcon( nIndex, oIcon ) to attach image + to a listbox item. This is Harbour extension and is documented + in the sources. + 2012-09-03 09:45 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/editor.prg * contrib/hbide/main.prg diff --git a/harbour/contrib/hbide/main.prg b/harbour/contrib/hbide/main.prg index 0d1a72e42a..06ef86c7bc 100644 --- a/harbour/contrib/hbide/main.prg +++ b/harbour/contrib/hbide/main.prg @@ -1502,7 +1502,7 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem ) /*----------------------------------------------------------------------*/ METHOD HbIde:updateFuncList( lSorted ) - LOCAL aFunc :={}, a_ + LOCAL aFunc :={}, a_, nIndex DEFAULT lSorted TO ::lSortedFuncList @@ -1514,11 +1514,13 @@ METHOD HbIde:updateFuncList( lSorted ) aeval( ::aTags, {|e_| aadd( aFunc, { e_[ 6 ], e_[ 7 ] } ) } ) asort( aFunc, , , {|e,f| lower( e[ 2 ] ) < lower( f[ 2 ] ) } ) FOR EACH a_ IN aFunc - ::oFuncList:addItem( a_[ 2 ], QIcon( hbide_identifierImage( a_[ 1 ] ) ) ) + nIndex := ::oFuncList:addItem( a_[ 2 ] ) + ::oFuncList:setIcon( nIndex, QIcon( hbide_identifierImage( a_[ 1 ] ) ) ) NEXT ELSE FOR EACH a_ IN ::aTags - ::oFuncList:addItem( a_[ 7 ], QIcon( hbide_identifierImage( a_[ 6 ] ) ) ) + nIndex := ::oFuncList:addItem( a_[ 7 ] ) + ::oFuncList:setIcon( nIndex, QIcon( hbide_identifierImage( a_[ 6 ] ) ) ) NEXT ENDIF ENDIF diff --git a/harbour/contrib/hbxbp/listbox.prg b/harbour/contrib/hbxbp/listbox.prg index 5772791947..cb1f4984ee 100644 --- a/harbour/contrib/hbxbp/listbox.prg +++ b/harbour/contrib/hbxbp/listbox.prg @@ -104,12 +104,13 @@ CLASS XbpListBox INHERIT XbpWindow, DataRef METHOD setTopItem( nIndex ) VIRTUAL METHOD numItems() INLINE len( ::aItems ) - METHOD addItem( cItem, qIcon ) + METHOD addItem( cItem ) METHOD clear( lConnect ) METHOD delItem( nIndex ) METHOD getItem( nIndex ) METHOD insItem( nIndex, cItem ) METHOD setItem( nIndex, cItem ) + METHOD setIcon( nIndex, oIcon ) /* Harbour Extension */ METHOD setVisible( cItem ) METHOD getTabstops() VIRTUAL @@ -364,13 +365,10 @@ METHOD XbpListBox:clear( lConnect ) /*----------------------------------------------------------------------*/ -METHOD XbpListBox:addItem( cItem, qIcon ) +METHOD XbpListBox:addItem( cItem ) LOCAL qItm := QListWidgetItem() qItm:setText( cItem ) - IF HB_ISOBJECT( qIcon ) - qItm:setIcon( qIcon ) - ENDIF ::oWidget:addItem( qItm ) aadd( ::aItems, qItm ) @@ -426,6 +424,15 @@ METHOD XbpListBox:setItem( nIndex, cItem ) RETURN cText +/*----------------------------------------------------------------------*/ +/* Harbour Extention - Xbase++ does not have such implementation FOR list boxes */ +METHOD XbpListBox:setIcon( nIndex, oIcon ) + IF HB_ISNUMERIC( nIndex ) .AND. nIndex > 0 .AND. nIndex <= len( ::aItems ) .AND. HB_ISOBJECT( oIcon ) + ::aItems[ nIndex ]:setIcon( oIcon ) + RETURN .T. + ENDIF + RETURN .F. + /*----------------------------------------------------------------------*/ METHOD XbpListBox:setVisible( cItem )