From f694e217ee2de6c3ff3d04ed9a5bd36dd36f0549 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 29 Jul 2010 22:54:38 +0000 Subject: [PATCH] 2010-07-29 15:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbide.prg ! Minor. * contrib/hbide/idethemes.prg + Added: "PROCEDURE" and "THREAD" as Harbour keywords, got missed somehow. * contrib/hbide/ideedit.prg * contrib/hbide/ideskeletons.prg + Implemented: Code Snippets->execution->Ctrl+K : inserts the snippet if word under cursor is one of the name of a code snippet definition. So, if you have a snippet named "doit" then immediately after typeing "doit" you press Ctrl_K, then, instead of presenting you with menu to select a snippet, it is executed automatically. --- harbour/ChangeLog | 15 +++++++++++++ harbour/contrib/hbide/hbide.prg | 7 +++--- harbour/contrib/hbide/ideedit.prg | 2 ++ harbour/contrib/hbide/ideskeletons.prg | 31 +++++++++++++++++--------- harbour/contrib/hbide/idethemes.prg | 2 +- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 71646d01ca..3b521bc94e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-29 15:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/hbide.prg + ! Minor. + + * contrib/hbide/idethemes.prg + + Added: "PROCEDURE" and "THREAD" as Harbour keywords, got missed somehow. + + * contrib/hbide/ideedit.prg + * contrib/hbide/ideskeletons.prg + + Implemented: Code Snippets->execution->Ctrl+K : inserts the snippet + if word under cursor is one of the name of a code snippet definition. + So, if you have a snippet named "doit" then immediately after + typeing "doit" you press Ctrl_K, then, instead of presenting you + with menu to select a snippet, it is executed automatically. + 2010-07-30 00:13 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/postinst.hbs ! Missed one modification from prev. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 3c42a1047d..c931e73ed3 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -426,7 +426,7 @@ METHOD HbIde:create( aParams ) /* Load Code Skeletons */ hbide_loadSkltns( Self ) - /* Set Codec at the Begining */ + /* Set Codec at the Begining - no interface display */ HbXbp_SetCodec( ::cWrkCodec ) /* Load IDE|User defined Themes */ @@ -484,8 +484,9 @@ METHOD HbIde:create( aParams ) /* Restore Settings */ hbide_restSettings( Self ) /* Again to be displayed in Statusbar */ - HbXbp_SetCodec( ::cWrkCodec ) - ::oDK:setStatusText( SB_PNL_CODEC, ::cWrkCodec ) + //HbXbp_SetCodec( ::cWrkCodec ) + //::oDK:setStatusText( SB_PNL_CODEC, ::cWrkCodec ) + ::setCodec( ::cWrkCodec ) ::oDK:setStatusText( SB_PNL_THEME, ::cWrkTheme ) /* Display cWrkEnvironment in StatusBar */ diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index 919f28bd56..a95ea74030 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -2394,6 +2394,8 @@ FUNCTION hbide_isIndentableKeyword( cWord, oIde ) FUNCTION hbide_isHarbourKeyword( cWord, oIde ) STATIC s_b_ := { ; 'function' => NIL,; + 'procedure' => NIL,; + 'thread' => NIL,; 'return' => NIL,; 'request' => NIL,; 'static' => NIL,; diff --git a/harbour/contrib/hbide/ideskeletons.prg b/harbour/contrib/hbide/ideskeletons.prg index 0f38210f63..b5077a2a3e 100644 --- a/harbour/contrib/hbide/ideskeletons.prg +++ b/harbour/contrib/hbide/ideskeletons.prg @@ -332,19 +332,30 @@ METHOD IdeSkeletons:selectByMenuAndPostText( qEdit ) IF !empty( ::aSkltns ) qCursor := QTextCursor():from( qEdit:textCursor() ) - qRect := QRect():from( qEdit:cursorRect( qCursor ) ) - qMenu := QMenu():new( qEdit ) - FOR EACH a_ IN ::aSkltns - qMenu:addAction( a_[ 1 ] ) - NEXT + /* Look for if a macro is executed */ + qCursor:select( QTextCursor_WordUnderCursor ) + cText := qCursor:selectedText() + IF !empty( cText ) .AND. ascan( ::aSkltns, {|e_| e_[ 1 ] == cText } ) > 0 + qCursor:insertText( "" ) + qEdit:setTextCursor( qCursor ) + ::postText( qEdit, ::getText( cText ) ) - pAct := qMenu:exec_1( qEdit:mapToGlobal( QPoint():new( qRect:x(), qRect:y() ) ) ) - IF !hbqt_isEmptyQtPointer( pAct ) - qAct := QAction():from( pAct ) + ELSE + qRect := QRect():from( qEdit:cursorRect( qCursor ) ) - IF !empty( cText := ::getText( qAct:text() ) ) - ::postText( qEdit, cText ) + qMenu := QMenu():new( qEdit ) + FOR EACH a_ IN ::aSkltns + qMenu:addAction( a_[ 1 ] ) + NEXT + + pAct := qMenu:exec_1( qEdit:mapToGlobal( QPoint():new( qRect:x(), qRect:y() ) ) ) + IF !hbqt_isEmptyQtPointer( pAct ) + qAct := QAction():from( pAct ) + + IF !empty( cText := ::getText( qAct:text() ) ) + ::postText( qEdit, cText ) + ENDIF ENDIF ENDIF ENDIF diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index b7b33e3fa7..6266f59937 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -173,7 +173,7 @@ METHOD IdeThemes:create( oIde, cThemesFile ) aadd( ::aPatterns, { "PreprocessorDirectives", s, .f. } ) /* Harbour Keywords */ - b_:= { 'function','return','static','local','default', ; + b_:= { 'function','procedure','thread','return','static','local','default', ; 'if','else','elseif','endif','end', ; 'docase','case','endcase','otherwise', ; 'switch','endswitch', ;