2010-04-27 19:06 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbxbp/xbplistbox.prg
    + setItemColorFG( nIndex, aRGB )

  * contrib/hbide/ideeditor.prg
    + Implemented: current function the cursor is navigating 
      highlighted in the Functions List.
This commit is contained in:
Pritpal Bedi
2010-04-28 02:02:36 +00:00
parent 1dc08dcbf2
commit eb50c3f64c
3 changed files with 52 additions and 0 deletions

View File

@@ -17,6 +17,14 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-04-27 19:06 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbxbp/xbplistbox.prg
+ setItemColorFG( nIndex, aRGB )
* contrib/hbide/ideeditor.prg
+ Implemented: current function the cursor is navigating
highlighted in the Functions List.
2010-04-28 01:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rtl/cdpapi.c
* harbour/src/rtl/cdpapihb.c

View File

@@ -1394,6 +1394,7 @@ CLASS IdeEdit INHERIT IdeObject
DATA nLastLine INIT -99
DATA nCurLineNo INIT 0
DATA nPrevLineNo INIT -1
DATA nPrevLineNo1 INIT -1
DATA aBookMarks INIT {}
@@ -1468,6 +1469,7 @@ CLASS IdeEdit INHERIT IdeObject
METHOD refresh()
METHOD isModified() INLINE ::oEditor:qDocument:isModified()
METHOD setFont()
METHOD markCurrentFunction()
ENDCLASS
@@ -1688,6 +1690,8 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 )
::handlePreviousWord( ::lUpdatePrevWord )
::handleCurrentIndent()
::markCurrentFunction()
IF ::nProtoLine != -1
nLine := ::getLineNo()
IF ! ::isSuspended
@@ -1891,6 +1895,30 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 )
/*----------------------------------------------------------------------*/
METHOD IdeEdit:markCurrentFunction()
LOCAL n, nCurLine
IF ::nPrevLineNo1 != ::getLineNo()
::nPrevLineNo1 := ::getLineNo()
IF !empty( ::aTags )
nCurLine := ::getLineNo()
IF len( ::aTags ) == 1
n := 1
ELSEIF ( n := ascan( ::aTags, {|e_| e_[ 3 ] >= nCurLine } ) ) == 0
n := len( ::aTags )
ELSEIF n > 0
n--
ENDIF
IF n > 0
::oIde:oFuncList:setItemColorFG( n, { 255,0,0 } )
ENDIF
ENDIF
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEdit:presentSkeletons()
::oSK:selectByMenuAndPostText( ::qEdit )

View File

@@ -86,6 +86,8 @@ CLASS XbpListBox INHERIT XbpWindow, XbpDataRef
DATA oStrModel
DATA aItems INIT {}
DATA nOldIndex INIT 0
METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject )
@@ -118,6 +120,7 @@ CLASS XbpListBox INHERIT XbpWindow, XbpDataRef
METHOD toggleSelected( nIndex )
METHOD connectAll()
METHOD disConnectAll()
METHOD setItemColorFG( nIndex, aRGB )
DATA sl_hScroll
@@ -408,6 +411,19 @@ METHOD XbpListBox:setItem( nIndex, cItem )
/*----------------------------------------------------------------------*/
METHOD XbpListBox:setItemColorFG( nIndex, aRGB )
IF hb_isNumeric( nIndex ) .AND. nIndex > 0 .AND. nIndex <= len( ::aItems )
IF ::nOldIndex > 0 .AND. nIndex <= len( ::aItems )
::aItems[ ::nOldIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( 0,0,0 ) ) )
ENDIF
::aItems[ nIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( aRGB[ 1 ], aRGB[ 2 ], aRGB[ 3 ] ) ) )
::nOldIndex := nIndex
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpListBox:itemMarked( ... )
LOCAL a_:= hb_aParams()
IF len( a_ ) == 1 .AND. hb_isBlock( a_[ 1 ] )