From 7eded4f4274d8fd3032b305437549fc4b1252788 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 17 May 2010 14:39:41 +0000 Subject: [PATCH] 2010-15-17 07:33 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/hbqt_hbqplaintextedit.cpp ! Fixed: misbehavior of "Del" key. * contrib/hbide/ideeditor.prg % Changed: hb_fGetAttr( cFile, nAttr) tested agains hb_bitAnd( nAttr, FC_READONLY ) == FC_READONLY * contrib/hbide/ideshortcuts.prg % Changed: Public Method ::toggleSelectionMode() to ::toggleColumnSelectionMode() --- harbour/ChangeLog | 11 +++++++ harbour/contrib/hbide/ideeditor.prg | 3 +- harbour/contrib/hbide/ideshortcuts.prg | 30 +++++++++---------- .../contrib/hbqt/hbqt_hbqplaintextedit.cpp | 2 +- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c8b9d84e68..407bea6465 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-15-17 07:33 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + ! Fixed: misbehavior of "Del" key. + + * contrib/hbide/ideeditor.prg + % Changed: hb_fGetAttr( cFile, nAttr) tested agains + hb_bitAnd( nAttr, FC_READONLY ) == FC_READONLY + + * contrib/hbide/ideshortcuts.prg + % Changed: Public Method ::toggleSelectionMode() to ::toggleColumnSelectionMode() + 2010-05-17 13:37 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbapi.h * harbour/src/vm/dynsym.c diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 7c3f353aa1..3217b4227f 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -69,6 +69,7 @@ #include "hbqt.ch" #include "hbide.ch" #include "xbp.ch" +#include "fileio.ch" /*----------------------------------------------------------------------*/ @@ -1100,7 +1101,7 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme, cView, a ENDIF ENDIF IF hb_fGetAttr( cSourceFile, @nAttr ) - ::lReadOnly := ( nAttr == 33 ) + ::lReadOnly := hb_bitAnd( nAttr, FC_READONLY ) == FC_READONLY ENDIF ::cType := upper( strtran( ::cExt, ".", "" ) ) diff --git a/harbour/contrib/hbide/ideshortcuts.prg b/harbour/contrib/hbide/ideshortcuts.prg index 222e0dd785..824ce6cf04 100644 --- a/harbour/contrib/hbide/ideshortcuts.prg +++ b/harbour/contrib/hbide/ideshortcuts.prg @@ -196,7 +196,7 @@ CLASS IdeShortcuts INHERIT IdeObject METHOD tabs2spaces() METHOD removeTrailingSpaces() METHOD toggleLineNumbersDisplay() - METHOD toggleSelectionMode() + METHOD toggleColumnSelectionMode() METHOD toggleStatusBar() METHOD toggleLineSelectionMode() METHOD presentSkeletons() @@ -1105,9 +1105,6 @@ METHOD IdeShortcuts:removeTrailingSpaces() METHOD IdeShortcuts:toggleLineNumbersDisplay() RETURN ::oEM:toggleLineNumbers() /*----------------------------------------------------------------------*/ -METHOD IdeShortcuts:toggleSelectionMode() - RETURN ::oEM:toggleSelectionMode() -/*----------------------------------------------------------------------*/ METHOD IdeShortcuts:toggleStatusBar() IF ::lStatusBarVisible ::oSBar:oWidget:hide() @@ -1117,24 +1114,27 @@ METHOD IdeShortcuts:toggleStatusBar() ::oIde:lStatusBarVisible := ! ::lStatusBarVisible RETURN Self /*----------------------------------------------------------------------*/ -METHOD IdeShortcuts:toggleLineSelectionMode() - RETURN ::oEM:toggleLineSelectionMode() -/*----------------------------------------------------------------------*/ METHOD IdeShortcuts:presentSkeletons() RETURN ::oEM:presentSkeletons() /*----------------------------------------------------------------------*/ METHOD IdeShortcuts:gotoFunction() RETURN ::oEM:gotoFunction() /*----------------------------------------------------------------------*/ -METHOD IdeShortcuts:clearSelection() - RETURN ::oEM:clearSelection() -/*----------------------------------------------------------------------*/ METHOD IdeShortcuts:execPlugin( cPlugin, ... ) RETURN hbide_execPlugin( cPlugin, ::oIde, ... ) /*----------------------------------------------------------------------*/ METHOD IdeShortcuts:toggleCurrentLineHilight() RETURN ::oEM:toggleCurrentLineHighlightMode() /*----------------------------------------------------------------------*/ +METHOD IdeShortcuts:toggleColumnSelectionMode() + RETURN ::oEM:toggleColumnSelectionMode() +/*----------------------------------------------------------------------*/ +METHOD IdeShortcuts:toggleLineSelectionMode() + RETURN ::oEM:toggleLineSelectionMode() +/*----------------------------------------------------------------------*/ +METHOD IdeShortcuts:clearSelection() + RETURN ::oEM:clearSelection() +/*----------------------------------------------------------------------*/ METHOD IdeShortcuts:loadMethods() @@ -1298,18 +1298,18 @@ METHOD IdeShortcuts:loadMethods() aadd( ::aMethods, { 'toggleLineNumbersDisplay()', ; 'toggleLineNumbersDisplay()', ; 'Toggles line numbers display inside editing instances. This action has global scope and is saved for next run.' } ) - aadd( ::aMethods, { 'toggleSelectionMode()', ; - 'toggleSelectionMode()', ; + aadd( ::aMethods, { 'toggleColumnSelectionMode()', ; + 'toggleColumnSelectionMode()', ; 'Toggles selection mode from "stream" to "column" or vice-versa.' } ) - aadd( ::aMethods, { 'toggleStatusBar()', ; - 'toggleStatusBar()', ; - 'Toggles display of statusbar. The action is not saved for next run.' } ) aadd( ::aMethods, { 'toggleLineSelectionMode()', ; 'toggleLineSelectionMode()', ; 'Toggles line selection mode.' } ) aadd( ::aMethods, { 'clearSelection()', ; 'clearSelection()', ; 'Clears the selection block, if any, and resets the selection mode to stream.' } ) + aadd( ::aMethods, { 'toggleStatusBar()', ; + 'toggleStatusBar()', ; + 'Toggles display of statusbar. The action is not saved for next run.' } ) aadd( ::aMethods, { 'presentSkeletons()', ; 'presentSkeletons()', ; 'Present snippets for selection.' } ) diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 383f184813..96f61c9c5e 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -844,7 +844,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event ) } else if( selectionMode == selectionMode_stream || selectionMode == selectionMode_line ) { - if( selectionState > 0 && ! ctrl && k == Qt::Key_Delete ) + if( selectionState > 0 && ! ctrl && k == Qt::Key_Delete && columnBegins >= 0 ) { hbCut( k ); repaint();