diff --git a/harbour/ChangeLog b/harbour/ChangeLog index eda0b88a60..79de8d2121 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,23 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-28 08:29 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbplistbox.prg + + Added: method :setVisible(). + + * contrib/hbide/ideedit.prg + * contrib/hbide/hbide.prg + + Implemented: "Functions List" now supports "Sorted" and "Natural Order" + display which is switchable via right-click context menu. + + * contrib/hbide/idedocks.prg + % Fixed: a rare bug where if hbIDE is minimized by any other action + than clicking on the "Minimize" title-bar icon on the right, + on restoration it was producing RTE. + + * contrib/hbide/idesaveload.prg + + Added: ::aDictionaries instance variable. Futuristic implementation. + 2010-07-28 14:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/postinst.hbs ! Synced mandriva linux distro abbrev with rpm .spec files. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 9c480108a3..3c42a1047d 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -311,7 +311,7 @@ CLASS HbIde METHOD updateProjectTree( aPrj ) METHOD manageItemSelected( oXbpTreeItem ) METHOD manageProjectContext( mp1, mp2, oXbpTreeItem ) - METHOD updateFuncList() + METHOD updateFuncList( lSorted ) METHOD gotoFunction( mp1, mp2, oListBox ) METHOD manageFuncContext( mp1 ) METHOD createTags() @@ -1271,12 +1271,20 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem ) /*----------------------------------------------------------------------*/ -METHOD HbIde:updateFuncList() - LOCAL o +METHOD HbIde:updateFuncList( lSorted ) + LOCAL a_:={} + + DEFAULT lSorted TO .t. ::oFuncList:clear() IF !empty( ::aTags ) - aeval( ::aTags, {|e_| o := ::oFuncList:addItem( e_[ 7 ] ) } ) + IF lSorted + aeval( ::aTags, {|e_| aadd( a_, e_[ 7 ] ) } ) + asort( a_, , , {|e,f| lower( e ) < lower( f ) } ) + aeval( a_, {|e| ::oFuncList:addItem( e ) } ) + ELSE + aeval( ::aTags, {|e_| ::oFuncList:addItem( e_[ 7 ] ) } ) + ENDIF ENDIF RETURN Self @@ -1310,6 +1318,9 @@ METHOD HbIde:manageFuncContext( mp1 ) LOCAL aPops := {} IF ::oFuncList:numItems() > 0 + aadd( aPops, { 'Show Sorted' , {|| ::updateFuncList( .t. ) } } ) + aadd( aPops, { 'Show in Natural Order' , {|| ::updateFuncList( .f. ) } } ) + aadd( aPops, { "" } ) aadd( aPops, { 'Comment out' , {|| NIL } } ) aadd( aPops, { 'Reformat' , {|| NIL } } ) aadd( aPops, { 'Print' , {|| NIL } } ) diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index ac0f936543..8366012e89 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -86,7 +86,7 @@ CLASS IdeDocks INHERIT IdeObject DATA lChanging INIT .f. DATA qTimer - DATA nPrevWindowState + DATA nPrevWindowState INIT Qt_WindowNoState DATA lSystemTrayAvailable INIT .f. DATA lMinimizeInSystemTray INIT .t. // .f. DATA qAct1 diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index 7f3d230d7a..919f28bd56 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -1317,7 +1317,8 @@ METHOD IdeEdit:markCurrentFunction() n-- ENDIF IF n > 0 - ::oIde:oFuncList:setItemColorFG( n, { 255,0,0 } ) + ::oIde:oFuncList:setItemColorFG( ::aTags[ n,7 ], { 255,0,0 } ) + ::oIde:oFuncList:setVisible( ::aTags[ n,7 ] ) ENDIF ENDIF ENDIF diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index cfecc374f1..146c877a7e 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -132,6 +132,7 @@ CLASS IdeINI INHERIT IdeObject DATA aKeywords INIT {} DATA aDbuPanelNames INIT {} DATA aDbuPanelsInfo INIT {} + DATA aDictionaries INIT {} DATA cFontName INIT "Courier New" DATA nPointSize INIT 10 @@ -458,6 +459,13 @@ METHOD IdeINI:save( cHbideIni ) NEXT aadd( txt_, " " ) + aadd( txt_, "[DICTIONARIES]" ) + aadd( txt_, " " ) + FOR EACH s IN ::aDictionaries + aadd( txt_, "dictionary_" + hb_ntos( s:__enumIndex() ) + "=" + s ) + NEXT + aadd( txt_, " " ) + aadd( txt_, "[General]" ) aadd( txt_, " " ) @@ -532,6 +540,9 @@ METHOD IdeINI:load( cHbideIni ) CASE "[APPTHEMES]" nPart := "INI_APPTHEMES" EXIT + CASE "[DICTIONARIES]" + nPart := "INI_DICTIONARIES" + EXIT OTHERWISE DO CASE CASE Left( s, 1 ) $ '#[' @@ -693,6 +704,11 @@ METHOD IdeINI:load( cHbideIni ) aadd( ::aAppThemes, cVal ) ENDIF + CASE nPart == "INI_DICTIONARIES" + IF hbide_parseKeyValPair( s, @cKey, @cVal ) + aadd( ::aDictioaries, cVal ) + ENDIF + ENDCASE EXIT ENDSWITCH @@ -909,6 +925,7 @@ CLASS IdeSetup INHERIT IdeObject DATA aStyles INIT { "cleanlooks", "windows", "windowsxp", ; "windowsvista", "cde", "motif", "plastique", "macintosh" } DATA aKeyItems INIT {} + DATA aDictionaries INIT {} DATA nCurThemeSlot INIT 0 DATA aHilighters INIT {} @@ -1003,6 +1020,9 @@ METHOD IdeSetup:setIcons() ::oUI:q_buttonThmApp : setIcon( hbide_image( "copy" ) ) ::oUI:q_buttonThmSav : setIcon( hbide_image( "save" ) ) + /* Dictionaries */ + ::oUI:q_buttonDictPath : setIcon( hbide_image( "open" ) ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -1063,6 +1083,9 @@ METHOD IdeSetup:disConnectSlots() ::disconnect( ::oUI:q_buttonViewSnippets , "clicked()" ) ::disconnect( ::oUI:q_buttonViewThemes , "clicked()" ) + /* Dictionaries */ + ::disconnect( ::oUI:q_buttonDictPath , "clicked()" ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -1123,6 +1146,9 @@ METHOD IdeSetup:connectSlots() ::connect( ::oUI:q_buttonViewSnippets , "clicked()" , {| | ::execEvent( "buttonViewSnippets_clicked" ) } ) ::connect( ::oUI:q_buttonViewThemes , "clicked()" , {| | ::execEvent( "buttonViewThemes_clicked" ) } ) + /* Dictionaries */ + ::connect( ::oUI:q_buttonDictPath , "clicked()" , {| | ::execEvent( "buttonDictPath_clicked" ) } ) + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index e524eaf647..1a5c26571f 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -111,6 +111,7 @@ CLASS XbpListBox INHERIT XbpWindow, XbpDataRef METHOD getItem( nIndex ) METHOD insItem( nIndex, cItem ) METHOD setItem( nIndex, cItem ) + METHOD setVisible( cItem ) METHOD getTabstops() VIRTUAL METHOD setColumnWidth() VIRTUAL @@ -411,6 +412,17 @@ METHOD XbpListBox:setItem( nIndex, cItem ) /*----------------------------------------------------------------------*/ +METHOD XbpListBox:setVisible( cItem ) + LOCAL nIndex + + IF ( nIndex := ascan( ::aItems, {|o| o:text() == cItem } ) ) > 0 + ::oWidget:scrollToItem( ::aItems[ nIndex ] ) + ENDIF + + RETURN Self + +/*------------------------------------------------------------------------*/ + METHOD XbpListBox:setItemColorFG( nIndex, aRGB ) IF hb_isNumeric( nIndex ) .AND. nIndex > 0 .AND. nIndex <= len( ::aItems ) @@ -419,6 +431,15 @@ METHOD XbpListBox:setItemColorFG( nIndex, aRGB ) ENDIF ::aItems[ nIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( aRGB[ 1 ], aRGB[ 2 ], aRGB[ 3 ] ) ) ) ::nOldIndex := nIndex + + ELSEIF hb_isChar( nIndex ) + IF ( nIndex := ascan( ::aItems, {|o| o:text() == nIndex } ) ) > 0 + IF ::nOldIndex > 0 .AND. ::nOldIndex <= 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 ENDIF RETURN Self