diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8010e9b6a2..fd57e2ef59 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-21 18:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + * contrib/hbqt/hbqt_hbqplaintextedit.h + * contrib/hbqt/hbqt_hbslots.cpp + * contrib/hbqt/hbqt_hbslots.h + * contrib/hbide/idesaveload.prg + ! Minor adjustments. + % Started: to go beyind eol into virtual space. + 2010-06-22 03:20 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/ren_sfn.prg * external/minizip/Makefile diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 830197b83c..cf720c82a1 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -853,7 +853,7 @@ METHOD IdeSetup:disConnectSlots() ::disconnect( ::oUI:q_buttonKeyUp , "clicked()" ) ::disconnect( ::oUI:q_buttonKeyDown , "clicked()" ) - ::disconnect( ::oUI:q_tableVar , QEvent_KeyPress ) + ::disconnect( ::oUI:q_tableVar , "itemActivated(QTblWItem)" ) ::disconnect( ::oUI:q_buttonSelFont , "clicked()" ) ::disConnect( ::oUI:q_buttonClose , "clicked()" ) @@ -882,8 +882,7 @@ METHOD IdeSetup:connectSlots() ::connect( ::oUI:q_buttonKeyUp , "clicked()" , {| | ::execEvent( "buttonKeyUp_clicked" ) } ) ::connect( ::oUI:q_buttonKeyDown , "clicked()" , {| | ::execEvent( "buttonKeyDown_clicked" ) } ) - ::connect( ::oUI:q_tableVar , QEvent_KeyPress , {|p| ::execEvent( "tableVar_keyPress", p ) } ) -// ::connect( ::oUI:q_tableVar , "itemActivated(QTblWItem)" , {|p| ::execEvent( "tableVar_keyPress", p ) } ) + ::connect( ::oUI:q_tableVar , "itemActivated(QTblWItem)", {|p| ::execEvent( "tableVar_keyPress", p ) } ) ::connect( ::oUI:q_buttonSelFont , "clicked()" , {| | ::execEvent( "buttonSelFont_clicked" ) } ) ::connect( ::oUI:q_buttonClose , "clicked()" , {| | ::execEvent( "buttonClose_clicked" ) } ) @@ -1033,7 +1032,8 @@ METHOD IdeSetup:show() /*----------------------------------------------------------------------*/ METHOD IdeSetup:execEvent( cEvent, p ) - LOCAL qItem, nIndex, qFontDlg, qFont, nOK, nRow, qEvent, b_, q0, q1, nCol, w0, w1 + LOCAL qItem, nIndex, qFontDlg, qFont, nOK, nRow, b_, q0, q1, nCol, w0, w1 +// LOCAL qEvent SWITCH cEvent CASE "buttonSelFont_clicked" @@ -1175,11 +1175,13 @@ METHOD IdeSetup:execEvent( cEvent, p ) CASE "tableVar_keyPress" IF ( nRow := ::oUI:q_tableVar:currentRow() ) >= 0 - qEvent := QKeyEvent():from( p ) -HB_TRACE( HB_TR_ALWAYS, "RECEIVING ENTER KEY", qEvent:key() ) - IF qEvent:key() == Qt_Key_Enter .OR. qEvent:key() == Qt_Key_Return -HB_TRACE( HB_TR_ALWAYS, "RECEIVING ENTER KEY", 1 ) + HB_TRACE( HB_TR_ALWAYS, "RECEIVING ENTER KEY" ) + ::oUI:q_tableVar:editItem( p ) + #if 0 + IF ::oUI:q_tableVar:currentColumn() == 0 + ::oUI:q_tableVar:setCurrentCell( ::oUI:q_tableVar:currentRow(), 1 ) ENDIF + #endif ENDIF ENDSWITCH @@ -1229,8 +1231,6 @@ METHOD IdeSetup:buildKeywords() oTbl:setAlternatingRowColors( .t. ) oTbl:setColumnCount( len( hdr_ ) ) oTbl:setShowGrid( .t. ) - //oTbl:setSelectionMode( QAbstractItemView_SingleSelection ) - //oTbl:setSelectionBehavior( QAbstractItemView_SelectRows ) FOR n := 1 TO len( hdr_ ) qItm := QTableWidgetItem():new() qItm:setText( hdr_[ n,1 ] ) diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 342b7ec7f3..77c54d8b8a 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -196,20 +196,6 @@ void HBQPlainTextEdit::hbRefresh() /*----------------------------------------------------------------------*/ -void HBQPlainTextEdit::hbUpdateCaret() -{ - if( caretState == 0 ) - caretState = 1; - else - caretState = 0; - - QRect r( cursorRect() ); - r.setX( r.x() + 100 ); - repaint( r ); -} - -/*----------------------------------------------------------------------*/ - void HBQPlainTextEdit::hbShowPrototype( const QString & tip ) { if( tip == ( QString ) "" ) @@ -1402,18 +1388,8 @@ void HBQPlainTextEdit::paintEvent( QPaintEvent * event ) this->hbPaintSelection( event ); this->hbPaintHighlight( event ); - #if 0 - { - QPainter p( viewport() ); - caretState = caretState == 0 ? 1 : 0; - QRect r( cursorRect() ); - r.setX( r.x() + 100 ); - r.setWidth( 1 ); - p.fillRect( r, QBrush( QColor( caretState == 1 ? Qt::red : Qt::white ) ) ); - } - #endif +// this->hbDrawCursor( event ); - painter.end(); QPlainTextEdit::paintEvent( event ); #if 0 @@ -1474,6 +1450,36 @@ void HBQPlainTextEdit::paintEvent( QPaintEvent * event ) } /*----------------------------------------------------------------------*/ +void HBQPlainTextEdit::hbDrawCursor( QPaintEvent *event ) +{ + QAbstractTextDocumentLayout::PaintContext pc = getPaintContext(); + { + if( caretState == 1 ) + { + QRect r( cursorRect( textCursor() ) ); + r.setLeft( r.left() + 100 ); + r.setRight( r.right() + 100 ); + + QPainter p( viewport() ); + p.fillRect( r, QBrush( QColor( caretState == 1 ? Qt::red : Qt::blue ) ) ); + } + } +} + +/*----------------------------------------------------------------------*/ + +void HBQPlainTextEdit::hbUpdateCaret() +{ + caretState = caretState == 0 ? 1 : 0; + + QRect r( cursorRect( textCursor() ) ); + r.setX( 0 ); + r.setWidth( viewport()->width() ); + repaint( r ); +} + +/*----------------------------------------------------------------------*/ + void HBQPlainTextEdit::horzRulerPaintEvent( QPaintEvent *event ) { int fontWidth = fontMetrics().averageCharWidth(); diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h index a93f9e5095..ce11d3eda5 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h @@ -219,6 +219,7 @@ private slots: void hbHitTest( const QPoint & ); bool hbKeyPressSelectionByApplication( QKeyEvent * event ); int hbFirstVisibleColumn(); + void hbDrawCursor( QPaintEvent * ); }; diff --git a/harbour/contrib/hbqt/hbqt_hbslots.cpp b/harbour/contrib/hbqt/hbqt_hbslots.cpp index 751dfc1cdf..84b18d23f8 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.cpp +++ b/harbour/contrib/hbqt/hbqt_hbslots.cpp @@ -122,6 +122,13 @@ static bool connect_signal( QString signal, QObject * object, HBSlots * t_slots if( signal == ( QString ) "itemEntered(QLWItem)" ) return object->connect( object, SIGNAL( itemEntered( QListWidgetItem * ) ), t_slots, SLOT( itemEntered( QListWidgetItem * ) ), Qt::AutoConnection ); if( signal == ( QString ) "itemPressed(QLWItem)" ) return object->connect( object, SIGNAL( itemPressed( QListWidgetItem * ) ), t_slots, SLOT( itemPressed( QListWidgetItem * ) ), Qt::AutoConnection ); /* QTableWidget */ + if( signal == ( QString ) "cellActivated(int,in)" ) return object->connect( object, SIGNAL( cellActivated( int, int ) ), t_slots, SLOT( cellActivated( int, int ) ), Qt::AutoConnection ); + if( signal == ( QString ) "cellChanged(int,int)" ) return object->connect( object, SIGNAL( cellChanged( int, int ) ), t_slots, SLOT( cellChanged( int, int ) ), Qt::AutoConnection ); + if( signal == ( QString ) "cellClicked(int,int)" ) return object->connect( object, SIGNAL( cellClicked( int, int ) ), t_slots, SLOT( cellClicked( int, int ) ), Qt::AutoConnection ); + if( signal == ( QString ) "cellDoubleClicked(int,int)" ) return object->connect( object, SIGNAL( cellDoubleClicked( int, int ) ), t_slots, SLOT( cellDoubleClicked( int, int ) ), Qt::AutoConnection ); + if( signal == ( QString ) "cellEntered(int,int)" ) return object->connect( object, SIGNAL( cellEntered( int, int ) ), t_slots, SLOT( cellEntered( int, int ) ), Qt::AutoConnection ); + if( signal == ( QString ) "cellPressed(int,int)" ) return object->connect( object, SIGNAL( cellPressed( int, int ) ), t_slots, SLOT( cellPressed( int, int ) ), Qt::AutoConnection ); + if( signal == ( QString ) "currentCellChanged(int,int,int,int)" ) return object->connect( object, SIGNAL( currentCellChanged( int, int, int, int ) ), t_slots, SLOT( currentCellChanged( int, int, int, int ) ), Qt::AutoConnection ); if( signal == ( QString ) "currentItemChanged(QTblWItem,QLWItem)" ) return object->connect( object, SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ), t_slots, SLOT( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ), Qt::AutoConnection ); if( signal == ( QString ) "itemActivated(QTblWItem)" ) return object->connect( object, SIGNAL( itemActivated( QTableWidgetItem * ) ), t_slots, SLOT( itemActivated( QTableWidgetItem * ) ), Qt::AutoConnection ); if( signal == ( QString ) "itemChanged(QTblWItem)" ) return object->connect( object, SIGNAL( itemChanged( QTableWidgetItem * ) ), t_slots, SLOT( itemChanged( QTableWidgetItem * ) ), Qt::AutoConnection ); @@ -174,13 +181,6 @@ static bool connect_signal( QString signal, QObject * object, HBSlots * t_slots if( signal == ( QString ) "buttonReleased(int)" ) return object->connect( object, SIGNAL( buttonReleased( int ) ), t_slots, SLOT( buttonReleased( int ) ), Qt::AutoConnection ); if( signal == ( QString ) "linkActivated(QString)" ) return object->connect( object, SIGNAL( linkActivated( const QString & ) ), t_slots, SLOT( linkActivated( const QString & ) ), Qt::AutoConnection ); if( signal == ( QString ) "linkHovered(QString)" ) return object->connect( object, SIGNAL( linkHovered( const QString & ) ), t_slots, SLOT( linkHovered( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellActivated(int,int)" ) return object->connect( object, SIGNAL( cellActivated( int, int ) ), t_slots, SLOT( cellActivated( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellChanged(int,int)" ) return object->connect( object, SIGNAL( cellChanged( int, int ) ), t_slots, SLOT( cellChanged( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellClicked(int,int)" ) return object->connect( object, SIGNAL( cellClicked( int, int ) ), t_slots, SLOT( cellClicked( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellDoubleClicked(int,int)" ) return object->connect( object, SIGNAL( cellDoubleClicked( int, int ) ), t_slots, SLOT( cellDoubleClicked( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellEntered(int,int)" ) return object->connect( object, SIGNAL( cellEntered( int, int ) ), t_slots, SLOT( cellEntered( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellPressed(int,int)" ) return object->connect( object, SIGNAL( cellPressed( int, int ) ), t_slots, SLOT( cellPressed( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentCellChanged(int,int,int,int)" ) return object->connect( object, SIGNAL( currentCellChanged( int, int, int, int ) ), t_slots, SLOT( currentCellChanged( int, int, int, int ) ), Qt::AutoConnection ); if( signal == ( QString ) "tabCloseRequested(int)" ) return object->connect( object, SIGNAL( tabCloseRequested( int ) ), t_slots, SLOT( tabCloseRequested( int ) ), Qt::AutoConnection ); if( signal == ( QString ) "paintRequested(QPrinter)" ) return object->connect( object, SIGNAL( paintRequested( QPrinter * ) ), t_slots, SLOT( paintRequested( QPrinter * ) ), Qt::AutoConnection ); /* QIODevice & QProcess */ @@ -282,6 +282,13 @@ static bool disconnect_signal( QObject * object, const char * signal ) if( signal == ( QString ) "itemPressed(QTWItem)" ) return object->disconnect( SIGNAL( itemPressed( QTreeWidgetItem *, int ) ) ); if( signal == ( QString ) "itemSelectionChanged()" ) return object->disconnect( SIGNAL( itemSelectionChanged() ) ); /* QTableWidget */ + if( signal == ( QString ) "cellActivated(int,in)" ) return object->disconnect( SIGNAL( cellActivated( int, int ) ) ); + if( signal == ( QString ) "cellChanged(int,int)" ) return object->disconnect( SIGNAL( cellChanged( int, int ) ) ); + if( signal == ( QString ) "cellClicked(int,int)" ) return object->disconnect( SIGNAL( cellClicked( int, int ) ) ); + if( signal == ( QString ) "cellDoubleClicked(int,int)" ) return object->disconnect( SIGNAL( cellDoubleClicked( int, int ) ) ); + if( signal == ( QString ) "cellEntered(int,int)" ) return object->disconnect( SIGNAL( cellEntered( int, int ) ) ); + if( signal == ( QString ) "cellPressed(int,int)" ) return object->disconnect( SIGNAL( cellPressed( int, int ) ) ); + if( signal == ( QString ) "currentCellChanged(int,int,int,int)" ) return object->disconnect( SIGNAL( currentCellChanged( int, int, int, int ) ) ); if( signal == ( QString ) "currentItemChanged(QTblWItem)" ) return object->disconnect( SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ) ); if( signal == ( QString ) "itemActivated(QTblWItem)" ) return object->disconnect( SIGNAL( itemActivated( QTableWidgetItem * ) ) ); if( signal == ( QString ) "itemChanged(QTblWItem)" ) return object->disconnect( SIGNAL( itemChanged( QTableWidgetItem * ) ) ); @@ -336,13 +343,6 @@ static bool disconnect_signal( QObject * object, const char * signal ) if( signal == ( QString ) "buttonReleased(int)" ) return object->disconnect( SIGNAL( buttonReleased( int ) ) ); if( signal == ( QString ) "linkActivated(QString)" ) return object->disconnect( SIGNAL( linkActivated( const QString & ) ) ); if( signal == ( QString ) "linkHovered(QString)" ) return object->disconnect( SIGNAL( linkHovered( const QString & ) ) ); - if( signal == ( QString ) "cellActivated(int,int)" ) return object->disconnect( SIGNAL( cellActivated( int, int ) ) ); - if( signal == ( QString ) "cellChanged(int,int)" ) return object->disconnect( SIGNAL( cellChanged( int, int ) ) ); - if( signal == ( QString ) "cellClicked(int,int)" ) return object->disconnect( SIGNAL( cellClicked( int, int ) ) ); - if( signal == ( QString ) "cellDoubleClicked(int,int)" ) return object->disconnect( SIGNAL( cellDoubleClicked( int, int ) ) ); - if( signal == ( QString ) "cellEntered(int,int)" ) return object->disconnect( SIGNAL( cellEntered( int, int ) ) ); - if( signal == ( QString ) "cellPressed(int,int)" ) return object->disconnect( SIGNAL( cellPressed( int, int ) ) ); - if( signal == ( QString ) "currentCellChanged(int,int,int,int)" ) return object->disconnect( SIGNAL( currentCellChanged( int, int, int, int ) ) ); if( signal == ( QString ) "tabCloseRequested(int)" ) return object->disconnect( SIGNAL( tabCloseRequested( int ) ) ); if( signal == ( QString ) "paintRequested(QPrinter)" ) return object->disconnect( SIGNAL( paintRequested( QPrinter * ) ) ); /* QIODevice & QProcess */ @@ -951,13 +951,6 @@ void HBSlots::buttonPressed( int id ) void HBSlots::buttonReleased( int id ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "buttonReleased(int)", id ); } void HBSlots::linkActivated( const QString & link ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "linkActivated(QString)", link ); } void HBSlots::linkHovered( const QString & link ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "linkHovered(QString)", link ); } -void HBSlots::cellActivated( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellActivated(int,int)", row, column ); } -void HBSlots::cellChanged( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellChanged(int,int)", row, column ); } -void HBSlots::cellClicked( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellClicked(int,int)", row, column ); } -void HBSlots::cellDoubleClicked( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellDoubleClicked(int,int)", row, column ); } -void HBSlots::cellEntered( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellEntered(int,int)", row, column ); } -void HBSlots::cellPressed( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellEntered(int,int)", row, column ); } -void HBSlots::currentCellChanged( int currentRow, int currentColumn, int previousRow, int previousColumn ) { hbqt_SlotsExecIntIntIntInt( this, qobject_cast( sender() ), "currentCellChanged(int,int,int,int)", currentRow, currentColumn, previousRow, previousColumn ); } void HBSlots::tabCloseRequested( int index ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "tabCloseRequested(int)", index ); } void HBSlots::paintRequested( QPrinter * printer ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "paintRequested(QPrinter)", printer ); } /* QIODevice */ @@ -1003,6 +996,13 @@ void HBSlots::itemDoubleClicked( QListWidgetItem * item ) void HBSlots::itemEntered( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemEntered(QLWItem)", item ); } void HBSlots::itemPressed( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemPressed(QLWItem)", item ); } /* QTableWidget */ +void HBSlots::cellActivated( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellActivated(int,int)", row, column ); } +void HBSlots::cellChanged( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellChanged(int,int)", row, column ); } +void HBSlots::cellClicked( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellClicked(int,int)", row, column ); } +void HBSlots::cellDoubleClicked( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellDoubleClicked(int,int)", row, column ); } +void HBSlots::cellEntered( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellEntered(int,int)", row, column ); } +void HBSlots::cellPressed( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellEntered(int,int)", row, column ); } +void HBSlots::currentCellChanged( int currentRow, int currentColumn, int previousRow, int previousColumn ) { hbqt_SlotsExecIntIntIntInt( this, qobject_cast( sender() ), "currentCellChanged(int,int,int,int)", currentRow, currentColumn, previousRow, previousColumn ); } void HBSlots::currentItemChanged( QTableWidgetItem * current, QTableWidgetItem * previous ) { hbqt_SlotsExecPointerPointer( this, qobject_cast( sender() ), "currentItemChanged(QTblWItem,QLWItem)", current, previous ); } void HBSlots::itemActivated( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemActivated(QTblWItem)", item ); } void HBSlots::itemChanged( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemChanged(QTblWItem)", item ); } diff --git a/harbour/contrib/hbqt/hbqt_hbslots.h b/harbour/contrib/hbqt/hbqt_hbslots.h index 81fa502283..d1d7e77191 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.h +++ b/harbour/contrib/hbqt/hbqt_hbslots.h @@ -205,14 +205,6 @@ public slots: void buttonReleased( int id ); void linkActivated( const QString & link ); void linkHovered( const QString & link ); - /* QTableWidget */ - void cellActivated( int row, int column ); - void cellChanged( int row, int column ); - void cellClicked( int row, int column ); - void cellDoubleClicked( int row, int column ); - void cellEntered( int row, int column ); - void cellPressed( int row, int column ); - void currentCellChanged( int currentRow, int currentColumn, int previousRow, int previousColumn );; void tabCloseRequested( int index ); void paintRequested( QPrinter * printer ); /* QIODevice */ @@ -258,6 +250,13 @@ public slots: void itemEntered( QListWidgetItem * item ); void itemPressed( QListWidgetItem * item ); /* QTableWidget */ + void cellActivated( int row, int column ); + void cellChanged( int row, int column ); + void cellClicked( int row, int column ); + void cellDoubleClicked( int row, int column ); + void cellEntered( int row, int column ); + void cellPressed( int row, int column ); + void currentCellChanged( int currentRow, int currentColumn, int previousRow, int previousColumn ); void currentItemChanged( QTableWidgetItem * current, QTableWidgetItem * previous ); void itemActivated( QTableWidgetItem * item ); void itemChanged( QTableWidgetItem * item );