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.
This commit is contained in:
Pritpal Bedi
2010-03-11 03:02:12 +00:00
parent 4788dd88da
commit 77b6fa93eb
7 changed files with 46 additions and 2 deletions

View File

@@ -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

View File

@@ -5,7 +5,7 @@
*
* Pritpal Bedi <bedipritpal@hotmail.com>
*
* 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$

View File

@@ -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();

View File

@@ -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();

View File

@@ -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 */

View File

@@ -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 ) )

View File

@@ -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 )
</SLOTS>
<SIGNALS>