diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6d315f7c68..89ae949b9f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-25 01:44 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + ! Fix to handle space key when code completion popup is visible. + + * contrib/hbide/ideeditor.prg + ! Corresponding fix to above one. + + * contrib/hbide/idethemes.prg + + Added more Harbour keywords to be distinguished in color. + 2010-04-25 01:32 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbxbp/xbp3state.prg * contrib/hbxbp/xbpappevent.prg diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 823bf0825d..a479dd59f8 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -1664,7 +1664,7 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) EXIT CASE cursorPositionChanged - // HB_TRACE( HB_TR_ALWAYS, "cursorPositionChanged()", ::nProtoLine, ::nProtoCol, ::isSuspended, ::getLineNo(), ::getColumnNo(), ::cProto ) + //HB_TRACE( HB_TR_ALWAYS, "cursorPositionChanged()", ::nProtoLine, ::nProtoCol, ::isSuspended, ::getLineNo(), ::getColumnNo(), ::cProto ) ::oEditor:dispEditInfo( qEdit ) ::handlePreviousWord( ::lUpdatePrevWord ) ::handleCurrentIndent() @@ -1806,7 +1806,7 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 ) ::moveLine( -1 ) RETURN .t. ENDIF - EXIT + EXIT CASE Qt_Key_Down IF lCtrl .AND. lShift ::moveLine( 1 ) @@ -1857,6 +1857,9 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 ) ::lCopyWhenDblClicked := .f. /* not intuitive */ ::clickFuncHelp() + ELSEIF p == 21001 + ::handlePreviousWord( .t. ) + ELSEIF p == QEvent_Paint // ::oIde:testPainter( p1 ) @@ -2187,6 +2190,8 @@ METHOD IdeEdit:insertText( cText ) METHOD IdeEdit:handlePreviousWord( lUpdatePrevWord ) LOCAL qCursor, qTextBlock, cText, cWord, nB, nL, qEdit, lPrevOnly, nCol, nSpace, nSpaces, nOff + * HB_TRACE( HB_TR_ALWAYS, "IdeEdit:handlePreviousWord( lUpdatePrevWord )", lUpdatePrevWord ) + IF ! lUpdatePrevWord RETURN Self ENDIF @@ -2362,7 +2367,7 @@ METHOD IdeEdit:resumePrototype() IF !empty( ::qEdit ) IF ::getLineNo() == ::nProtoLine .AND. ::getColumnNo() >= ::nProtoCol ::qEdit:hbShowPrototype( ::cProto ) - ENDIF + ENDIF ENDIF RETURN Self @@ -2565,7 +2570,9 @@ FUNCTION hbide_isHarbourKeyword( cWord ) 'recover' => NIL,; 'hb_symbol_unused' => NIL,; 'error' => NIL,; - 'handler' => NIL } + 'handler' => NIL,; + '.or.' => NIL,; + '.and.' => NIL } RETURN Lower( cWord ) $ s_b_ diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index cf203fc599..20da6aeab5 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -198,7 +198,7 @@ METHOD IdeThemes:create( oIde, cIniFile ) 'class','endclass','method','data','var','destructor','inline','assign','access',; 'inherit','init','create','virtual','message',; 'begin','sequence','try','catch','always','recover','hb_symbol_unused', ; - 'error','handler' } + 'error','handler','setget','.and.' } s := ""; aeval( b_, {|e| s += iif( empty( s ), "", "|" ) + "\b" + upper( e ) + "\b|\b" + e + "\b" } ) aadd( ::aPatterns, { "HarbourKeywords" , s } ) diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 46484ccdfe..3a5c2f2004 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -190,6 +190,14 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event ) case Qt::Key_Backtab: event->ignore(); return; // let the completer do default behavior + case Qt::Key_Space: + if( block ) + { + PHB_ITEM p1 = hb_itemPutNI( NULL, 21001 ); + hb_vmEvalBlockV( block, 1, p1 ); + hb_itemRelease( p1 ); + } + break; default: break; } @@ -210,7 +218,7 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event ) if( ( ctrlOrShift && event->text().isEmpty() ) ) return; - static QString eow( "~!@#$%^&*()+{}|:\"<>?,./;'[]\\-=" ); /* end of word */ + static QString eow( " ~!@#$%^&*()+{}|:\"<>?,./;'[]\\-=" ); /* end of word */ bool hasModifier = ( event->modifiers() != Qt::NoModifier ) && !ctrlOrShift; QString completionPrefix = hbTextUnderCursor();