2010-15-16 15:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbqt/hbqt_hbqplaintextedit.cpp
  * contrib/hbqt/hbqt_hbqplaintextedit.h
  * contrib/hbqt/qtgui/HBQPlainTextEdit.cpp
  * contrib/hbide/ideedit.prg
    ! More fluency and refinements in selection process spanning 
      across all three modes.
This commit is contained in:
Pritpal Bedi
2010-05-16 22:44:11 +00:00
parent dc9e6e1604
commit df85a620e5
5 changed files with 26 additions and 26 deletions

View File

@@ -17,6 +17,14 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-15-16 15:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/hbqt_hbqplaintextedit.cpp
* contrib/hbqt/hbqt_hbqplaintextedit.h
* contrib/hbqt/qtgui/HBQPlainTextEdit.cpp
* contrib/hbide/ideedit.prg
! More fluency and refinements in selection process spanning
across all three modes.
2010-05-16 23:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* debian/rules
- doc/man/hbmk.1

View File

@@ -744,7 +744,7 @@ STATIC FUNCTION hbide_qCursorDownInsert( qCursor )
METHOD IdeEdit:clearSelection()
::qEdit:hbSetSelectionInfo( { -1,-1,-1,-1,0 } )
::qEdit:hbSetSelectionInfo( { -1,-1,-1,-1,1 } )
RETURN Self
@@ -950,14 +950,14 @@ METHOD IdeEdit:deleteBlockContents( aCord )
qCursor:movePosition( QTextCursor_StartOfLine, QTextCursor_KeepAnchor )
qCursor:movePosition( QTextCursor_Right , QTextCursor_KeepAnchor, nR )
qCursor:removeSelectedText()
::qEdit:hbSetSelectionInfo( { -1,-1,-1,-1,0 } )
::qEdit:hbSetSelectionInfo( { -1,-1,-1,-1,1 } )
ELSEIF nSelMode == selectionMode_line
hbide_qPositionCursor( qCursor, nT, nL )
qCursor:movePosition( QTextCursor_Down , QTextCursor_KeepAnchor, nB - nT + 1 )
qCursor:movePosition( QTextCursor_StartOfLine, QTextCursor_KeepAnchor )
qCursor:removeSelectedText()
::qEdit:hbSetSelectionInfo( { -1,-1,-1,-1,0 } )
::qEdit:hbSetSelectionInfo( { -1,-1,-1,-1,1 } )
::isLineSelectionON := .f.
ENDIF

View File

@@ -74,6 +74,7 @@
#if QT_VERSION >= 0x040500
#include "hbqt_hbqplaintextedit.h"
#include <QApplication>
#define selectionState_off 0
#define selectionState_on 1
@@ -282,7 +283,7 @@ bool HBQPlainTextEdit::isCursorInSelection()
/*----------------------------------------------------------------------*/
void HBQPlainTextEdit::hbClearColumnSelection()
void HBQPlainTextEdit::hbClearSelection()
{
setCursorWidth( 1 );
@@ -361,7 +362,7 @@ void HBQPlainTextEdit::hbSetSelectionMode( int mode, bool on )
if( on )
{
isLineSelectionON = true;
hbClearColumnSelection();
hbClearSelection();
QTextCursor c( textCursor() );
rowBegins = c.blockNumber();
rowEnds = rowBegins;
@@ -584,7 +585,7 @@ void HBQPlainTextEdit::mouseMoveEvent( QMouseEvent *event )
if( selectionState == 1 )
{
selectionState = 2;
hbClearColumnSelection();
hbClearSelection();
}
if( columnBegins == -1 )
@@ -600,6 +601,7 @@ void HBQPlainTextEdit::mouseMoveEvent( QMouseEvent *event )
columnEnds = columnBegins;
emit selectionChanged();
QPlainTextEdit::mouseMoveEvent( event );
}
else
{
@@ -619,7 +621,6 @@ void HBQPlainTextEdit::mouseMoveEvent( QMouseEvent *event )
}
c.clearSelection();
setTextCursor( c );
event->accept();
repaint();
}
}
@@ -664,7 +665,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
{
selectionMode = selectionMode_stream;
selectionState = 0;
hbClearColumnSelection();
hbClearSelection();
repaint();
}
@@ -684,7 +685,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
if( selectionState == 0 )
{
hbClearColumnSelection();
hbClearSelection();
}
if( selectionMode == selectionMode_column )
setCursorWidth( 0 );
@@ -744,7 +745,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
break;
}
}
//HB_TRACE( HB_TR_ALWAYS, ( "0 NAV %i %i %i %i", rowBegins, columnBegins, rowEnds, columnEnds ) );
event->accept();
c.clearSelection();
setTextCursor( c );
@@ -782,9 +783,8 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
rowEnds = row;
columnEnds = col;
}
//HB_TRACE( HB_TR_ALWAYS, ( "1 NAV %i %i %i %i", rowBegins, columnBegins, rowEnds, columnEnds ) );
update();
event->accept();
//event->accept();
return true;
} // if( shift && isNavableKey( k ) )
else if( selectionMode == selectionMode_column )
@@ -871,7 +871,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
selectionState = 0;
if( columnEnds == columnBegins )
{
hbClearColumnSelection();
hbClearSelection();
}
}
}
@@ -883,8 +883,8 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
QPlainTextEdit::keyPressEvent( event );
QTextCursor c( textCursor() );
rowEnds = c.blockNumber();
event->accept();
update();
//event->accept();
repaint();
return true;
}
}
@@ -897,6 +897,7 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
{
if( hbKeyPressSelection( event ) )
{
QApplication::processEvents();
return;
}
@@ -967,15 +968,6 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
c->complete( cr ); // popup it up!
}
/*----------------------------------------------------------------------*/
#if 0
QString HBQPlainTextEdit::hbTextForPrefix()
{
QTextCursor tc = textCursor();
tc.select( QTextCursor::WordUnderCursor );
return tc.selectedText();
}
#endif
/*----------------------------------------------------------------------*/
QString HBQPlainTextEdit::hbTextUnderCursor()

View File

@@ -204,7 +204,7 @@ private slots:
void hbUpdateHorzRuler( const QRect &, int );
void hbPaintSelection( QPaintEvent * );
bool hbKeyPressSelection( QKeyEvent * );
void hbClearColumnSelection();
void hbClearSelection();
void hbUpdateCaret();
};

View File

@@ -72,7 +72,7 @@
#include "../hbqt_hbqplaintextedit.h"
/*
* HBQPlainTextEdit ( QWidget * parent = 0 )
* HBQPlainTextEdit ( QWidget * parent = 0 ) .
* HBQPlainTextEdit ( const QString & text, QWidget * parent = 0 )
* virtual ~HBQPlainTextEdit ()
*/