diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8c70b3fecf..1fc773a988 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-10 19:05 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/doc/en/class_hbqplaintextedit.txt + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + * contrib/hbqt/hbqt_hbqplaintextedit.h + * contrib/hbqt/qtgui/HBQPlainTextEdit.cpp + * contrib/hbqt/qtgui/THBQPlainTextEdit.prg + * contrib/hbqt/qth/HBQPlainTextEdit.qth + + + Prepared to manage current line and line area colors. + 2010-03-10 17:05 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/doc/en/class_hbqplaintextedit.txt * contrib/hbqt/hbqt_hbqplaintextedit.cpp diff --git a/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt b/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt index d5d9a7dd19..957db6aa59 100644 --- a/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt +++ b/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt @@ -5,7 +5,7 @@ * * Pritpal Bedi * - * 03/10/10 - 14:17:24 + * 03/10/10 - 19:03:11 * */ @@ -68,6 +68,8 @@ :hbTextUnderCursor() -> cQString :hbShowPrototype( cTip ) -> NIL :hbSetCompleter( pCompleter ) -> NIL + :hbSetCurrentLineColor( pColor ) -> NIL + :hbSetLineAreaBkColor( pColor ) -> NIL $DESCRIPTION$ diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 7a9f208c11..6066d08692 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -95,6 +95,7 @@ HBQPlainTextEdit::HBQPlainTextEdit( QWidget * parent ) : QPlainTextEdit( parent connect( this, SIGNAL( cursorPositionChanged() ) , this, SLOT( hbSlotCursorPositionChanged() ) ); m_currentLineColor.setNamedColor( "#e8e8ff" ); + m_lineAreaBkColor.setNamedColor( "#e4e4e4" ); } HBQPlainTextEdit::~HBQPlainTextEdit() @@ -295,7 +296,7 @@ void HBQPlainTextEdit::paintEvent( QPaintEvent * event ) void HBQPlainTextEdit::lineNumberAreaPaintEvent( QPaintEvent *event ) { QPainter painter( lineNumberArea ); - painter.fillRect( event->rect(), QColor( "#e4e4e4" ) ); + painter.fillRect( event->rect(), m_lineAreaBkColor ); QTextBlock block = firstVisibleBlock(); int blockNumber = block.blockNumber(); diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h index efeb54e746..82357adce9 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h @@ -82,6 +82,7 @@ public: PHB_ITEM block; QColor m_currentLineColor; + QColor m_lineAreaBkColor; long m_matchingBegin; long m_matchingEnd; @@ -160,6 +161,8 @@ public slots: bool hbNumberBlockVisible(); void hbShowPrototype( const QString & tip ); void hbSetCompleter( QCompleter * completer ) { c = completer; }; + void hbSetCurrentLineColor( const QColor & color ) { m_currentLineColor = color; }; + void hbSetLineAreaBkColor( const QColor & color ) { m_lineAreaBkColor = color; }; private slots: void hbSlotCursorPositionChanged(); diff --git a/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp b/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp index 7906d801c6..6000293f7f 100644 --- a/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp +++ b/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp @@ -434,6 +434,22 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT_HBSETCOMPLETER ) hbqt_par_HBQPlainTextEdit( 1 )->hbSetCompleter( hbqt_par_QCompleter( 2 ) ); } +/* + * void hbSetCurrentLineColor( const QColor & color ) + */ +HB_FUNC( QT_HBQPLAINTEXTEDIT_HBSETCURRENTLINECOLOR ) +{ + hbqt_par_HBQPlainTextEdit( 1 )->hbSetCurrentLineColor( *hbqt_par_QColor( 2 ) ); +} + +/* + * void hbSetLineAreaBkColor( const QColor & color ) + */ +HB_FUNC( QT_HBQPLAINTEXTEDIT_HBSETLINEAREABKCOLOR ) +{ + hbqt_par_HBQPlainTextEdit( 1 )->hbSetLineAreaBkColor( *hbqt_par_QColor( 2 ) ); +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg b/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg index 1795a11761..9e1105ea66 100644 --- a/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg +++ b/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg @@ -102,6 +102,8 @@ CREATE CLASS HBQPlainTextEdit INHERIT HbQtObjectHandler, QPlainTextEdit METHOD hbTextUnderCursor() METHOD hbShowPrototype( cTip ) METHOD hbSetCompleter( pCompleter ) + METHOD hbSetCurrentLineColor( pColor ) + METHOD hbSetLineAreaBkColor( pColor ) ENDCLASS @@ -254,3 +256,11 @@ METHOD HBQPlainTextEdit:hbShowPrototype( cTip ) METHOD HBQPlainTextEdit:hbSetCompleter( pCompleter ) RETURN Qt_HBQPlainTextEdit_hbSetCompleter( ::pPtr, hbqt_ptr( pCompleter ) ) + +METHOD HBQPlainTextEdit:hbSetCurrentLineColor( pColor ) + RETURN Qt_HBQPlainTextEdit_hbSetCurrentLineColor( ::pPtr, hbqt_ptr( pColor ) ) + + +METHOD HBQPlainTextEdit:hbSetLineAreaBkColor( pColor ) + RETURN Qt_HBQPlainTextEdit_hbSetLineAreaBkColor( ::pPtr, hbqt_ptr( pColor ) ) + diff --git a/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth b/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth index 26eafa09ee..196e8bc780 100644 --- a/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth +++ b/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth @@ -133,6 +133,8 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT ) QString hbTextUnderCursor() void hbShowPrototype( const QString & tip ) void hbSetCompleter( QCompleter * completer ) + void hbSetCurrentLineColor( const QColor & color ) + void hbSetLineAreaBkColor( const QColor & color )