From cea5e4a6eb6c6a74c670e75eca4eb177c67ced3f Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 30 Nov 2009 17:28:12 +0000 Subject: [PATCH] 2009-11-30 09:11 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/hbide.prg * contrib/hbqt/generator/qt45.qtp * contrib/hbqt/hbqt.h * contrib/hbqt/hbqt_garbage.h * contrib/hbqt/qtgui/filelist.mk + contrib/hbqt/qtgui/QPlainTextEdit.cpp + contrib/hbqt/qtgui/TQPlainTextEdit.prg + contrib/hbqt/qth/QPlainTextEdit.qth * contrib/hbxbp/xbplistbox.prg * contrib/hbxbp/xbptabpage.prg + Added QPlainTextEdit class. This class is now used in HBIDE instead of QTextEdit as it is highly optimized for large text documents and is considerably faster. + Implemented tooltips for XbpListBox() class while mouse is hovered upon an item. The expression is manifest i HBIDE's exactly as is with xMate. --- harbour/ChangeLog | 25 + harbour/contrib/hbide/hbide.prg | 43 +- harbour/contrib/hbqt/generator/qt45.qtp | 1 + harbour/contrib/hbqt/hbqt.h | 1 + harbour/contrib/hbqt/hbqt_garbage.h | 2 + harbour/contrib/hbqt/qtgui/QPlainTextEdit.cpp | 648 ++++++++++++++++++ .../contrib/hbqt/qtgui/TQPlainTextEdit.prg | 375 ++++++++++ harbour/contrib/hbqt/qtgui/filelist.mk | 2 + harbour/contrib/hbqt/qth/QPlainTextEdit.qth | 181 +++++ harbour/contrib/hbxbp/xbplistbox.prg | 6 +- harbour/contrib/hbxbp/xbptabpage.prg | 4 +- 11 files changed, 1263 insertions(+), 25 deletions(-) create mode 100644 harbour/contrib/hbqt/qtgui/QPlainTextEdit.cpp create mode 100644 harbour/contrib/hbqt/qtgui/TQPlainTextEdit.prg create mode 100644 harbour/contrib/hbqt/qth/QPlainTextEdit.qth diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a2ea936e78..4944622374 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,31 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-30 09:11 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/hbide.prg + + * contrib/hbqt/generator/qt45.qtp + + * contrib/hbqt/hbqt.h + * contrib/hbqt/hbqt_garbage.h + + * contrib/hbqt/qtgui/filelist.mk + + contrib/hbqt/qtgui/QPlainTextEdit.cpp + + contrib/hbqt/qtgui/TQPlainTextEdit.prg + + + contrib/hbqt/qth/QPlainTextEdit.qth + + * contrib/hbxbp/xbplistbox.prg + * contrib/hbxbp/xbptabpage.prg + + + Added QPlainTextEdit class. + This class is now used in HBIDE instead of QTextEdit as it is + highly optimized for large text documents and is considerably faster. + + + Implemented tooltips for XbpListBox() class while mouse is hovered + upon an item. The expression is manifest i HBIDE's exactly + as is with xMate. + 2009-11-30 16:51 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh - removed not longer working HB_DB_DRVEXT diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 4ace222c3a..250a22a27a 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -241,7 +241,6 @@ METHOD HbIde:create( cProjIni ) ::loadConfig( cProjIni ) ::BuildDialog() -HBXBP_DEBUG( 133 ) ::oDa := ::oDlg:drawingArea SetAppWindow( ::oDlg ) ::oDlg:Show() @@ -441,7 +440,6 @@ METHOD HbIde:loadConfig( cHbideIni ) HBXBP_DEBUG( hb_dirBase(), cHbideIni ) ::cProjIni := cHbideIni - ::aIni := { afill( array( 7 /*INI_HBIDE_VRBLS*/ ), "" ), {}, {} } IF file( ::cProjIni ) #if 0 @@ -464,6 +462,7 @@ METHOD HbIde:loadConfig( cHbideIni ) #endif + ::aIni := { array( 7 /*INI_HBIDE_VRBLS*/ ), {}, {} } aElem := ReadSource( ::cProjIni ) FOR EACH s IN aElem @@ -500,8 +499,6 @@ METHOD HbIde:loadConfig( cHbideIni ) NEXT ENDIF - HBXBP_DEBUG( "Filled Defaults" ) - RETURN Self /*----------------------------------------------------------------------*/ @@ -632,7 +629,7 @@ METHOD HbIde:convertSelection( cKey ) nL := len( cBuffer ) nB := qCursor:position() - nL - //qCursor:beginEditBlock() + qCursor:beginEditBlock() HBXBP_DEBUG( "BEFORE REMOVE", qCursor:position() ) qCursor:removeSelectedText() HBXBP_DEBUG( "BEFORE INSERT", qCursor:position() ) @@ -644,7 +641,7 @@ HBXBP_DEBUG( "AFTER SET ", qCursor:position() ) ::qCurEdit:find( cBuffer, QTextDocument_FindCaseSensitively ) HBXBP_DEBUG( "AFTER FIND ", qCursor:position() ) //qCursor:movePosition( QTextCursor_NextCharacter, QTextCursor_KeepAnchor, nL ) - //qCursor:endEditBlock() + qCursor:endEditBlock() ENDIF ENDIF @@ -663,10 +660,11 @@ METHOD HbIde:manageFocusInEditor() /*----------------------------------------------------------------------*/ METHOD HbIde:updateFuncList() + LOCAL o ::oFuncList:clear() IF !empty( ::aTags ) - aeval( ::aTags, {|e_| ::oFuncList:addItem( e_[ 7 ] ) } ) + aeval( ::aTags, {|e_| o := ::oFuncList:addItem( e_[ 7 ] ) } ) ENDIF RETURN Self @@ -717,11 +715,15 @@ METHOD HbIde:editSource( cSourceFile ) oTab := ::buildTabPage( ::oDa, cSourceFile ) + #if 0 qEdit := QTextEdit():new( QT_PTROFXBP( oTab ) ) - qEdit:setLineWrapMode( QTextEdit_NoWrap ) - qEdit:setPlainText( memoread( cSourceFile ) ) - qEdit:setFont( QT_PTROFXBP( ::oFont ) ) qEdit:setTextBackgroundColor( QT_PTROF( QColor():new( 255,255,255 ) ) ) + #else + qEdit := QPlainTextEdit():new( QT_PTROFXBP( oTab ) ) + #endif + qEdit:setPlainText( memoread( cSourceFile ) ) + qEdit:setLineWrapMode( QTextEdit_NoWrap ) + qEdit:setFont( QT_PTROFXBP( ::oFont ) ) qDocument := QTextDocument():configure( qEdit:document() ) @@ -755,12 +757,11 @@ METHOD HbIde:editSource( cSourceFile ) METHOD HbIde:loadSources() LOCAL i - IF !empty( ::aIni[ INI_FILES ] ) - FOR i := 1 TO len( ::aIni[ INI_FILES ] ) - ::editSource( ::aIni[ INI_FILES, i ] ) - NEXT - ::qTabWidget:setCurrentIndex( val( ::aIni[ INI_HBIDE, RecentTabIndex ] ) ) - ENDIF + FOR i := 1 TO len( ::aIni[ INI_FILES ] ) + ::editSource( ::aIni[ INI_FILES, i ] ) + NEXT + ::qTabWidget:setCurrentIndex( val( ::aIni[ INI_HBIDE, RecentTabIndex ] ) ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -1125,13 +1126,11 @@ METHOD HbIde:buildFuncList() METHOD HbIde:setPosAndSizeByIni( qWidget, nPart ) LOCAL aRect - IF !empty( ::aIni[ INI_HBIDE, nPart ] ) - aRect := hb_atokens( ::aIni[ INI_HBIDE, nPart ], "," ) - aeval( aRect, {|e,i| aRect[ i ] := val( e ) } ) + aRect := hb_atokens( ::aIni[ INI_HBIDE, nPart ], "," ) + aeval( aRect, {|e,i| aRect[ i ] := val( e ) } ) - qWidget:move( aRect[ 1 ], aRect[ 2 ] ) - qWidget:resize( aRect[ 3 ], aRect[ 4 ] ) - ENDIF + qWidget:move( aRect[ 1 ], aRect[ 2 ] ) + qWidget:resize( aRect[ 3 ], aRect[ 4 ] ) RETURN Self diff --git a/harbour/contrib/hbqt/generator/qt45.qtp b/harbour/contrib/hbqt/generator/qt45.qtp index 18b844ff8c..f6c2c3080e 100644 --- a/harbour/contrib/hbqt/generator/qt45.qtp +++ b/harbour/contrib/hbqt/generator/qt45.qtp @@ -143,6 +143,7 @@ QPalette.qth QPen.qth QPicture.qth QPixmap.qth +QPlainTextEdit.qth QPoint.qth QPointF.qth QPolygon.qth diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index 50fbd88687..7089faaa6e 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -227,6 +227,7 @@ const HB_GC_FUNCS * gcFuncs( void ); #define hbqt_par_QPen( n ) ( ( QPen * ) hbqt_gcpointer( n ) ) #define hbqt_par_QPicture( n ) ( ( QPicture * ) hbqt_gcpointer( n ) ) #define hbqt_par_QPixmap( n ) ( ( QPixmap * ) hbqt_gcpointer( n ) ) +#define hbqt_par_QPlainTextEdit( n ) ( ( QPlainTextEdit * ) hbqt_gcpointer( n ) ) #define hbqt_par_QPoint( n ) ( ( QPoint * ) hbqt_gcpointer( n ) ) #define hbqt_par_QPointF( n ) ( ( QPointF * ) hbqt_gcpointer( n ) ) #define hbqt_par_QPolygon( n ) ( ( QPolygon * ) hbqt_gcpointer( n ) ) diff --git a/harbour/contrib/hbqt/hbqt_garbage.h b/harbour/contrib/hbqt/hbqt_garbage.h index 1fc1c2cb1b..6f98fc1758 100644 --- a/harbour/contrib/hbqt/hbqt_garbage.h +++ b/harbour/contrib/hbqt/hbqt_garbage.h @@ -137,6 +137,7 @@ extern QT_G_FUNC( release_QPalette ); extern QT_G_FUNC( release_QPen ); extern QT_G_FUNC( release_QPicture ); extern QT_G_FUNC( release_QPixmap ); +extern QT_G_FUNC( release_QPlainTextEdit ); extern QT_G_FUNC( release_QPoint ); extern QT_G_FUNC( release_QPointF ); extern QT_G_FUNC( release_QPolygon ); @@ -406,6 +407,7 @@ extern void * gcAllocate_QPalette( void * pObj ); extern void * gcAllocate_QPen( void * pObj ); extern void * gcAllocate_QPicture( void * pObj ); extern void * gcAllocate_QPixmap( void * pObj ); +extern void * gcAllocate_QPlainTextEdit( void * pObj ); extern void * gcAllocate_QPoint( void * pObj ); extern void * gcAllocate_QPointF( void * pObj ); extern void * gcAllocate_QPolygon( void * pObj ); diff --git a/harbour/contrib/hbqt/qtgui/QPlainTextEdit.cpp b/harbour/contrib/hbqt/qtgui/QPlainTextEdit.cpp new file mode 100644 index 0000000000..1acb515438 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/QPlainTextEdit.cpp @@ -0,0 +1,648 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +/* + * enum LineWrapMode { NoWrap, WidgetWidth } + */ + +/* + * Constructed[ 57/64 [ 89.06% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * QList extraSelections () const + * void setExtraSelections ( const QList & selections ) + * 15 public functions inherited from QAbstractScrollArea + * 13 public functions inherited from QFrame + * 207 public functions inherited from QWidget + * 29 public functions inherited from QObject + * 12 public functions inherited from QPaintDevice + */ + +#include + +#include + + +/* + * QPlainTextEdit ( QWidget * parent = 0 ) + * QPlainTextEdit ( const QString & text, QWidget * parent = 0 ) + * virtual ~QPlainTextEdit () + */ + +typedef struct +{ + void * ph; + QT_G_FUNC_PTR func; + QPointer< QPlainTextEdit > pq; +} QGC_POINTER_QPlainTextEdit; + +QT_G_FUNC( release_QPlainTextEdit ) +{ + QGC_POINTER_QPlainTextEdit * p = ( QGC_POINTER_QPlainTextEdit * ) Cargo; + + HB_TRACE( HB_TR_DEBUG, ( "release_QPlainTextEdit p=%p", p)); + HB_TRACE( HB_TR_DEBUG, ( "release_QPlainTextEdit ph=%p pq=%p", p->ph, (void *)(p->pq))); + + if( p && p->ph && p->pq ) + { + const QMetaObject * m = ( ( QObject * ) p->ph )->metaObject(); + if( ( QString ) m->className() != ( QString ) "QObject" ) + { + switch( hbqt_get_object_release_method() ) + { + case HBQT_RELEASE_WITH_DELETE: + delete ( ( QPlainTextEdit * ) p->ph ); + break; + case HBQT_RELEASE_WITH_DESTRUTOR: + ( ( QPlainTextEdit * ) p->ph )->~QPlainTextEdit(); + break; + case HBQT_RELEASE_WITH_DELETE_LATER: + ( ( QPlainTextEdit * ) p->ph )->deleteLater(); + break; + } + p->ph = NULL; + HB_TRACE( HB_TR_DEBUG, ( "release_QPlainTextEdit Object deleted!" ) ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " YES release_QPlainTextEdit %i B %i KB", ( int ) hb_xquery( 1001 ), hbqt_getmemused() ); + #endif + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "release_QPlainTextEdit Object Name Missing!" ) ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " NO release_QPlainTextEdit" ); + #endif + } + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "release_QPlainTextEdit Object Allready deleted!" ) ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " DEL release_QPlainTextEdit" ); + #endif + } +} + +void * gcAllocate_QPlainTextEdit( void * pObj ) +{ + QGC_POINTER_QPlainTextEdit * p = ( QGC_POINTER_QPlainTextEdit * ) hb_gcAllocate( sizeof( QGC_POINTER_QPlainTextEdit ), gcFuncs() ); + + p->ph = pObj; + p->func = release_QPlainTextEdit; + new( & p->pq ) QPointer< QPlainTextEdit >( ( QPlainTextEdit * ) pObj ); + #if defined( __HB_DEBUG__ ) + hbqt_debug( " new_QPlainTextEdit %i B %i KB", ( int ) hb_xquery( 1001 ), hbqt_getmemused() ); + #endif + return( p ); +} + +HB_FUNC( QT_QPLAINTEXTEDIT ) +{ + void * pObj = NULL; + + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + pObj = new QPlainTextEdit() ; + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + pObj = new QPlainTextEdit( hbqt_par_QWidget( 1 ) ) ; + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + { + pObj = new QPlainTextEdit( hbqt_par_QString( 1 ), hbqt_par_QWidget( 2 ) ) ; + } + else + { + pObj = new QPlainTextEdit() ; + } + + hb_retptrGC( gcAllocate_QPlainTextEdit( pObj ) ); +} +/* + * bool backgroundVisible () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_BACKGROUNDVISIBLE ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->backgroundVisible() ); +} + +/* + * int blockCount () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_BLOCKCOUNT ) +{ + hb_retni( hbqt_par_QPlainTextEdit( 1 )->blockCount() ); +} + +/* + * bool canPaste () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CANPASTE ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->canPaste() ); +} + +/* + * bool centerOnScroll () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CENTERONSCROLL ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->centerOnScroll() ); +} + +/* + * QMenu * createStandardContextMenu () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CREATESTANDARDCONTEXTMENU ) +{ + hb_retptr( ( QMenu* ) hbqt_par_QPlainTextEdit( 1 )->createStandardContextMenu() ); +} + +/* + * QTextCharFormat currentCharFormat () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CURRENTCHARFORMAT ) +{ + hb_retptrGC( gcAllocate_QTextCharFormat( new QTextCharFormat( hbqt_par_QPlainTextEdit( 1 )->currentCharFormat() ) ) ); +} + +/* + * QTextCursor cursorForPosition ( const QPoint & pos ) const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CURSORFORPOSITION ) +{ + hb_retptrGC( gcAllocate_QTextCursor( new QTextCursor( hbqt_par_QPlainTextEdit( 1 )->cursorForPosition( *hbqt_par_QPoint( 2 ) ) ) ) ); +} + +/* + * QRect cursorRect ( const QTextCursor & cursor ) const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CURSORRECT ) +{ + hb_retptrGC( gcAllocate_QRect( new QRect( hbqt_par_QPlainTextEdit( 1 )->cursorRect( *hbqt_par_QTextCursor( 2 ) ) ) ) ); +} + +/* + * QRect cursorRect () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CURSORRECT_1 ) +{ + hb_retptrGC( gcAllocate_QRect( new QRect( hbqt_par_QPlainTextEdit( 1 )->cursorRect() ) ) ); +} + +/* + * int cursorWidth () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CURSORWIDTH ) +{ + hb_retni( hbqt_par_QPlainTextEdit( 1 )->cursorWidth() ); +} + +/* + * QTextDocument * document () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_DOCUMENT ) +{ + hb_retptr( ( QTextDocument* ) hbqt_par_QPlainTextEdit( 1 )->document() ); +} + +/* + * QString documentTitle () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_DOCUMENTTITLE ) +{ + hb_retc( hbqt_par_QPlainTextEdit( 1 )->documentTitle().toAscii().data() ); +} + +/* + * void ensureCursorVisible () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_ENSURECURSORVISIBLE ) +{ + hbqt_par_QPlainTextEdit( 1 )->ensureCursorVisible(); +} + +/* + * bool find ( const QString & exp, QTextDocument::FindFlags options = 0 ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_FIND ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->find( hbqt_par_QString( 2 ), ( QTextDocument::FindFlags ) hb_parni( 3 ) ) ); +} + +/* + * bool isReadOnly () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_ISREADONLY ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->isReadOnly() ); +} + +/* + * bool isUndoRedoEnabled () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_ISUNDOREDOENABLED ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->isUndoRedoEnabled() ); +} + +/* + * LineWrapMode lineWrapMode () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_LINEWRAPMODE ) +{ + hb_retni( ( QPlainTextEdit::LineWrapMode ) hbqt_par_QPlainTextEdit( 1 )->lineWrapMode() ); +} + +/* + * virtual QVariant loadResource ( int type, const QUrl & name ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_LOADRESOURCE ) +{ + hb_retptrGC( gcAllocate_QVariant( new QVariant( hbqt_par_QPlainTextEdit( 1 )->loadResource( hb_parni( 2 ), *hbqt_par_QUrl( 3 ) ) ) ) ); +} + +/* + * int maximumBlockCount () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_MAXIMUMBLOCKCOUNT ) +{ + hb_retni( hbqt_par_QPlainTextEdit( 1 )->maximumBlockCount() ); +} + +/* + * void mergeCurrentCharFormat ( const QTextCharFormat & modifier ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_MERGECURRENTCHARFORMAT ) +{ + hbqt_par_QPlainTextEdit( 1 )->mergeCurrentCharFormat( *hbqt_par_QTextCharFormat( 2 ) ); +} + +/* + * void moveCursor ( QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_MOVECURSOR ) +{ + hbqt_par_QPlainTextEdit( 1 )->moveCursor( ( QTextCursor::MoveOperation ) hb_parni( 2 ), ( HB_ISNUM( 3 ) ? ( QTextCursor::MoveMode ) hb_parni( 3 ) : ( QTextCursor::MoveMode ) QTextCursor::MoveAnchor ) ); +} + +/* + * bool overwriteMode () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_OVERWRITEMODE ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->overwriteMode() ); +} + +/* + * void print ( QPrinter * printer ) const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_PRINT ) +{ + hbqt_par_QPlainTextEdit( 1 )->print( hbqt_par_QPrinter( 2 ) ); +} + +/* + * void setBackgroundVisible ( bool visible ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETBACKGROUNDVISIBLE ) +{ + hbqt_par_QPlainTextEdit( 1 )->setBackgroundVisible( hb_parl( 2 ) ); +} + +/* + * void setCenterOnScroll ( bool enabled ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETCENTERONSCROLL ) +{ + hbqt_par_QPlainTextEdit( 1 )->setCenterOnScroll( hb_parl( 2 ) ); +} + +/* + * void setCurrentCharFormat ( const QTextCharFormat & format ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETCURRENTCHARFORMAT ) +{ + hbqt_par_QPlainTextEdit( 1 )->setCurrentCharFormat( *hbqt_par_QTextCharFormat( 2 ) ); +} + +/* + * void setCursorWidth ( int width ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETCURSORWIDTH ) +{ + hbqt_par_QPlainTextEdit( 1 )->setCursorWidth( hb_parni( 2 ) ); +} + +/* + * void setDocument ( QTextDocument * document ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETDOCUMENT ) +{ + hbqt_par_QPlainTextEdit( 1 )->setDocument( hbqt_par_QTextDocument( 2 ) ); +} + +/* + * void setDocumentTitle ( const QString & title ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETDOCUMENTTITLE ) +{ + hbqt_par_QPlainTextEdit( 1 )->setDocumentTitle( hbqt_par_QString( 2 ) ); +} + +/* + * void setLineWrapMode ( LineWrapMode mode ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETLINEWRAPMODE ) +{ + hbqt_par_QPlainTextEdit( 1 )->setLineWrapMode( ( QPlainTextEdit::LineWrapMode ) hb_parni( 2 ) ); +} + +/* + * void setMaximumBlockCount ( int maximum ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETMAXIMUMBLOCKCOUNT ) +{ + hbqt_par_QPlainTextEdit( 1 )->setMaximumBlockCount( hb_parni( 2 ) ); +} + +/* + * void setOverwriteMode ( bool overwrite ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETOVERWRITEMODE ) +{ + hbqt_par_QPlainTextEdit( 1 )->setOverwriteMode( hb_parl( 2 ) ); +} + +/* + * void setReadOnly ( bool ro ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETREADONLY ) +{ + hbqt_par_QPlainTextEdit( 1 )->setReadOnly( hb_parl( 2 ) ); +} + +/* + * void setTabChangesFocus ( bool b ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETTABCHANGESFOCUS ) +{ + hbqt_par_QPlainTextEdit( 1 )->setTabChangesFocus( hb_parl( 2 ) ); +} + +/* + * void setTabStopWidth ( int width ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETTABSTOPWIDTH ) +{ + hbqt_par_QPlainTextEdit( 1 )->setTabStopWidth( hb_parni( 2 ) ); +} + +/* + * void setTextCursor ( const QTextCursor & cursor ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETTEXTCURSOR ) +{ + hbqt_par_QPlainTextEdit( 1 )->setTextCursor( *hbqt_par_QTextCursor( 2 ) ); +} + +/* + * void setTextInteractionFlags ( Qt::TextInteractionFlags flags ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETTEXTINTERACTIONFLAGS ) +{ + hbqt_par_QPlainTextEdit( 1 )->setTextInteractionFlags( ( Qt::TextInteractionFlags ) hb_parni( 2 ) ); +} + +/* + * void setUndoRedoEnabled ( bool enable ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETUNDOREDOENABLED ) +{ + hbqt_par_QPlainTextEdit( 1 )->setUndoRedoEnabled( hb_parl( 2 ) ); +} + +/* + * void setWordWrapMode ( QTextOption::WrapMode policy ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETWORDWRAPMODE ) +{ + hbqt_par_QPlainTextEdit( 1 )->setWordWrapMode( ( QTextOption::WrapMode ) hb_parni( 2 ) ); +} + +/* + * bool tabChangesFocus () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_TABCHANGESFOCUS ) +{ + hb_retl( hbqt_par_QPlainTextEdit( 1 )->tabChangesFocus() ); +} + +/* + * int tabStopWidth () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_TABSTOPWIDTH ) +{ + hb_retni( hbqt_par_QPlainTextEdit( 1 )->tabStopWidth() ); +} + +/* + * QTextCursor textCursor () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_TEXTCURSOR ) +{ + hb_retptrGC( gcAllocate_QTextCursor( new QTextCursor( hbqt_par_QPlainTextEdit( 1 )->textCursor() ) ) ); +} + +/* + * Qt::TextInteractionFlags textInteractionFlags () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_TEXTINTERACTIONFLAGS ) +{ + hb_retni( ( Qt::TextInteractionFlags ) hbqt_par_QPlainTextEdit( 1 )->textInteractionFlags() ); +} + +/* + * QString toPlainText () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_TOPLAINTEXT ) +{ + hb_retc( hbqt_par_QPlainTextEdit( 1 )->toPlainText().toAscii().data() ); +} + +/* + * QTextOption::WrapMode wordWrapMode () const + */ +HB_FUNC( QT_QPLAINTEXTEDIT_WORDWRAPMODE ) +{ + hb_retni( ( QTextOption::WrapMode ) hbqt_par_QPlainTextEdit( 1 )->wordWrapMode() ); +} + +/* + * void appendHtml ( const QString & html ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_APPENDHTML ) +{ + hbqt_par_QPlainTextEdit( 1 )->appendHtml( hbqt_par_QString( 2 ) ); +} + +/* + * void appendPlainText ( const QString & text ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_APPENDPLAINTEXT ) +{ + hbqt_par_QPlainTextEdit( 1 )->appendPlainText( hbqt_par_QString( 2 ) ); +} + +/* + * void centerCursor () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CENTERCURSOR ) +{ + hbqt_par_QPlainTextEdit( 1 )->centerCursor(); +} + +/* + * void clear () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CLEAR ) +{ + hbqt_par_QPlainTextEdit( 1 )->clear(); +} + +/* + * void copy () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_COPY ) +{ + hbqt_par_QPlainTextEdit( 1 )->copy(); +} + +/* + * void cut () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_CUT ) +{ + hbqt_par_QPlainTextEdit( 1 )->cut(); +} + +/* + * void insertPlainText ( const QString & text ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_INSERTPLAINTEXT ) +{ + hbqt_par_QPlainTextEdit( 1 )->insertPlainText( hbqt_par_QString( 2 ) ); +} + +/* + * void paste () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_PASTE ) +{ + hbqt_par_QPlainTextEdit( 1 )->paste(); +} + +/* + * void redo () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_REDO ) +{ + hbqt_par_QPlainTextEdit( 1 )->redo(); +} + +/* + * void selectAll () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SELECTALL ) +{ + hbqt_par_QPlainTextEdit( 1 )->selectAll(); +} + +/* + * void setPlainText ( const QString & text ) + */ +HB_FUNC( QT_QPLAINTEXTEDIT_SETPLAINTEXT ) +{ + hbqt_par_QPlainTextEdit( 1 )->setPlainText( hbqt_par_QString( 2 ) ); +} + +/* + * void undo () + */ +HB_FUNC( QT_QPLAINTEXTEDIT_UNDO ) +{ + hbqt_par_QPlainTextEdit( 1 )->undo(); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtgui/TQPlainTextEdit.prg b/harbour/contrib/hbqt/qtgui/TQPlainTextEdit.prg new file mode 100644 index 0000000000..97ed63aaac --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/TQPlainTextEdit.prg @@ -0,0 +1,375 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QPlainTextEdit INHERIT QAbstractScrollArea + + VAR pPtr + + METHOD new() + METHOD configure( xObject ) + + METHOD backgroundVisible() + METHOD blockCount() + METHOD canPaste() + METHOD centerOnScroll() + METHOD createStandardContextMenu() + METHOD currentCharFormat() + METHOD cursorForPosition( pPos ) + METHOD cursorRect( pCursor ) + METHOD cursorRect_1() + METHOD cursorWidth() + METHOD document() + METHOD documentTitle() + METHOD ensureCursorVisible() + METHOD find( cExp, nOptions ) + METHOD isReadOnly() + METHOD isUndoRedoEnabled() + METHOD lineWrapMode() + METHOD loadResource( nType, pName ) + METHOD maximumBlockCount() + METHOD mergeCurrentCharFormat( pModifier ) + METHOD moveCursor( nOperation, nMode ) + METHOD overwriteMode() + METHOD print( pPrinter ) + METHOD setBackgroundVisible( lVisible ) + METHOD setCenterOnScroll( lEnabled ) + METHOD setCurrentCharFormat( pFormat ) + METHOD setCursorWidth( nWidth ) + METHOD setDocument( pDocument ) + METHOD setDocumentTitle( cTitle ) + METHOD setLineWrapMode( nMode ) + METHOD setMaximumBlockCount( nMaximum ) + METHOD setOverwriteMode( lOverwrite ) + METHOD setReadOnly( lRo ) + METHOD setTabChangesFocus( lB ) + METHOD setTabStopWidth( nWidth ) + METHOD setTextCursor( pCursor ) + METHOD setTextInteractionFlags( nFlags ) + METHOD setUndoRedoEnabled( lEnable ) + METHOD setWordWrapMode( nPolicy ) + METHOD tabChangesFocus() + METHOD tabStopWidth() + METHOD textCursor() + METHOD textInteractionFlags() + METHOD toPlainText() + METHOD wordWrapMode() + METHOD appendHtml( cHtml ) + METHOD appendPlainText( cText ) + METHOD centerCursor() + METHOD clear() + METHOD copy() + METHOD cut() + METHOD insertPlainText( cText ) + METHOD paste() + METHOD redo() + METHOD selectAll() + METHOD setPlainText( cText ) + METHOD undo() + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD QPlainTextEdit:new( pParent ) + ::pPtr := Qt_QPlainTextEdit( pParent ) + RETURN Self + + +METHOD QPlainTextEdit:configure( xObject ) + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + RETURN Self + + +METHOD QPlainTextEdit:backgroundVisible() + RETURN Qt_QPlainTextEdit_backgroundVisible( ::pPtr ) + + +METHOD QPlainTextEdit:blockCount() + RETURN Qt_QPlainTextEdit_blockCount( ::pPtr ) + + +METHOD QPlainTextEdit:canPaste() + RETURN Qt_QPlainTextEdit_canPaste( ::pPtr ) + + +METHOD QPlainTextEdit:centerOnScroll() + RETURN Qt_QPlainTextEdit_centerOnScroll( ::pPtr ) + + +METHOD QPlainTextEdit:createStandardContextMenu() + RETURN Qt_QPlainTextEdit_createStandardContextMenu( ::pPtr ) + + +METHOD QPlainTextEdit:currentCharFormat() + RETURN Qt_QPlainTextEdit_currentCharFormat( ::pPtr ) + + +METHOD QPlainTextEdit:cursorForPosition( pPos ) + RETURN Qt_QPlainTextEdit_cursorForPosition( ::pPtr, pPos ) + + +METHOD QPlainTextEdit:cursorRect( pCursor ) + RETURN Qt_QPlainTextEdit_cursorRect( ::pPtr, pCursor ) + + +METHOD QPlainTextEdit:cursorRect_1() + RETURN Qt_QPlainTextEdit_cursorRect_1( ::pPtr ) + + +METHOD QPlainTextEdit:cursorWidth() + RETURN Qt_QPlainTextEdit_cursorWidth( ::pPtr ) + + +METHOD QPlainTextEdit:document() + RETURN Qt_QPlainTextEdit_document( ::pPtr ) + + +METHOD QPlainTextEdit:documentTitle() + RETURN Qt_QPlainTextEdit_documentTitle( ::pPtr ) + + +METHOD QPlainTextEdit:ensureCursorVisible() + RETURN Qt_QPlainTextEdit_ensureCursorVisible( ::pPtr ) + + +METHOD QPlainTextEdit:find( cExp, nOptions ) + RETURN Qt_QPlainTextEdit_find( ::pPtr, cExp, nOptions ) + + +METHOD QPlainTextEdit:isReadOnly() + RETURN Qt_QPlainTextEdit_isReadOnly( ::pPtr ) + + +METHOD QPlainTextEdit:isUndoRedoEnabled() + RETURN Qt_QPlainTextEdit_isUndoRedoEnabled( ::pPtr ) + + +METHOD QPlainTextEdit:lineWrapMode() + RETURN Qt_QPlainTextEdit_lineWrapMode( ::pPtr ) + + +METHOD QPlainTextEdit:loadResource( nType, pName ) + RETURN Qt_QPlainTextEdit_loadResource( ::pPtr, nType, pName ) + + +METHOD QPlainTextEdit:maximumBlockCount() + RETURN Qt_QPlainTextEdit_maximumBlockCount( ::pPtr ) + + +METHOD QPlainTextEdit:mergeCurrentCharFormat( pModifier ) + RETURN Qt_QPlainTextEdit_mergeCurrentCharFormat( ::pPtr, pModifier ) + + +METHOD QPlainTextEdit:moveCursor( nOperation, nMode ) + RETURN Qt_QPlainTextEdit_moveCursor( ::pPtr, nOperation, nMode ) + + +METHOD QPlainTextEdit:overwriteMode() + RETURN Qt_QPlainTextEdit_overwriteMode( ::pPtr ) + + +METHOD QPlainTextEdit:print( pPrinter ) + RETURN Qt_QPlainTextEdit_print( ::pPtr, pPrinter ) + + +METHOD QPlainTextEdit:setBackgroundVisible( lVisible ) + RETURN Qt_QPlainTextEdit_setBackgroundVisible( ::pPtr, lVisible ) + + +METHOD QPlainTextEdit:setCenterOnScroll( lEnabled ) + RETURN Qt_QPlainTextEdit_setCenterOnScroll( ::pPtr, lEnabled ) + + +METHOD QPlainTextEdit:setCurrentCharFormat( pFormat ) + RETURN Qt_QPlainTextEdit_setCurrentCharFormat( ::pPtr, pFormat ) + + +METHOD QPlainTextEdit:setCursorWidth( nWidth ) + RETURN Qt_QPlainTextEdit_setCursorWidth( ::pPtr, nWidth ) + + +METHOD QPlainTextEdit:setDocument( pDocument ) + RETURN Qt_QPlainTextEdit_setDocument( ::pPtr, pDocument ) + + +METHOD QPlainTextEdit:setDocumentTitle( cTitle ) + RETURN Qt_QPlainTextEdit_setDocumentTitle( ::pPtr, cTitle ) + + +METHOD QPlainTextEdit:setLineWrapMode( nMode ) + RETURN Qt_QPlainTextEdit_setLineWrapMode( ::pPtr, nMode ) + + +METHOD QPlainTextEdit:setMaximumBlockCount( nMaximum ) + RETURN Qt_QPlainTextEdit_setMaximumBlockCount( ::pPtr, nMaximum ) + + +METHOD QPlainTextEdit:setOverwriteMode( lOverwrite ) + RETURN Qt_QPlainTextEdit_setOverwriteMode( ::pPtr, lOverwrite ) + + +METHOD QPlainTextEdit:setReadOnly( lRo ) + RETURN Qt_QPlainTextEdit_setReadOnly( ::pPtr, lRo ) + + +METHOD QPlainTextEdit:setTabChangesFocus( lB ) + RETURN Qt_QPlainTextEdit_setTabChangesFocus( ::pPtr, lB ) + + +METHOD QPlainTextEdit:setTabStopWidth( nWidth ) + RETURN Qt_QPlainTextEdit_setTabStopWidth( ::pPtr, nWidth ) + + +METHOD QPlainTextEdit:setTextCursor( pCursor ) + RETURN Qt_QPlainTextEdit_setTextCursor( ::pPtr, pCursor ) + + +METHOD QPlainTextEdit:setTextInteractionFlags( nFlags ) + RETURN Qt_QPlainTextEdit_setTextInteractionFlags( ::pPtr, nFlags ) + + +METHOD QPlainTextEdit:setUndoRedoEnabled( lEnable ) + RETURN Qt_QPlainTextEdit_setUndoRedoEnabled( ::pPtr, lEnable ) + + +METHOD QPlainTextEdit:setWordWrapMode( nPolicy ) + RETURN Qt_QPlainTextEdit_setWordWrapMode( ::pPtr, nPolicy ) + + +METHOD QPlainTextEdit:tabChangesFocus() + RETURN Qt_QPlainTextEdit_tabChangesFocus( ::pPtr ) + + +METHOD QPlainTextEdit:tabStopWidth() + RETURN Qt_QPlainTextEdit_tabStopWidth( ::pPtr ) + + +METHOD QPlainTextEdit:textCursor() + RETURN Qt_QPlainTextEdit_textCursor( ::pPtr ) + + +METHOD QPlainTextEdit:textInteractionFlags() + RETURN Qt_QPlainTextEdit_textInteractionFlags( ::pPtr ) + + +METHOD QPlainTextEdit:toPlainText() + RETURN Qt_QPlainTextEdit_toPlainText( ::pPtr ) + + +METHOD QPlainTextEdit:wordWrapMode() + RETURN Qt_QPlainTextEdit_wordWrapMode( ::pPtr ) + + +METHOD QPlainTextEdit:appendHtml( cHtml ) + RETURN Qt_QPlainTextEdit_appendHtml( ::pPtr, cHtml ) + + +METHOD QPlainTextEdit:appendPlainText( cText ) + RETURN Qt_QPlainTextEdit_appendPlainText( ::pPtr, cText ) + + +METHOD QPlainTextEdit:centerCursor() + RETURN Qt_QPlainTextEdit_centerCursor( ::pPtr ) + + +METHOD QPlainTextEdit:clear() + RETURN Qt_QPlainTextEdit_clear( ::pPtr ) + + +METHOD QPlainTextEdit:copy() + RETURN Qt_QPlainTextEdit_copy( ::pPtr ) + + +METHOD QPlainTextEdit:cut() + RETURN Qt_QPlainTextEdit_cut( ::pPtr ) + + +METHOD QPlainTextEdit:insertPlainText( cText ) + RETURN Qt_QPlainTextEdit_insertPlainText( ::pPtr, cText ) + + +METHOD QPlainTextEdit:paste() + RETURN Qt_QPlainTextEdit_paste( ::pPtr ) + + +METHOD QPlainTextEdit:redo() + RETURN Qt_QPlainTextEdit_redo( ::pPtr ) + + +METHOD QPlainTextEdit:selectAll() + RETURN Qt_QPlainTextEdit_selectAll( ::pPtr ) + + +METHOD QPlainTextEdit:setPlainText( cText ) + RETURN Qt_QPlainTextEdit_setPlainText( ::pPtr, cText ) + + +METHOD QPlainTextEdit:undo() + RETURN Qt_QPlainTextEdit_undo( ::pPtr ) + diff --git a/harbour/contrib/hbqt/qtgui/filelist.mk b/harbour/contrib/hbqt/qtgui/filelist.mk index 26a63570d9..955a6291bf 100644 --- a/harbour/contrib/hbqt/qtgui/filelist.mk +++ b/harbour/contrib/hbqt/qtgui/filelist.mk @@ -108,6 +108,7 @@ CPP_SOURCES := \ QPen.cpp \ QPicture.cpp \ QPixmap.cpp \ + QPlainTextEdit.cpp \ QPolygon.cpp \ QPolygonF.cpp \ QPrintDialog.cpp \ @@ -317,6 +318,7 @@ PRG_SOURCES := \ TQPen.prg \ TQPicture.prg \ TQPixmap.prg \ + TQPlainTextEdit.prg \ TQPolygon.prg \ TQPolygonF.prg \ TQPrintDialog.prg \ diff --git a/harbour/contrib/hbqt/qth/QPlainTextEdit.qth b/harbour/contrib/hbqt/qth/QPlainTextEdit.qth new file mode 100644 index 0000000000..94d561b4d8 --- /dev/null +++ b/harbour/contrib/hbqt/qth/QPlainTextEdit.qth @@ -0,0 +1,181 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ +; +; Header File to Generate QT Wrapper Sources +; + + +QObject = +Inherits = QAbstractScrollArea +Type = +New = + + + + + + +#include + + +/* + * QPlainTextEdit ( QWidget * parent = 0 ) + * QPlainTextEdit ( const QString & text, QWidget * parent = 0 ) + * virtual ~QPlainTextEdit () + */ +HB_FUNC( QT_QPLAINTEXTEDIT ) +{ + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + hb_retptr( new QPlainTextEdit() ); + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( new QPlainTextEdit( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( new QPlainTextEdit( hbqt_par_QString( 1 ), hbqt_par_QWidget( 2 ) ) ); + } + else + { + hb_retptr( new QPlainTextEdit() ); + } +} + + + +enum LineWrapMode { NoWrap, WidgetWidth } + + + +bool backgroundVisible () const +int blockCount () const +bool canPaste () const +bool centerOnScroll () const +QMenu * createStandardContextMenu () +QTextCharFormat currentCharFormat () const +QTextCursor cursorForPosition ( const QPoint & pos ) const +QRect cursorRect ( const QTextCursor & cursor ) const +QRect cursorRect () const +int cursorWidth () const +QTextDocument * document () const +QString documentTitle () const +void ensureCursorVisible () +QList extraSelections () const +bool find ( const QString & exp, QTextDocument::FindFlags options = 0 ) +bool isReadOnly () const +bool isUndoRedoEnabled () const +LineWrapMode lineWrapMode () const +virtual QVariant loadResource ( int type, const QUrl & name ) +int maximumBlockCount () const +void mergeCurrentCharFormat ( const QTextCharFormat & modifier ) +void moveCursor ( QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor ) +bool overwriteMode () const +void print ( QPrinter * printer ) const +void setBackgroundVisible ( bool visible ) +void setCenterOnScroll ( bool enabled ) +void setCurrentCharFormat ( const QTextCharFormat & format ) +void setCursorWidth ( int width ) +void setDocument ( QTextDocument * document ) +void setDocumentTitle ( const QString & title ) +void setExtraSelections ( const QList & selections ) +void setLineWrapMode ( LineWrapMode mode ) +void setMaximumBlockCount ( int maximum ) +void setOverwriteMode ( bool overwrite ) +void setReadOnly ( bool ro ) +void setTabChangesFocus ( bool b ) +void setTabStopWidth ( int width ) +void setTextCursor ( const QTextCursor & cursor ) +void setTextInteractionFlags ( Qt::TextInteractionFlags flags ) +void setUndoRedoEnabled ( bool enable ) +void setWordWrapMode ( QTextOption::WrapMode policy ) +bool tabChangesFocus () const +int tabStopWidth () const +QTextCursor textCursor () const +Qt::TextInteractionFlags textInteractionFlags () const +QString toPlainText () const +QTextOption::WrapMode wordWrapMode () const +15 public functions inherited from QAbstractScrollArea +13 public functions inherited from QFrame +207 public functions inherited from QWidget +29 public functions inherited from QObject +12 public functions inherited from QPaintDevice + + + +void appendHtml ( const QString & html ) +void appendPlainText ( const QString & text ) +void centerCursor () +void clear () +void copy () +void cut () +void insertPlainText ( const QString & text ) +void paste () +void redo () +void selectAll () +void setPlainText ( const QString & text ) +void undo () + + + +void blockCountChanged ( int newBlockCount ) +void copyAvailable ( bool yes ) +void cursorPositionChanged () +void modificationChanged ( bool changed ) +void redoAvailable ( bool available ) +void selectionChanged () +void textChanged () +void undoAvailable ( bool available ) +void updateRequest ( const QRect & rect, int dy ) + diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index 4901c08414..a980dc2314 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -175,6 +175,7 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget := QListView():New( ::pParent ) + ::oWidget:setMouseTracking( .t. ) /* Window Events */ ::oWidget:installEventFilter( SetEventFilter() ) @@ -211,10 +212,13 @@ METHOD XbpListBox:exeBlock( nMode, pModel ) IF hb_isBlock( ::sl_itemMarked ) eval( ::sl_itemMarked, NIL, NIL, self ) ENDIF - ELSEIF nMode == 2 .or. nMode == 3 + ELSEIF nMode == 2 IF hb_isBlock( ::sl_itemSelected ) eval( ::sl_itemSelected, NIL, NIL, self ) ENDIF + ELSEIF nMode == 3 // mouse cursor is on + // set the tooltip + ::oWidget:setToolTip( ::oStrList:at( ::nCurSelected - 1 ) ) ENDIF RETURN nil diff --git a/harbour/contrib/hbxbp/xbptabpage.prg b/harbour/contrib/hbxbp/xbptabpage.prg index 2ddf30ff35..d9c740f36c 100644 --- a/harbour/contrib/hbxbp/xbptabpage.prg +++ b/harbour/contrib/hbxbp/xbptabpage.prg @@ -300,13 +300,13 @@ METHOD XbpTabWidget:exeBlock( nMode, iIndex ) DO CASE CASE nMode == 1 - HBXBP_DEBUG( "Tab Index Changed", nIndex ) + //HBXBP_DEBUG( "Tab Index Changed", nIndex ) IF hb_isBlock( oTab:sl_tabActivate ) eval( oTab:sl_tabActivate, NIL, NIL, oTab ) ENDIF CASE nMode == 2 - HBXBP_DEBUG( "Tab Close Requested", nIndex ) + //HBXBP_DEBUG( "Tab Close Requested", nIndex ) IF hb_isBlock( oTab:sl_closeRequested ) eval( oTab:sl_closeRequested, NIL, NIL, oTab ) ENDIF