2010-09-28 09:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtwebkit/g/TQWebSecurityOrigin.prg
* contrib/hbqt/qtwebkit/g/TQWebSettings.prg
* contrib/hbqt/qtwebkit/g/TQWebView.prg
* contrib/hbide/hbqreportsmanager.prg
* contrib/hbide/hbqtoolbar.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/idebrowse.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/idedocwriter.prg
* contrib/hbide/ideedit.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/idefindreplace.prg
* contrib/hbide/idefunctions.prg
* contrib/hbide/ideharbourhelp.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
* contrib/hbide/idesaveload.prg
* contrib/hbide/ideshortcuts.prg
* contrib/hbide/ideskeletons.prg
* contrib/hbide/idethemes.prg
* contrib/hbide/idetools.prg
! Adopted to latest changes.
* contrib/hbxbp/hbpprocess.prg
* contrib/hbxbp/xbp3state.prg
* contrib/hbxbp/xbpappevent.prg
* contrib/hbxbp/xbpbitmap.prg
* contrib/hbxbp/xbpbrowse.prg
* contrib/hbxbp/xbpcheckbox.prg
* contrib/hbxbp/xbpclipboard.prg
* contrib/hbxbp/xbpcombobox.prg
* contrib/hbxbp/xbpdialog.prg
* contrib/hbxbp/xbpfiledialog.prg
* contrib/hbxbp/xbpfontdialog.prg
* contrib/hbxbp/xbphtmlviewer.prg
* contrib/hbxbp/xbplistbox.prg
* contrib/hbxbp/xbpmenubar.prg
* contrib/hbxbp/xbpmle.prg
* contrib/hbxbp/xbpprintdialog.prg
* contrib/hbxbp/xbppushbutton.prg
* contrib/hbxbp/xbpradiobutton.prg
* contrib/hbxbp/xbprtf.prg
* contrib/hbxbp/xbpscrollbar.prg
* contrib/hbxbp/xbpsle.prg
* contrib/hbxbp/xbpspinbutton.prg
* contrib/hbxbp/xbpstatic.prg
* contrib/hbxbp/xbpstatusbar.prg
* contrib/hbxbp/xbptabpage.prg
* contrib/hbxbp/xbptoolbar.prg
* contrib/hbxbp/xbptreeview.prg
* contrib/hbxbp/xbpwindow.prg
* Adopted to latest changes.
* contrib/hbqt/tests/demoqt.prg
* Adopted to latest changes.
* contrib/hbqt/utils/hbqtgen.prg
+ Implemented: many-t-one class method call on PRG level.
NOTES: this implementation is a leap forward in the evolution of hbQT.
Now any method call returns the Harbour compatible type.
It means any Qt method call which is expected to return a
hbQT object was returning a pointer to the object, now returns
a hbQT class object instance instead.
So, the code like this:
qCursor := QTextCursor():from( qDoc:textCursor() )
=>
qCursor := qDoc:textCursor()
And this implementation is exactly like Qt itself
where you can pass the return object directly as an
argument to the another method call.
pw := iif( abs( ::pen():widthF() ) > 0, abs( ::pen():widthF() ), 1 )
See hbIDE code to review how it is simplified by now.
WARNING: regression is highly possible and may be hbIDE become
unstable for some time.
3rd party libraries: adopt new code to your advantage.
Many things are incompatible now.
This commit is contained in:
@@ -16,6 +16,90 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-09-28 09:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtwebkit/g/TQWebSecurityOrigin.prg
|
||||
* contrib/hbqt/qtwebkit/g/TQWebSettings.prg
|
||||
* contrib/hbqt/qtwebkit/g/TQWebView.prg
|
||||
|
||||
* contrib/hbide/hbqreportsmanager.prg
|
||||
* contrib/hbide/hbqtoolbar.prg
|
||||
* contrib/hbide/ideactions.prg
|
||||
* contrib/hbide/idebrowse.prg
|
||||
* contrib/hbide/idedocks.prg
|
||||
* contrib/hbide/idedocwriter.prg
|
||||
* contrib/hbide/ideedit.prg
|
||||
* contrib/hbide/ideeditor.prg
|
||||
* contrib/hbide/idefindreplace.prg
|
||||
* contrib/hbide/idefunctions.prg
|
||||
* contrib/hbide/ideharbourhelp.prg
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
* contrib/hbide/idesaveload.prg
|
||||
* contrib/hbide/ideshortcuts.prg
|
||||
* contrib/hbide/ideskeletons.prg
|
||||
* contrib/hbide/idethemes.prg
|
||||
* contrib/hbide/idetools.prg
|
||||
! Adopted to latest changes.
|
||||
|
||||
* contrib/hbxbp/hbpprocess.prg
|
||||
* contrib/hbxbp/xbp3state.prg
|
||||
* contrib/hbxbp/xbpappevent.prg
|
||||
* contrib/hbxbp/xbpbitmap.prg
|
||||
* contrib/hbxbp/xbpbrowse.prg
|
||||
* contrib/hbxbp/xbpcheckbox.prg
|
||||
* contrib/hbxbp/xbpclipboard.prg
|
||||
* contrib/hbxbp/xbpcombobox.prg
|
||||
* contrib/hbxbp/xbpdialog.prg
|
||||
* contrib/hbxbp/xbpfiledialog.prg
|
||||
* contrib/hbxbp/xbpfontdialog.prg
|
||||
* contrib/hbxbp/xbphtmlviewer.prg
|
||||
* contrib/hbxbp/xbplistbox.prg
|
||||
* contrib/hbxbp/xbpmenubar.prg
|
||||
* contrib/hbxbp/xbpmle.prg
|
||||
* contrib/hbxbp/xbpprintdialog.prg
|
||||
* contrib/hbxbp/xbppushbutton.prg
|
||||
* contrib/hbxbp/xbpradiobutton.prg
|
||||
* contrib/hbxbp/xbprtf.prg
|
||||
* contrib/hbxbp/xbpscrollbar.prg
|
||||
* contrib/hbxbp/xbpsle.prg
|
||||
* contrib/hbxbp/xbpspinbutton.prg
|
||||
* contrib/hbxbp/xbpstatic.prg
|
||||
* contrib/hbxbp/xbpstatusbar.prg
|
||||
* contrib/hbxbp/xbptabpage.prg
|
||||
* contrib/hbxbp/xbptoolbar.prg
|
||||
* contrib/hbxbp/xbptreeview.prg
|
||||
* contrib/hbxbp/xbpwindow.prg
|
||||
* Adopted to latest changes.
|
||||
|
||||
* contrib/hbqt/tests/demoqt.prg
|
||||
* Adopted to latest changes.
|
||||
|
||||
* contrib/hbqt/utils/hbqtgen.prg
|
||||
+ Implemented: many-t-one class method call on PRG level.
|
||||
|
||||
NOTES: this implementation is a leap forward in the evolution of hbQT.
|
||||
Now any method call returns the Harbour compatible type.
|
||||
It means any Qt method call which is expected to return a
|
||||
hbQT object was returning a pointer to the object, now returns
|
||||
a hbQT class object instance instead.
|
||||
|
||||
So, the code like this:
|
||||
qCursor := QTextCursor():from( qDoc:textCursor() )
|
||||
=>
|
||||
qCursor := qDoc:textCursor()
|
||||
And this implementation is exactly like Qt itself
|
||||
where you can pass the return object directly as an
|
||||
argument to the another method call.
|
||||
pw := iif( abs( ::pen():widthF() ) > 0, abs( ::pen():widthF() ), 1 )
|
||||
|
||||
See hbIDE code to review how it is simplified by now.
|
||||
|
||||
WARNING: regression is highly possible and may be hbIDE become
|
||||
unstable for some time.
|
||||
|
||||
3rd party libraries: adopt new code to your advantage.
|
||||
Many things are incompatible now.
|
||||
|
||||
2010-09-28 09:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtgui/qth/QDesktopServices.qth
|
||||
* contrib/hbqt/qtgui/qth/QGraphicsScene.qth
|
||||
|
||||
@@ -197,7 +197,7 @@ CLASS HbqReportsManager
|
||||
DATA qByte
|
||||
DATA qMime
|
||||
DATA qPix
|
||||
DATA pAct
|
||||
DATA qAct
|
||||
DATA qShapesMenu
|
||||
DATA aShapesAct INIT array( NUM_SHAPES )
|
||||
|
||||
@@ -263,30 +263,24 @@ METHOD HbqReportsManager:create( qParent )
|
||||
|
||||
/* Toolbar */
|
||||
::buildToolbar()
|
||||
//::qLayout:addWidget_1( ::qToolbar:oWidget , 0, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::qToolbar:oWidget , 0, 0, 1, 2 )
|
||||
::buildToolbarAlign()
|
||||
//::qLayout:addWidget_1( ::qToolbarAlign:oWidget , 1, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::qToolbarAlign:oWidget , 1, 0, 1, 2 )
|
||||
|
||||
/* Toolbar left */
|
||||
::buildToolbarLeft()
|
||||
//::qLayout:addWidget_1( ::qToolbarL:oWidget , 2, 0, 2, 1 )
|
||||
::qLayout:addWidget( ::qToolbarL:oWidget , 2, 0, 2, 1 )
|
||||
|
||||
/* ::qTabBar */
|
||||
::buildTabBar()
|
||||
//::qLayout:addWidget_1( ::qTabBar , 2, 1, 1, 1 )
|
||||
::qLayout:addWidget( ::qTabBar , 2, 1, 1, 1 )
|
||||
|
||||
/* Stacked widget */
|
||||
::buildStacks()
|
||||
//::qLayout:addWidget_1( ::qStack , 3, 1, 1, 1 )
|
||||
::qLayout:addWidget( ::qStack , 3, 1, 1, 1 )
|
||||
|
||||
/* StatusBar */
|
||||
::buildStatusBar()
|
||||
//::qLayout:addWidget_1( ::qStatus , 4, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::qStatus , 4, 0, 1, 2 )
|
||||
|
||||
/* Document manipulation interface */
|
||||
@@ -430,7 +424,7 @@ METHOD HbqReportsManager:buildDesignReport()
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 )
|
||||
LOCAL qEvent, qMime, qItem, i, qList, cFile, nArea, aStruct, cAlias, cPath, qRC, qAct, qIcon, cType
|
||||
LOCAL qEvent, qMime, qItem, i, qList, cFile, nArea, aStruct, cAlias, cPath, qRC, qIcon, cType
|
||||
|
||||
SWITCH cEvent
|
||||
CASE "graphicsScene_block"
|
||||
@@ -459,16 +453,16 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 )
|
||||
CASE p == QEvent_GraphicsSceneDragLeave
|
||||
|
||||
CASE p == QEvent_GraphicsSceneDrop
|
||||
qMime := QMimeData():from( qEvent:mimeData() )
|
||||
qMime := qEvent:mimeData()
|
||||
IF qMime:hasFormat( "application/x-qabstractitemmodeldatalist" )
|
||||
IF p2[ 1 ] == "DataTree"
|
||||
IF p2[ 2 ] != p2[ 3 ]
|
||||
::addField( p2[ 2 ], p2[ 3 ], QPointF():from( qEvent:scenePos() ), NIL )
|
||||
::addField( p2[ 2 ], p2[ 3 ], qEvent:scenePos(), NIL )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
ELSEIF qMime:hasFormat( "application/x-toolbaricon" )
|
||||
::addObject( qMime:html(), QPointF():from( qEvent:scenePos() ), NIL )
|
||||
::addObject( qMime:html(), qEvent:scenePos(), NIL )
|
||||
|
||||
ELSEIF qMime:hasFormat( "application/x-menuitem" )
|
||||
cType := qMime:html()
|
||||
@@ -485,10 +479,10 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 )
|
||||
CASE "Diagonal Line Right"; cType := "LineDR" ; EXIT
|
||||
CASE "Diagonal Line Left" ; cType := "LineDL" ; EXIT
|
||||
ENDSWITCH
|
||||
::addObject( cType, QPointF():from( qEvent:scenePos() ), NIL )
|
||||
::addObject( cType, qEvent:scenePos(), NIL )
|
||||
|
||||
ELSEIF qMime:hasUrls()
|
||||
qList := QStringList():from( qMime:hbUrlList() )
|
||||
qList := qMime:hbUrlList()
|
||||
FOR i := 0 TO qList:size() - 1
|
||||
cFile := ( QUrl( qList:at( i ) ) ):toLocalFile()
|
||||
|
||||
@@ -534,22 +528,21 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 )
|
||||
EXIT
|
||||
|
||||
CASE "QEvent_MouseMoveMenu"
|
||||
IF empty( ::qPos ) .OR. empty( ::pAct ) .OR. hbqt_isEmptyQtPointer( ::pAct )
|
||||
IF empty( ::qPos ) .OR. empty( ::qAct ) .OR. ! ::qAct:isValidObject()
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
qEvent := QMouseEvent():from( p )
|
||||
qRC := QRect():from( ( QRect( ::qPos:x() - 5, ::qPos:y() - 5, 10, 10 ) ):normalized() )
|
||||
qRC := QRect( ::qPos:x() - 5, ::qPos:y() - 5, 10, 10 ):normalized()
|
||||
|
||||
IF qRC:contains( qEvent:pos() )
|
||||
qAct := QAction():from( ::pAct )
|
||||
qIcon := QIcon( qAct:icon() )
|
||||
qIcon := QIcon( ::qAct:icon() )
|
||||
|
||||
::qByte := QByteArray( qAct:text() )
|
||||
::qByte := QByteArray( ::qAct:text() )
|
||||
|
||||
::qMime := QMimeData()
|
||||
::qMime:setData( "application/x-menuitem", ::qByte )
|
||||
::qMime:setHtml( qAct:text() )
|
||||
::qMime:setHtml( ::qAct:text() )
|
||||
|
||||
::qPix := QPixmap( qIcon:pixmap( 16,16 ) )
|
||||
|
||||
@@ -563,7 +556,7 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 )
|
||||
ENDIF
|
||||
::qDrag := NIL
|
||||
::qPos := NIL
|
||||
::pAct := NIL
|
||||
::qAct := NIL
|
||||
EXIT
|
||||
CASE "QEvent_MouseReleaseMenu"
|
||||
::qDrag := NIL
|
||||
@@ -572,8 +565,8 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 )
|
||||
EXIT
|
||||
CASE "QEvent_MousePressMenu"
|
||||
qEvent := QMouseEvent():from( p )
|
||||
::qPos := QPoint():from( qEvent:pos() )
|
||||
::pAct := ::qShapesMenu:actionAt( qEvent:pos() )
|
||||
::qPos := qEvent:pos()
|
||||
::qAct := ::qShapesMenu:actionAt( qEvent:pos() )
|
||||
EXIT
|
||||
|
||||
CASE "buttonShapes_clicked"
|
||||
@@ -675,7 +668,7 @@ METHOD HbqReportsManager:openReport()
|
||||
qFileDlg:setNameFilter( "HB Reports (*.hqr)" )
|
||||
|
||||
IF qFileDlg:exec() == 1
|
||||
qList := QStringList():from( qFileDlg:selectedFiles() )
|
||||
qList := qFileDlg:selectedFiles()
|
||||
cFile := qList:at( 0 )
|
||||
IF !empty( cFile ) .AND. lower( right( cFile, 4 ) ) == ".hqr"
|
||||
::loadReport( cFile )
|
||||
@@ -701,7 +694,7 @@ METHOD HbqReportsManager:saveReport( lSaveAs )
|
||||
qFileDlg:setNameFilter( "HB Reports (*.hqr)" )
|
||||
|
||||
IF qFileDlg:exec() == 1
|
||||
qList := QStringList():from( qFileDlg:selectedFiles() )
|
||||
qList := qFileDlg:selectedFiles()
|
||||
cFile := qList:at( 0 )
|
||||
hb_fNameSplit( cFile, , , @cExt )
|
||||
IF empty( cExt )
|
||||
@@ -768,8 +761,8 @@ METHOD HbqReportsManager:buildReportStream()
|
||||
n := a_:__enumIndex()
|
||||
IF hb_hHasKey( ::hItems, a_[ 3 ] )
|
||||
oWidget := ::hItems[ a_[ 3 ] ]:oWidget
|
||||
qPos := QPointF():from( oWidget:scenePos() )
|
||||
qTran := QTransform():from( oWidget:transform() )
|
||||
qPos := oWidget:scenePos()
|
||||
qTran := oWidget:transform()
|
||||
|
||||
a_[ 5 ] := { { 0, 0, oWidget:width(), oWidget:height() }, ;
|
||||
{ qPos:x(), qPos:y() }, ;
|
||||
@@ -1073,7 +1066,7 @@ METHOD HbqReportsManager:zoom( nMode )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbqReportsManager:contextMenuScene( p1 )
|
||||
LOCAL qMenu, qEvent, pAct
|
||||
LOCAL qMenu, qEvent, qAct
|
||||
|
||||
qEvent := QGraphicsSceneContextMenuEvent():from( p1 )
|
||||
|
||||
@@ -1081,9 +1074,8 @@ METHOD HbqReportsManager:contextMenuScene( p1 )
|
||||
qMenu:addAction( "Refresh" )
|
||||
qMenu:addAction( "Zoom+" )
|
||||
|
||||
pAct := qMenu:exec( qEvent:screenPos() )
|
||||
IF ! hbqt_isEmptyQtPointer( pAct )
|
||||
SWITCH ( QAction():configure( pAct ) ):text()
|
||||
IF ( qAct := qMenu:exec( qEvent:screenPos() ) ):isValidObject()
|
||||
SWITCH qAct:text()
|
||||
CASE "Refresh"
|
||||
EXIT
|
||||
CASE "Zoom+"
|
||||
@@ -1096,7 +1088,7 @@ METHOD HbqReportsManager:contextMenuScene( p1 )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbqReportsManager:contextMenuItem( p1, p2 )
|
||||
LOCAL qMenu, qEvent, pAct
|
||||
LOCAL qMenu, qEvent, qAct
|
||||
|
||||
HB_SYMBOL_UNUSED( p2 )
|
||||
|
||||
@@ -1106,9 +1098,8 @@ METHOD HbqReportsManager:contextMenuItem( p1, p2 )
|
||||
qMenu:addAction( "Cut" )
|
||||
qMenu:addAction( "Copy" )
|
||||
|
||||
pAct := qMenu:exec( qEvent:screenPos() )
|
||||
IF ! hbqt_isEmptyQtPointer( pAct )
|
||||
SWITCH ( QAction():configure( pAct ) ):text()
|
||||
IF ( qAct := qMenu:exec( qEvent:screenPos() ) ):isValidObject()
|
||||
SWITCH qAct:text()
|
||||
CASE "Cut"
|
||||
EXIT
|
||||
CASE "Copy"
|
||||
@@ -1337,7 +1328,7 @@ METHOD HbqReportsManager:execMenuShapes()
|
||||
|
||||
qBtn := ::qToolbarL:getItem( "Shapes" )
|
||||
//
|
||||
qPos := QPoint():from( ::qToolbarL:mapToGlobal( qBtn:pos() ) )
|
||||
qPos := ::qToolbarL:mapToGlobal( qBtn:pos() )
|
||||
qPos:setX( qPos:x() + qBtn:width() / 2 )
|
||||
qPos:setY( qPos:y() + qBtn:height() / 2 )
|
||||
|
||||
@@ -1519,14 +1510,14 @@ METHOD HbqReportsManager:printPreview( qPrinter )
|
||||
qPrinter := QPrinter()
|
||||
|
||||
qInfo := QPrinterInfo( "QPrinter", qPrinter )
|
||||
qList := QList():from( qInfo:availablePrinters() )
|
||||
qList := qInfo:availablePrinters()
|
||||
FOR i := 0 TO qList:size() - 1
|
||||
qStr := QPrinterInfo():from( qList:at( i ) )
|
||||
qStr := qList:at( i )
|
||||
//HB_TRACE( HB_TR_ALWAYS, qList:at( i ), valtype( qList:at( i ) ), qStr:printerName() )
|
||||
NEXT
|
||||
qPrinter:setOutputFormat( QPrinter_PdfFormat )
|
||||
qPrinter:setOrientation( ::qScene:orientation() )
|
||||
qPrinter:setPaperSize( QRectF():from( ::qScene:paperRect() ):size() )
|
||||
qPrinter:setPaperSize( ::qScene:pageSize() )
|
||||
// qPrinter:setFullPage( .t. )
|
||||
|
||||
qDlg := QPrintPreviewDialog( qPrinter, ::qView )
|
||||
@@ -1557,15 +1548,15 @@ METHOD HbqReportsManager:printReport( qPrinter )
|
||||
qPainter := QPainter()
|
||||
qPainter:begin( qPrinter )
|
||||
|
||||
qPainter:setWindow( QRectF():from( ::qScene:paperRect() ) )
|
||||
qPainter:setWindow( ::qScene:paperRect() )
|
||||
qPainter:setViewPort( 0, 0, qPrinter:width(), qPrinter:height() )
|
||||
FOR EACH a_ IN ::aObjects
|
||||
IF hb_hHasKey( ::hItems, a_[ 3 ] )
|
||||
oHqrObject := ::hItems[ a_[ 3 ] ]
|
||||
qRectF := QRectF():from( oHqrObject:geometry() )
|
||||
qRectF := oHqrObject:geometry()
|
||||
qRectF := QRectF( TO_MMS( qRectF:x() ), TO_MMS( qRectF:y() ), TO_MMS( qRectF:width() ), TO_MMS( qRectF:height() ) )
|
||||
|
||||
qT := QTransform():from( oHqrObject:transform() )
|
||||
qT := oHqrObject:transform()
|
||||
//HB_TRACE( HB_TR_ALWAYS, qT:m11(), qT:m12(), qT:m13(), qT:m21(), qT:m22(), qT:m23(), qT:m31(), qT:m32(), qT:m33() )
|
||||
qT:translate( 0,0 )
|
||||
qPainter:resetMatrix()
|
||||
@@ -1811,8 +1802,9 @@ METHOD HqrGraphicsItem:execEvent( cEvent, p, p1, p2 )
|
||||
::oRM:objectSelected( Self )
|
||||
|
||||
CASE p == 21017
|
||||
qPainter := QPainter():from( p1 )
|
||||
qRect := QRectF():from( p2 )
|
||||
//qPainter := QPainter():from( p1 )
|
||||
qPainter := HB_QPainter():from( p1 )
|
||||
qRect := HB_QRectF():from( p2 )
|
||||
::draw( qPainter, qRect )
|
||||
|
||||
CASE p == QEvent_GraphicsSceneContextMenu
|
||||
@@ -2084,7 +2076,7 @@ METHOD HqrGraphicsItem:setGeometry( ... )
|
||||
LOCAL qRectF, qPos, a_:= hb_aParams()
|
||||
SWITCH len( a_ )
|
||||
CASE 0
|
||||
qPos := QPointF():from( ::oWidget:pos() )
|
||||
qPos := ::oWidget:pos()
|
||||
RETURN QRectF( qPos:x(), qPos:y(), ::width(), ::height() )
|
||||
CASE 1
|
||||
IF hb_isObject( a_[ 1 ] )
|
||||
@@ -2110,7 +2102,7 @@ METHOD HqrGraphicsItem:setPos( ... )
|
||||
LOCAL a_:= hb_aParams()
|
||||
SWITCH len( a_ )
|
||||
CASE 0
|
||||
RETURN QPointF():from( ::oWidget:pos() )
|
||||
RETURN ::oWidget:pos()
|
||||
CASE 1
|
||||
IF hb_isObject( a_[ 1 ] )
|
||||
::oWidget:setPos( a_[ 1 ] )
|
||||
@@ -2122,7 +2114,7 @@ METHOD HqrGraphicsItem:setPos( ... )
|
||||
::update()
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
RETURN QPointF():from( ::oWidget:pos() )
|
||||
RETURN ::oWidget:pos()
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -2425,7 +2417,7 @@ METHOD HqrGraphicsItem:drawGradient( qPainter, qRect )
|
||||
METHOD HqrGraphicsItem:drawBarcode( qPainter, qRect )
|
||||
LOCAL fl, clr, rc, w, x, i, cCode
|
||||
|
||||
rc := QRectF():from( qRect:adjusted( 5, 5, -10, -10 ) )
|
||||
rc := qRect:adjusted( 5, 5, -10, -10 )
|
||||
|
||||
cCode := fetchBarString( ::text() )
|
||||
|
||||
@@ -2463,7 +2455,7 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect )
|
||||
sh := 0
|
||||
|
||||
IF drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE .OR. ::drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_BELOW
|
||||
textH = QFontMetricsF():from( qPainter:font() ):height()
|
||||
textH = qPainter:font():pixelSize()
|
||||
ENDIF
|
||||
|
||||
qPix := QPixmap( ::pixmap() )
|
||||
@@ -2473,7 +2465,7 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect )
|
||||
qPainter:drawRect( qRect )
|
||||
ELSE
|
||||
img := QImage( 0, 0 )
|
||||
point := QPointF():from( qRect:topLeft() )
|
||||
point := qRect:topLeft()
|
||||
cx := 0; cy := 0; cw := qPix:width(); ch := qPix:height()
|
||||
|
||||
SWITCH paintType
|
||||
@@ -2557,7 +2549,7 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect )
|
||||
LOCAL m_barsIdentation := 1.0 / UNIT
|
||||
LOCAL nColorFactor := 1.7
|
||||
|
||||
qFMetrix := QFontMetrics():from( qPainter:fontMetrics() )
|
||||
qFMetrix := qPainter:fontMetrics()
|
||||
nFHeight := qFMetrix:height()
|
||||
|
||||
IF empty( ::xData )
|
||||
@@ -2568,8 +2560,8 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect )
|
||||
aadd( ::xData, { "Mangoes", 095.0, rmgr_generateNextColor() } )
|
||||
ENDIF
|
||||
|
||||
maxpv := 0
|
||||
minnv := 0
|
||||
maxpv := 0
|
||||
minnv := 0
|
||||
aeval( ::xData, {|e_| iif( e_[ 2 ] < 0, minnv := min( minnv, e_[ 2 ] ), NIL ), iif( e_[ 2 ] > 0, maxpv := max( maxpv, e_[ 2 ] ), NIL ) } )
|
||||
|
||||
absMaxVal := maxpv - minnv
|
||||
@@ -2591,7 +2583,7 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect )
|
||||
ENDIF
|
||||
|
||||
pw := iif( abs( ::pen():widthF() ) > 0, abs( ::pen():widthF() ), 1 )
|
||||
rc := QRectF():from( qRect:adjusted( pw / 2, pw / 2, -pw, -pw ) )
|
||||
rc := qRect:adjusted( pw / 2, pw / 2, -pw, -pw )
|
||||
|
||||
f := 2
|
||||
chartStep := ( 10.0 ^ ( len( substr( cMaxVal, 1, nDec - 1 ) ) - 1 ) ) / f
|
||||
@@ -2630,7 +2622,7 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect )
|
||||
NEXT
|
||||
|
||||
qPainter:drawLine( rc:x() + maxLabelWidth + 1 / UNIT / 4, rc:y(), rc:x() + maxLabelWidth + 1 / UNIT / 4, rc:y() + qRect:height() )
|
||||
rc := QRectF():from( rc:adjusted( maxLabelWidth + 1 / UNIT / 4, 0, 0, 0 ) )
|
||||
rc := rc:adjusted( maxLabelWidth + 1 / UNIT / 4, 0, 0, 0 )
|
||||
ENDIF
|
||||
|
||||
IF m_showGrid
|
||||
@@ -2641,7 +2633,7 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect )
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
rc := QRectF():from( rc:adjusted( 0, nFHeight / 2, 0, 0 ) )
|
||||
rc := rc:adjusted( 0, nFHeight / 2, 0, 0 )
|
||||
x := m_barsIdentation
|
||||
barWidth := ( rc:width() - m_barsIdentation * ( len( ::xData ) + 1 ) ) / len( ::xData )
|
||||
py := maxHeight / maxVal
|
||||
|
||||
@@ -166,8 +166,7 @@ METHOD HbqToolbar:execEvent( cEvent, p, p1 )
|
||||
EXIT
|
||||
|
||||
CASE "QEvent_MouseMove"
|
||||
qRC := QRect():from( ( QRect( ::qPos:x() - 5, ::qPos:y() - 5, 10, 10 ) ):normalized() )
|
||||
|
||||
qRC := QRect( ::qPos:x() - 5, ::qPos:y() - 5, 10, 10 ):normalized()
|
||||
IF qRC:contains( qEvent:pos() )
|
||||
::qByte := QByteArray( ::hItems[ p1 ]:objectName() )
|
||||
|
||||
@@ -182,9 +181,7 @@ METHOD HbqToolbar:execEvent( cEvent, p, p1 )
|
||||
::qDrag:setPixmap( ::qPix )
|
||||
::qDrag:setHotSpot( QPoint( 15,15 ) )
|
||||
::qDrag:setDragCursor( ::qPix, Qt_MoveAction )
|
||||
|
||||
::qDropAction := ::qDrag:exec( Qt_MoveAction )
|
||||
|
||||
::qDrag := NIL
|
||||
::qPos := NIL
|
||||
::hItems[ p1 ]:setChecked( .f. )
|
||||
@@ -193,12 +190,11 @@ METHOD HbqToolbar:execEvent( cEvent, p, p1 )
|
||||
EXIT
|
||||
|
||||
CASE "QEvent_MouseRelease"
|
||||
HB_TRACE( HB_TR_ALWAYS, "QEvent_MouseRelease" )
|
||||
::qDrag := NIL
|
||||
EXIT
|
||||
|
||||
CASE "QEvent_MousePress"
|
||||
::qPos := QPoint():from( qEvent:pos() )
|
||||
::qPos := qEvent:pos()
|
||||
EXIT
|
||||
|
||||
CASE "buttonNew_clicked"
|
||||
@@ -228,7 +224,7 @@ METHOD HbqToolbar:addWidget( cName, qWidget )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbqToolbar:addToolButton( cName, cDesc, cImage, bAction, lCheckable, lDragEnabled )
|
||||
LOCAL oButton, qAction
|
||||
LOCAL oButton
|
||||
|
||||
STATIC nID := 0
|
||||
|
||||
@@ -253,13 +249,7 @@ METHOD HbqToolbar:addToolButton( cName, cDesc, cImage, bAction, lCheckable, lDra
|
||||
IF hb_isBlock( bAction )
|
||||
oButton:connect( "clicked()", bAction )
|
||||
ENDIF
|
||||
#if 1
|
||||
qAction := QWidgetAction( ::oWidget )
|
||||
qAction:setDefaultWidget( oButton )
|
||||
::oWidget:addAction( qAction )
|
||||
#else
|
||||
::oWidget:addWidget( oButton )
|
||||
#endif
|
||||
|
||||
::hItems[ cName ] := oButton
|
||||
RETURN oButton
|
||||
|
||||
@@ -115,7 +115,7 @@ METHOD IdeActions:destroy()
|
||||
LOCAL qAction
|
||||
|
||||
FOR EACH qAction IN ::hActions
|
||||
qAction:pPtr := NIL
|
||||
qAction := NIL
|
||||
NEXT
|
||||
RETURN Self
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ METHOD IdeBrowseManager:getPanelsInfo()
|
||||
aAttr[ TBL_RECORD ] := hb_ntos( oBrw:recNo() )
|
||||
aAttr[ TBL_CURSOR ] := hb_ntos( oBrw:nCursorType )
|
||||
IF !hb_isObject( aSub[ SUB_GEOMETRY ] )
|
||||
aSub[ SUB_GEOMETRY ] := QRect():from( aSub[ SUB_WINDOW ]:geometry() )
|
||||
aSub[ SUB_GEOMETRY ] := aSub[ SUB_WINDOW ]:geometry()
|
||||
ENDIF
|
||||
aAttr[ TBL_GEOMETRY ] := hb_ntos( aSub[ SUB_GEOMETRY ]:x() ) + " " + hb_ntos( aSub[ SUB_GEOMETRY ]:y() ) + " " + ;
|
||||
hb_ntos( aSub[ SUB_GEOMETRY ]:width() ) + " " + hb_ntos( aSub[ SUB_GEOMETRY ]:height() )
|
||||
@@ -308,23 +308,19 @@ METHOD IdeBrowseManager:create( oIde )
|
||||
|
||||
/* Toolbar */
|
||||
::buildToolbar()
|
||||
//::qLayout:addWidget_1( ::qToolbar, 0, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::qToolbar, 0, 0, 1, 2 )
|
||||
|
||||
/* Toolbar left */
|
||||
::buildLeftToolbar()
|
||||
//::qLayout:addWidget_1( ::qToolbarL, 1, 0, 1, 1 )
|
||||
::qLayout:addWidget( ::qToolbarL, 1, 0, 1, 1 )
|
||||
|
||||
/* Stacked widget */
|
||||
::qStack := QStackedWidget()
|
||||
//::qLayout:addWidget_1( ::qStack , 1, 1, 1, 1 )
|
||||
::qLayout:addWidget( ::qStack , 1, 1, 1, 1 )
|
||||
|
||||
/* StatusBar */
|
||||
::qStatus := QStatusBar()
|
||||
::qStatus:setSizeGripEnabled( .f. )
|
||||
//::qLayout:addWidget_1( ::qStatus , 2, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::qStatus , 2, 0, 1, 2 )
|
||||
|
||||
/* */
|
||||
@@ -462,7 +458,7 @@ METHOD IdeBrowseManager:addPanel( cPanel )
|
||||
METHOD IdeBrowseManager:addPanelsMenu( cPanel )
|
||||
LOCAL qAct
|
||||
|
||||
( qAct := QAction():from( ::qPanelsMenu:addAction( cPanel ) ) ):setIcon( hbide_image( "panel_7" ) )
|
||||
( qAct := ::qPanelsMenu:addAction( cPanel ) ):setIcon( hbide_image( "panel_7" ) )
|
||||
qAct:connect( "triggered(bool)", {|| ::setPanel( cPanel ) } )
|
||||
aadd( ::aPanelsAct, qAct )
|
||||
|
||||
@@ -503,9 +499,9 @@ METHOD IdeBrowseManager:execEvent( cEvent, p, p1 )
|
||||
|
||||
CASE "dockDbu_dropEvent"
|
||||
qEvent := QDropEvent():from( p )
|
||||
qMime := QMimeData():from( qEvent:mimeData() )
|
||||
qMime := qEvent:mimeData()
|
||||
IF qMime:hasUrls()
|
||||
qList := QStringList():from( qMime:hbUrlList() )
|
||||
qList := qMime:hbUrlList()
|
||||
FOR i := 0 TO qList:size() - 1
|
||||
qUrl := QUrl( qList:at( i ) )
|
||||
hb_fNameSplit( qUrl:toLocalFile(), @cPath, @cTable, @cExt )
|
||||
@@ -763,13 +759,13 @@ METHOD IdeBrowseManager:populateFieldData()
|
||||
LOCAL nRow, qItm
|
||||
|
||||
IF ( nRow := ::qStruct:q_tableFields:currentRow() ) >= 0
|
||||
qItm := QTableWidgetItem():from( ::qStruct:q_tableFields:item( nRow, 1 ) )
|
||||
qItm := ::qStruct:q_tableFields:item( nRow, 1 )
|
||||
::qStruct:q_editName:setText( qItm:text() )
|
||||
qItm := QTableWidgetItem():from( ::qStruct:q_tableFields:item( nRow, 2 ) )
|
||||
qItm := ::qStruct:q_tableFields:item( nRow, 2 )
|
||||
::qStruct:q_comboType:setCurrentIndex( ascan( {"Character", "Numeric", "Date", "Logical" }, qItm:text() ) - 1 )
|
||||
qItm := QTableWidgetItem():from( ::qStruct:q_tableFields:item( nRow, 3 ) )
|
||||
qItm := ::qStruct:q_tableFields:item( nRow, 3 )
|
||||
::qStruct:q_editSize:setText( qItm:text() )
|
||||
qItm := QTableWidgetItem():from( ::qStruct:q_tableFields:item( nRow, 4 ) )
|
||||
qItm := ::qStruct:q_tableFields:item( nRow, 4 )
|
||||
::qStruct:q_editDec:setText( qItm:text() )
|
||||
ENDIF
|
||||
|
||||
@@ -838,8 +834,8 @@ METHOD IdeBrowseManager:buildUiStruct()
|
||||
::qStruct:connect( QEvent_Close, {|| ::execEvent( "dbStruct_closeEvent" ) } )
|
||||
|
||||
oTbl := ::qStruct:q_tableFields
|
||||
QHeaderView():from( oTbl:verticalHeader() ):hide()
|
||||
QHeaderView():from( oTbl:horizontalHeader() ):stretchLastSection( .t. )
|
||||
oTbl:verticalHeader():hide()
|
||||
oTbl:horizontalHeader():stretchLastSection( .t. )
|
||||
oTbl:setAlternatingRowColors( .t. )
|
||||
oTbl:setColumnCount( len( hdr_ ) )
|
||||
oTbl:setShowGrid( .t. )
|
||||
@@ -1102,7 +1098,7 @@ METHOD IdeBrowseManager:updateIndexMenu( oBrw )
|
||||
|
||||
aIndex := ::oCurPanel:getIndexInfo( oBrw )
|
||||
FOR EACH cIndex IN aIndex
|
||||
qAct := QAction():from( ::qIndexMenu:addAction( cIndex ) )
|
||||
qAct := ::qIndexMenu:addAction( cIndex )
|
||||
qAct:connect( "triggered(bool)", hbide_getMenuBlock( ::oCurPanel, oBrw, cIndex ) )
|
||||
aadd( ::aIndexAct, qAct )
|
||||
NEXT
|
||||
@@ -1232,7 +1228,7 @@ METHOD IdeBrowsePanel:setViewStyle( nStyle )
|
||||
ENDIF
|
||||
|
||||
IF ::nViewStyle == HBPMDI_STYLE_MAXIMIZED
|
||||
qObj := QMdiSubWindow():from( ::activeSubWindow() )
|
||||
qObj := ::activeSubWindow()
|
||||
FOR EACH a_ IN ::aBrowsers
|
||||
a_[ 2 ]:setWindowState( Qt_WindowNoState )
|
||||
NEXT
|
||||
@@ -1250,7 +1246,7 @@ METHOD IdeBrowsePanel:setViewStyle( nStyle )
|
||||
::qWidget:tileSubWindows()
|
||||
EXIT
|
||||
CASE HBPMDI_STYLE_MAXIMIZED
|
||||
qObj := QMdiSubWindow():from( ::activeSubWindow() )
|
||||
qObj := ::activeSubWindow()
|
||||
FOR EACH a_ IN ::aBrowsers
|
||||
a_[ 2 ]:setWindowState( Qt_WindowMaximized )
|
||||
NEXT
|
||||
@@ -1276,7 +1272,7 @@ METHOD IdeBrowsePanel:tileVertically()
|
||||
LOCAL qObj, qVPort, nH, nT, nW, a_
|
||||
|
||||
qObj := ::activeSubWindow()
|
||||
qVPort := QWidget():from( ::viewport() )
|
||||
qVPort := ::viewport()
|
||||
nH := qVPort:height() / len( ::aBrowsers )
|
||||
nW := qVPort:width()
|
||||
nT := 0
|
||||
@@ -1293,7 +1289,7 @@ METHOD IdeBrowsePanel:tileHorizontally()
|
||||
LOCAL qObj, qVPort, nH, nT, nW, nL, a_
|
||||
|
||||
qObj := ::activeSubWindow()
|
||||
qVPort := QWidget():from( ::viewport() )
|
||||
qVPort := ::viewport()
|
||||
nH := qVPort:height()
|
||||
nW := qVPort:width() / len( ::aBrowsers )
|
||||
nT := 0
|
||||
@@ -1315,7 +1311,7 @@ METHOD IdeBrowsePanel:tilesZoom( nMode )
|
||||
nT := 0
|
||||
FOR EACH a_ IN ::aBrowsers
|
||||
qMdi := a_[ 2 ]
|
||||
qRect := QRect():from( qMdi:geometry() )
|
||||
qRect := qMdi:geometry()
|
||||
nH := qRect:height() + ( nMode * ( qRect:height() / 4 ) )
|
||||
qMdi:setGeometry( QRect( 0, nT, qRect:width(), nH ) )
|
||||
nT += nH
|
||||
@@ -1324,7 +1320,7 @@ METHOD IdeBrowsePanel:tilesZoom( nMode )
|
||||
nL := 0
|
||||
FOR EACH a_ IN ::aBrowsers
|
||||
qMdi := a_[ 2 ]
|
||||
qRect := QRect():from( qMdi:geometry() )
|
||||
qRect := qMdi:geometry()
|
||||
nW := qRect:width() + ( nMode * ( qRect:width() / 4 ) )
|
||||
qMdi:setGeometry( QRect( nL, 0, nW, qRect:height() ) )
|
||||
nL += nW
|
||||
@@ -1341,7 +1337,7 @@ METHOD IdeBrowsePanel:saveGeometry()
|
||||
LOCAL a_
|
||||
IF ::nViewStyle == HBPMDI_STYLE_ORGANIZED
|
||||
FOR EACH a_ IN ::aBrowsers
|
||||
a_[ SUB_GEOMETRY ] := QRect():from( a_[ SUB_WINDOW ]:geometry() )
|
||||
a_[ SUB_GEOMETRY ] := a_[ SUB_WINDOW ]:geometry()
|
||||
NEXT
|
||||
ENDIF
|
||||
RETURN Self
|
||||
@@ -1438,7 +1434,7 @@ METHOD IdeBrowsePanel:addBrowser( aInfo )
|
||||
IF empty( oBrw:oBrw )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
aadd( ::aBrowsers, { oBrw:nID, oBrw:qMdi, QRect():from( oBrw:qMdi:geometry() ), oBrw, NIL } )
|
||||
aadd( ::aBrowsers, { oBrw:nID, oBrw:qMdi, oBrw:qMdi:geometry(), oBrw, NIL } )
|
||||
::oManager:updateIndexMenu( oBrw )
|
||||
RETURN Self
|
||||
|
||||
|
||||
@@ -286,23 +286,17 @@ METHOD IdeDocks:buildDialog()
|
||||
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::buildMdiToolbar()
|
||||
//::qLayout:addWidget_1( ::qMdiToolbar:oWidget , 0, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::qMdiToolbar:oWidget , 0, 0, 1, 2 )
|
||||
::buildMdiToolbarLeft()
|
||||
//::qLayout:addWidget_1( ::qMdiToolbarL:oWidget , 1, 0, 1, 1 )
|
||||
::qLayout:addWidget( ::qMdiToolbarL:oWidget , 1, 0, 1, 1 )
|
||||
::buildStackedWidget()
|
||||
//::qLayout:addWidget_1( ::oStackedWidget:oWidget, 1, 1, 1, 1 )
|
||||
::qLayout:addWidget( ::oStackedWidget:oWidget, 1, 1, 1, 1 )
|
||||
::buildSearchReplaceWidget()
|
||||
//::qLayout:addWidget_1( ::oSearchReplace:oUI , 2, 0, 1, 2 )
|
||||
::qLayout:addWidget( ::oSearchReplace:oUI , 2, 0, 1, 2 )
|
||||
ELSE
|
||||
::buildStackedWidget()
|
||||
//::qLayout:addWidget_1( ::oStackedWidget:oWidget, 0, 0, 1, 1 )
|
||||
::qLayout:addWidget( ::oStackedWidget:oWidget, 0, 0, 1, 1 )
|
||||
::buildSearchReplaceWidget()
|
||||
//::qLayout:addWidget_1( ::oSearchReplace:oUI , 1, 0, 1, 1 )
|
||||
::qLayout:addWidget( ::oSearchReplace:oUI , 1, 0, 1, 1 )
|
||||
ENDIF
|
||||
|
||||
@@ -429,10 +423,10 @@ METHOD IdeDocks:buildSystemTray()
|
||||
::oSys:setIcon( hbide_image( "hbide" ) )
|
||||
::oSys:connect( "activated(QSystemTrayIcon::ActivationReason)", {|p| ::execEvent( "qSystemTrayIcon_activated", p ) } )
|
||||
|
||||
::oIde:oSysMenu := QMenu() // ::oDlg:oWidget )
|
||||
::qAct1 := QAction():from( ::oSysMenu:addAction( hbide_image( "fullscreen" ), "&Show" ) )
|
||||
::oIde:oSysMenu := QMenu()
|
||||
::qAct1 := ::oSysMenu:addAction( hbide_image( "fullscreen" ), "&Show" )
|
||||
::oSysMenu:addSeparator()
|
||||
::qAct2 := QAction():from( ::oSysMenu:addAction( hbide_image( "exit" ), "&Exit" ) )
|
||||
::qAct2 := ::oSysMenu:addAction( hbide_image( "exit" ), "&Exit" )
|
||||
|
||||
::qAct1:connect( "triggered(bool)", {|| ::execEvent( "qSystemTrayIcon_show" ) } )
|
||||
::qAct2:connect( "triggered(bool)", {|| ::execEvent( "qSystemTrayIcon_close" ) } )
|
||||
@@ -602,9 +596,9 @@ METHOD IdeDocks:execEvent( cEvent, p, p1 )
|
||||
|
||||
CASE "editWidget_dropEvent"
|
||||
qEvent := QDropEvent():from( p )
|
||||
qMime := QMimeData():from( qEvent:mimeData() )
|
||||
qMime := qEvent:mimeData()
|
||||
IF qMime:hasUrls()
|
||||
qList := QStringList():from( qMime:hbUrlList() )
|
||||
qList := qMime:hbUrlList()
|
||||
FOR i := 0 TO qList:size() - 1
|
||||
qUrl := QUrl( qList:at( i ) )
|
||||
IF hbide_isValidText( qUrl:toLocalFile() )
|
||||
@@ -622,9 +616,9 @@ HB_TRACE( HB_TR_DEBUG, "projectTree_dragEnterEvent" )
|
||||
CASE "projectTree_dropEvent"
|
||||
HB_TRACE( HB_TR_DEBUG, "projectTree_dropEvent" )
|
||||
qEvent := QDropEvent():from( p )
|
||||
qMime := QMimeData():from( qEvent:mimeData() )
|
||||
qMime := qEvent:mimeData()
|
||||
IF qMime:hasUrls()
|
||||
qList := QStringList():from( qMime:hbUrlList() )
|
||||
qList := qMime:hbUrlList()
|
||||
FOR i := 0 TO qList:size() - 1
|
||||
qUrl := QUrl( qList:at( i ) )
|
||||
IF hbide_sourceType( qUrl:toLocalFile() ) == ".hbp"
|
||||
@@ -723,7 +717,7 @@ METHOD IdeDocks:restState( nMode )
|
||||
|
||||
METHOD IdeDocks:stackMaximized()
|
||||
LOCAL qObj, qMdi
|
||||
qObj := QMdiSubWindow():from( ::oStackedWidget:activeSubWindow() )
|
||||
qObj := ::oStackedWidget:activeSubWindow()
|
||||
FOR EACH qMdi IN ::oIde:aMdies
|
||||
qMdi:setWindowState( Qt_WindowMaximized )
|
||||
NEXT
|
||||
@@ -742,7 +736,7 @@ METHOD IdeDocks:stackZoom( nMode )
|
||||
nT := 0
|
||||
FOR EACH qMdi IN ::oIde:aMdies
|
||||
IF ::aViewsInfo[ qMdi:__enumIndex(), 1 ] != "Stats"
|
||||
qRect := QRect():from( qMdi:geometry() )
|
||||
qRect := qMdi:geometry()
|
||||
nH := qRect:height() + ( nMode * ( qRect:height() / 4 ) )
|
||||
qMdi:setGeometry( QRect( 0, nT, qRect:width(), nH ) )
|
||||
nT += nH
|
||||
@@ -752,7 +746,7 @@ METHOD IdeDocks:stackZoom( nMode )
|
||||
nL := 0
|
||||
FOR EACH qMdi IN ::oIde:aMdies
|
||||
IF ::aViewsInfo[ qMdi:__enumIndex(), 1 ] != "Stats"
|
||||
qRect := QRect():from( qMdi:geometry() )
|
||||
qRect := qMdi:geometry()
|
||||
nW := qRect:width() + ( nMode * ( qRect:width() / 4 ) )
|
||||
qMdi:setGeometry( QRect( nL, 0, nW, qRect:height() ) )
|
||||
nL += nW
|
||||
@@ -770,8 +764,8 @@ METHOD IdeDocks:stackHorizontally()
|
||||
::restState( 0 )
|
||||
|
||||
qArea := ::oStackedWidget
|
||||
qObj := QMdiSubWindow():from( qArea:activeSubWindow() )
|
||||
qVPort := QWidget():from( qArea:viewport() )
|
||||
qObj := qArea:activeSubWindow()
|
||||
qVPort := qArea:viewport()
|
||||
nH := qVPort:height()
|
||||
nW := qVPort:width() / ( len( ::oIde:aMdies ) - 1 )
|
||||
nT := 0
|
||||
@@ -795,8 +789,8 @@ METHOD IdeDocks:stackVertically()
|
||||
::restState( 0 )
|
||||
|
||||
qArea := ::oStackedWidget
|
||||
qObj := QMdiSubWindow():from( qArea:activeSubWindow() )
|
||||
qVPort := QWidget():from( qArea:viewport() )
|
||||
qObj := qArea:activeSubWindow()
|
||||
qVPort := qArea:viewport()
|
||||
nH := qVPort:height() / ( len( ::oIde:aMdies ) - 1 )
|
||||
nW := qVPort:width()
|
||||
nT := 0
|
||||
@@ -830,7 +824,7 @@ METHOD IdeDocks:savePanelsGeometry()
|
||||
LOCAL a_, n
|
||||
FOR EACH a_ IN ::aViewsInfo
|
||||
IF ( n := ascan( ::oIde:aMdies, {|o| o:objectName() == a_[ 1 ] } ) ) > 0
|
||||
a_[ 2 ] := QRect():from( ::oIde:aMdies[ n ]:geometry() )
|
||||
a_[ 2 ] := ::oIde:aMdies[ n ]:geometry()
|
||||
ENDIF
|
||||
NEXT
|
||||
RETURN Self
|
||||
@@ -1346,7 +1340,7 @@ METHOD IdeDocks:buildToolBarPanels()
|
||||
IF empty( a_ )
|
||||
::qTBarDocks:addSeparator()
|
||||
ELSE
|
||||
qAct := QAction():from( a_[ 1 ]:oWidget:toggleViewAction() )
|
||||
qAct := a_[ 1 ]:oWidget:toggleViewAction()
|
||||
qAct:setIcon( hbide_image( a_[ 2 ] ) )
|
||||
::qTBarDocks:addAction( qAct )
|
||||
aadd( ::aBtnDocks, qAct )
|
||||
@@ -1616,12 +1610,12 @@ METHOD IdeDocks:outputDoubleClicked( lSelected )
|
||||
LOCAL cSource, nLine
|
||||
|
||||
IF lSelected
|
||||
qCursor := QTextCursor():configure( ::oOutputResult:oWidget:textCursor() )
|
||||
cText := QTextBlock():configure( qCursor:block() ):text()
|
||||
qCursor := ::oOutputResult:oWidget:textCursor()
|
||||
cText := qCursor:block():text()
|
||||
|
||||
IF hbide_parseFNfromStatusMsg( cText, @cSource, @nLine, .T. )
|
||||
IF ::oSM:editSource( cSource, 0, 0, 0, NIL, NIL, .f., .t. )
|
||||
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
|
||||
qCursor := ::oIde:qCurEdit:textCursor()
|
||||
nLine := iif( nLine < 1, 0, nLine - 1 )
|
||||
|
||||
qCursor:setPosition( 0 )
|
||||
|
||||
@@ -652,7 +652,7 @@ METHOD IdeDocWriter:saveInFunction()
|
||||
MsgBox( "Source is modified, anyway proceeding.", "Documentation Save Alert" )
|
||||
ENDIF
|
||||
|
||||
qCursor := QTextCursor():from( oEdit:qEdit:textCursor() )
|
||||
qCursor := oEdit:qEdit:textCursor()
|
||||
qCursor:beginEditBlock()
|
||||
|
||||
::removeDocHelp( nCurLine, oEdit )
|
||||
|
||||
@@ -205,7 +205,7 @@ CLASS IdeEdit INHERIT IdeObject
|
||||
|
||||
METHOD setLineNumbersBkColor( nR, nG, nB )
|
||||
METHOD setCurrentLineColor( nR, nG, nB )
|
||||
METHOD getCursor() INLINE QTextCursor():from( ::qEdit:textCursor() )
|
||||
METHOD getCursor() INLINE ::qEdit:textCursor()
|
||||
METHOD find( cText, nPosFrom )
|
||||
METHOD refresh()
|
||||
METHOD isModified() INLINE ::oEditor:qDocument:isModified()
|
||||
@@ -280,7 +280,6 @@ METHOD IdeEdit:create( oIde, oEditor, nMode )
|
||||
::qEdit:setLineWrapMode( QTextEdit_NoWrap )
|
||||
::qEdit:ensureCursorVisible()
|
||||
::qEdit:setContextMenuPolicy( Qt_CustomContextMenu )
|
||||
// ::qEdit:installEventFilter( ::pEvents )
|
||||
::qEdit:setTabChangesFocus( .f. )
|
||||
|
||||
::setFont()
|
||||
@@ -429,83 +428,84 @@ METHOD IdeEdit:connectEditSignals( oEdit )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 )
|
||||
LOCAL pAct, qAct, n, qEdit, oo, qCursor, cProto, nRows, nCols, cAct
|
||||
LOCAL qAct, n, qEdit, oo, qCursor, cProto, nRows, nCols, cAct
|
||||
|
||||
HB_SYMBOL_UNUSED( p1 )
|
||||
|
||||
qEdit := oEdit:qEdit
|
||||
qCursor := QTextCursor():configure( qEdit:textCursor() )
|
||||
qCursor := qEdit:textCursor()
|
||||
oEdit:nCurLineNo := qCursor:blockNumber()
|
||||
|
||||
SWITCH nMode
|
||||
|
||||
CASE customContextMenuRequested
|
||||
QAction():from( ::oEM:aActions[ 17, 2 ] ):setEnabled( !empty( qCursor:selectedText() ) )
|
||||
//::oEM:aActions[ 17, 2 ]:setEnabled( !empty( qCursor:selectedText() ) )
|
||||
::oEM:aActions[ 17, 2 ]:setEnabled( !empty( qCursor:selectedText() ) )
|
||||
|
||||
n := ascan( ::oEditor:aEdits, {|o| o == oEdit } )
|
||||
|
||||
QAction():from( ::oEM:aActions[ 18, 2 ] ):setEnabled( len( ::oEditor:aEdits ) == 0 .OR. ::oEditor:nSplOrient == -1 .OR. ::oEditor:nSplOrient == 1 )
|
||||
QAction():from( ::oEM:aActions[ 19, 2 ] ):setEnabled( len( ::oEditor:aEdits ) == 0 .OR. ::oEditor:nSplOrient == -1 .OR. ::oEditor:nSplOrient == 2 )
|
||||
QAction():from( ::oEM:aActions[ 21, 2 ] ):setEnabled( n > 0 )
|
||||
::oEM:aActions[ 18, 2 ]:setEnabled( len( ::oEditor:aEdits ) == 0 .OR. ::oEditor:nSplOrient == -1 .OR. ::oEditor:nSplOrient == 1 )
|
||||
::oEM:aActions[ 19, 2 ]:setEnabled( len( ::oEditor:aEdits ) == 0 .OR. ::oEditor:nSplOrient == -1 .OR. ::oEditor:nSplOrient == 2 )
|
||||
::oEM:aActions[ 21, 2 ]:setEnabled( n > 0 )
|
||||
|
||||
pAct := ::oEM:qContextMenu:exec( qEdit:mapToGlobal( p ) )
|
||||
IF !hbqt_isEmptyQtPointer( pAct )
|
||||
qAct := QAction():configure( pAct )
|
||||
cAct := strtran( qAct:text(), "&", "" )
|
||||
SWITCH cAct
|
||||
CASE "Split Horizontally"
|
||||
::oEditor:split( 1, oEdit )
|
||||
EXIT
|
||||
CASE "Split Vertically"
|
||||
::oEditor:split( 2, oEdit )
|
||||
EXIT
|
||||
CASE "Close Split Window"
|
||||
IF n > 0 /* 1 == Main Edit */
|
||||
::oUpDn:oUI:setParent( ::oEditor:oEdit:qEdit )
|
||||
oo := ::oEditor:aEdits[ n ]
|
||||
hb_adel( ::oEditor:aEdits, n, .t. )
|
||||
oo:destroy( .f. )
|
||||
::oEditor:qCqEdit := ::oEditor:qEdit
|
||||
::oEditor:qCoEdit := ::oEditor:oEdit
|
||||
::oIde:manageFocusInEditor()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Save as Skeleton..."
|
||||
::oSK:saveAs( ::getSelectedText() )
|
||||
EXIT
|
||||
CASE "Apply Theme"
|
||||
::oEditor:applyTheme()
|
||||
EXIT
|
||||
CASE "Goto Function"
|
||||
::gotoFunction()
|
||||
EXIT
|
||||
CASE "Cut"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::cut()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Copy"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::copy()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Paste"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::paste()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Undo"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::undo()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Redo"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::redo()
|
||||
ENDIF
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
IF ! ( qAct := ::oEM:qContextMenu:exec( qEdit:mapToGlobal( p ) ) ):isValidObject()
|
||||
RETURN Self
|
||||
ENDIF
|
||||
|
||||
cAct := strtran( qAct:text(), "&", "" )
|
||||
SWITCH cAct
|
||||
CASE "Split Horizontally"
|
||||
::oEditor:split( 1, oEdit )
|
||||
EXIT
|
||||
CASE "Split Vertically"
|
||||
::oEditor:split( 2, oEdit )
|
||||
EXIT
|
||||
CASE "Close Split Window"
|
||||
IF n > 0 /* 1 == Main Edit */
|
||||
::oUpDn:oUI:setParent( ::oEditor:oEdit:qEdit )
|
||||
oo := ::oEditor:aEdits[ n ]
|
||||
hb_adel( ::oEditor:aEdits, n, .t. )
|
||||
oo:destroy( .f. )
|
||||
::oEditor:qCqEdit := ::oEditor:qEdit
|
||||
::oEditor:qCoEdit := ::oEditor:oEdit
|
||||
::oIde:manageFocusInEditor()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Save as Skeleton..."
|
||||
::oSK:saveAs( ::getSelectedText() )
|
||||
EXIT
|
||||
CASE "Apply Theme"
|
||||
::oEditor:applyTheme()
|
||||
EXIT
|
||||
CASE "Goto Function"
|
||||
::gotoFunction()
|
||||
EXIT
|
||||
CASE "Cut"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::cut()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Copy"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::copy()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Paste"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::paste()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Undo"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::undo()
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE "Redo"
|
||||
IF ::oIde:lCurEditsMdi
|
||||
::redo()
|
||||
ENDIF
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
EXIT
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 )
|
||||
SWITCH nEvent
|
||||
CASE QEvent_KeyPress
|
||||
|
||||
qEvent := QKeyEvent():configure( p )
|
||||
qEvent := QKeyEvent():from( p )
|
||||
|
||||
key := qEvent:key()
|
||||
kbm := qEvent:modifiers()
|
||||
@@ -768,7 +768,7 @@ STATIC FUNCTION hbide_setQCursor( qEdit, q_ )
|
||||
qEdit:setTextCursor( qCursor )
|
||||
qCursor:endEditBlock()
|
||||
ELSE
|
||||
qCursor := QTextCursor():from( qEdit:textCursor() )
|
||||
qCursor := qEdit:textCursor()
|
||||
qCursor:beginEditBlock()
|
||||
RETURN { qCursor, qCursor:blockNumber(), qCursor:columnNumber() }
|
||||
ENDIF
|
||||
@@ -941,7 +941,7 @@ METHOD IdeEdit:pasteBlockContents( nMode )
|
||||
ENDIF
|
||||
|
||||
nPasteMode := iif( empty( nPasteMode ), selectionMode_stream, nPasteMode )
|
||||
qCursor := QTextCursor():from( ::qEdit:textCursor() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
nCol := qCursor:columnNumber()
|
||||
|
||||
qCursor:beginEditBlock()
|
||||
@@ -1000,7 +1000,7 @@ METHOD IdeEdit:insertBlockContents( aCord )
|
||||
|
||||
cKey := chr( XbpQKeyEventToAppEvent( aCord[ 7 ] ) )
|
||||
|
||||
qCursor := QTextCursor():from( ::qEdit:textCursor() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
qCursor:beginEditBlock()
|
||||
|
||||
IF nW == 0
|
||||
@@ -1046,7 +1046,7 @@ METHOD IdeEdit:deleteBlockContents( aCord )
|
||||
|
||||
nSelMode := aCord[ 5 ]
|
||||
|
||||
qCursor := QTextCursor():from( ::qEdit:textCursor() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
qCursor:beginEditBlock()
|
||||
|
||||
nW := nR - nL
|
||||
@@ -1586,7 +1586,7 @@ METHOD IdeEdit:relayMarkButtons()
|
||||
METHOD IdeEdit:setNewMark()
|
||||
LOCAL qCursor, nBlock, n
|
||||
|
||||
IF !( qCursor := QTextCursor():configure( ::qEdit:textCursor() ) ):isNull()
|
||||
IF !( qCursor := ::qEdit:textCursor() ):isNull()
|
||||
nBlock := qCursor:blockNumber() + 1
|
||||
|
||||
IF ( n := ascan( ::aBookMarks, nBlock ) ) > 0
|
||||
@@ -1664,7 +1664,7 @@ METHOD IdeEdit:findEx( cText, nFlags, nStart )
|
||||
|
||||
IF ( lFound := ::qEdit:find( cText, nFlags ) )
|
||||
::qEdit:centerCursor()
|
||||
qCursor := QTextCursor():from( ::qEdit:textCursor() ) //::getCursor()
|
||||
qCursor := ::qEdit:textCursor()
|
||||
|
||||
::qEdit:hbSetSelectionInfo( { qCursor:blockNumber(), qCursor:columnNumber() - len( cText ), ;
|
||||
qCursor:blockNumber(), qCursor:columnNumber(), 1, .t., .f. } )
|
||||
@@ -1685,10 +1685,10 @@ METHOD IdeEdit:unHighlight()
|
||||
::isHighLighted := .f.
|
||||
qCursor := ::getCursor()
|
||||
nPos := qCursor:position()
|
||||
lModified := QTextDocument():configure( ::qEdit:document() ):isModified()
|
||||
lModified := ::qEdit:document():isModified()
|
||||
::qEdit:undo()
|
||||
IF ! lModified
|
||||
QTextDocument():configure( ::qEdit:document() ):setModified( .f. )
|
||||
::qEdit:document():setModified( .f. )
|
||||
::oEditor:setTabImage( ::qEdit )
|
||||
ENDIF
|
||||
qCursor:setPosition( nPos )
|
||||
@@ -1710,18 +1710,18 @@ METHOD IdeEdit:highlightAll( cText )
|
||||
::isHighLighted := .t.
|
||||
|
||||
qDoc := ::oEditor:qDocument
|
||||
lModified := QTextDocument():configure( ::qEdit:document() ):isModified()
|
||||
lModified := ::qEdit:document():isModified()
|
||||
|
||||
qCur := ::getCursor()
|
||||
qCur:beginEditBlock()
|
||||
|
||||
qCursor := QTextCursor( "QTextDocument", qDoc )
|
||||
qFormat := QTextCharFormat():from( qCursor:charFormat() )
|
||||
qFormat := qCursor:charFormat()
|
||||
qFormatHL := qFormat
|
||||
qFormatHL:setBackground( QBrush( "QColor", QColor( Qt_yellow ) ) )
|
||||
|
||||
DO WHILE .t.
|
||||
qCursor := QTextCursor():from( qDoc:find( cText, qCursor, 0 ) )
|
||||
qCursor := qDoc:find( cText, qCursor, 0 )
|
||||
IF qCursor:isNull()
|
||||
EXIT
|
||||
ENDIF
|
||||
@@ -1730,7 +1730,7 @@ METHOD IdeEdit:highlightAll( cText )
|
||||
qCur:endEditBlock()
|
||||
|
||||
IF ! lModified
|
||||
QTextDocument():configure( ::qEdit:document() ):setModified( .f. )
|
||||
::qEdit:document():setModified( .f. )
|
||||
::oEditor:setTabImage( ::qEdit )
|
||||
ENDIF
|
||||
|
||||
@@ -1849,7 +1849,7 @@ METHOD IdeEdit:printPreview()
|
||||
|
||||
METHOD IdeEdit:paintRequested( pPrinter )
|
||||
LOCAL qPrinter
|
||||
qPrinter := QPrinter():configure( pPrinter )
|
||||
qPrinter := QPrinter():from( pPrinter )
|
||||
::qEdit:print( qPrinter )
|
||||
RETURN Self
|
||||
|
||||
@@ -1858,7 +1858,7 @@ METHOD IdeEdit:paintRequested( pPrinter )
|
||||
METHOD IdeEdit:formatBraces()
|
||||
LOCAL qDoc, cText
|
||||
|
||||
qDoc := QTextDocument():configure( ::qEdit:document() )
|
||||
qDoc := ::qEdit:document()
|
||||
|
||||
IF !( qDoc:isEmpty() )
|
||||
qDoc:setUndoRedoEnabled( .f. )
|
||||
@@ -1905,7 +1905,7 @@ METHOD IdeEdit:formatBraces()
|
||||
METHOD IdeEdit:removeTrailingSpaces()
|
||||
LOCAL qDoc, cText, a_, s
|
||||
|
||||
qDoc := QTextDocument():from( ::qEdit:document() )
|
||||
qDoc := ::qEdit:document()
|
||||
IF !( qDoc:isEmpty() )
|
||||
qDoc:setUndoRedoEnabled( .f. )
|
||||
cText := qDoc:toPlainText()
|
||||
@@ -1925,7 +1925,7 @@ METHOD IdeEdit:removeTrailingSpaces()
|
||||
METHOD IdeEdit:tabs2spaces()
|
||||
LOCAL qDoc, cText, cSpaces
|
||||
|
||||
qDoc := QTextDocument():configure( ::qEdit:document() )
|
||||
qDoc := ::qEdit:document()
|
||||
IF !( qDoc:isEmpty() )
|
||||
cSpaces := space( ::nTabSpaces )
|
||||
|
||||
@@ -1944,7 +1944,7 @@ METHOD IdeEdit:tabs2spaces()
|
||||
METHOD IdeEdit:spaces2tabs()
|
||||
LOCAL qDoc, cText, cSpaces
|
||||
|
||||
qDoc := QTextDocument():configure( ::qEdit:document() )
|
||||
qDoc := ::qEdit:document()
|
||||
IF !( qDoc:isEmpty() )
|
||||
cSpaces := space( ::nTabSpaces )
|
||||
|
||||
@@ -1979,12 +1979,12 @@ METHOD IdeEdit:moveLine( nDirection )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:getText()
|
||||
RETURN QTextCursor():from( ::qEdit:textCursor() ):selectedText()
|
||||
RETURN ::qEdit:textCursor():selectedText()
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:getWord( lSelect )
|
||||
LOCAL cText, qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
LOCAL cText, qCursor := ::qEdit:textCursor()
|
||||
|
||||
DEFAULT lSelect TO .F.
|
||||
|
||||
@@ -2000,7 +2000,7 @@ METHOD IdeEdit:getWord( lSelect )
|
||||
|
||||
METHOD IdeEdit:goto( nLine )
|
||||
LOCAL nRows, qGo
|
||||
LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
LOCAL qCursor := ::qEdit:textCursor()
|
||||
|
||||
IF empty( nLine )
|
||||
nRows := ::qEdit:blockCount()
|
||||
@@ -2030,7 +2030,7 @@ METHOD IdeEdit:goto( nLine )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:getLine( nLine, lSelect )
|
||||
LOCAL cText, qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
LOCAL cText, qCursor := ::qEdit:textCursor()
|
||||
|
||||
DEFAULT nLine TO qCursor:blockNumber() + 1
|
||||
DEFAULT lSelect TO .F.
|
||||
@@ -2051,17 +2051,17 @@ METHOD IdeEdit:getLine( nLine, lSelect )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:getColumnNo()
|
||||
RETURN QTextCursor():from( ::qEdit:textCursor() ):columnNumber() + 1
|
||||
RETURN ::qEdit:textCursor():columnNumber() + 1
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:getLineNo()
|
||||
RETURN QTextCursor():from( ::qEdit:textCursor() ):blockNumber() + 1
|
||||
RETURN ::qEdit:textCursor():blockNumber() + 1
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:insertSeparator( cSep )
|
||||
LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
LOCAL qCursor := ::qEdit:textCursor()
|
||||
|
||||
IF empty( cSep )
|
||||
cSep := ::cSeparator
|
||||
@@ -2083,7 +2083,7 @@ METHOD IdeEdit:insertText( cText )
|
||||
LOCAL qCursor, nL, nB
|
||||
|
||||
IF hb_isChar( cText ) .AND. !Empty( cText )
|
||||
qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
|
||||
nL := len( cText )
|
||||
nB := qCursor:position() + nL
|
||||
@@ -2108,8 +2108,8 @@ METHOD IdeEdit:handlePreviousWord( lUpdatePrevWord )
|
||||
|
||||
qEdit := ::qEdit
|
||||
|
||||
qCursor := QTextCursor():configure( qEdit:textCursor() )
|
||||
qTextBlock := QTextBlock():configure( qCursor:block() )
|
||||
qCursor := qEdit:textCursor()
|
||||
qTextBlock := qCursor:block()
|
||||
cText := qTextBlock:text()
|
||||
nCol := qCursor:columnNumber()
|
||||
IF ( substr( cText, nCol - 1, 1 ) == " " )
|
||||
@@ -2187,10 +2187,10 @@ METHOD IdeEdit:findLastIndent()
|
||||
LOCAL qCursor, qTextBlock, cText, cWord
|
||||
LOCAL nSpaces := 0
|
||||
|
||||
qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
qTextBlock := QTextBlock():configure( qCursor:block() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
qTextBlock := qCursor:block()
|
||||
|
||||
qTextBlock := QTextBlock():configure( qTextBlock:previous() )
|
||||
qTextBlock := qTextBlock:previous()
|
||||
DO WHILE .t.
|
||||
IF !( qTextBlock:isValid() )
|
||||
EXIT
|
||||
@@ -2204,7 +2204,7 @@ METHOD IdeEdit:findLastIndent()
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
qTextBlock := QTextBlock():configure( qTextBlock:previous() )
|
||||
qTextBlock := qTextBlock:previous()
|
||||
ENDDO
|
||||
|
||||
RETURN nSpaces
|
||||
@@ -2217,7 +2217,7 @@ METHOD IdeEdit:handleCurrentIndent()
|
||||
IF ::lIndentIt
|
||||
::lIndentIt := .f.
|
||||
IF ( nSpaces := ::findLastIndent() ) > 0
|
||||
qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
qCursor:insertText( space( nSpaces ) )
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -2258,8 +2258,8 @@ METHOD IdeEdit:loadFuncHelp()
|
||||
LOCAL qEdit, qCursor, qTextBlock, cText, cWord, nCol, cPro
|
||||
|
||||
qEdit := ::qEdit
|
||||
qCursor := QTextCursor():configure( qEdit:textCursor() )
|
||||
qTextBlock := QTextBlock():configure( qCursor:block() )
|
||||
qCursor := qEdit:textCursor()
|
||||
qTextBlock := qCursor:block()
|
||||
cText := qTextBlock:text()
|
||||
nCol := qCursor:columnNumber()
|
||||
cWord := hbide_getPreviousWord( cText, nCol )
|
||||
@@ -2369,7 +2369,7 @@ METHOD IdeEdit:parseCodeCompletion( cSyntax )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:completeCode( p )
|
||||
LOCAL qCursor := QTextCursor():from( ::qEdit:textCursor() )
|
||||
LOCAL qCursor := ::qEdit:textCursor()
|
||||
LOCAL cWord
|
||||
|
||||
qCursor:movePosition( QTextCursor_Left )
|
||||
|
||||
@@ -225,7 +225,7 @@ METHOD IdeEditsManager:create( oIde )
|
||||
aadd( ::aActions, { "Apply Theme" , ::qContextMenu:addAction( "Apply Theme" ) } )
|
||||
aadd( ::aActions, { "Save as Skltn", ::qContextMenu:addAction( "Save as Skeleton..." ) } )
|
||||
|
||||
::qContextSub := QMenu():configure( ::qContextMenu:addMenu( "Split" ) )
|
||||
::qContextSub := ::qContextMenu:addMenu( "Split" )
|
||||
//
|
||||
aadd( ::aActions, { "Split H" , ::qContextSub:addAction( "Split Horizontally" ) } )
|
||||
aadd( ::aActions, { "Split V" , ::qContextSub:addAction( "Split Vertically" ) } )
|
||||
@@ -316,8 +316,8 @@ METHOD IdeEditsManager:updateCompleter()
|
||||
::qCompModel:setStringList( ::qProtoList )
|
||||
::qCompleter:setModel( ::qCompModel )
|
||||
::qCompleter:setCompletionMode( QCompleter_PopupCompletion )
|
||||
( QListView():from( ::qCompleter:popup() ) ):setAlternatingRowColors( .t. )
|
||||
( QListView():from( ::qCompleter:popup() ) ):setFont( QFont( "Courier New", 8 ) )
|
||||
::qCompleter:popup():setAlternatingRowColors( .t. )
|
||||
::qCompleter:popup():setFont( QFont( "Courier New", 8 ) )
|
||||
|
||||
::qCompleter:connect( "activated(QString)", {|p| ::execEvent( "qcompleter_activated", p ) } )
|
||||
|
||||
@@ -374,7 +374,6 @@ METHOD IdeEditsManager:removeSourceInTree( cSourceFile )
|
||||
|
||||
METHOD IdeEditsManager:addSourceInTree( cSourceFile, cView )
|
||||
LOCAL cPath, cFile, cExt, oItem
|
||||
//LOCAL oGrand := ::oOpenedSources
|
||||
LOCAL oParent := ::oOpenedSources
|
||||
|
||||
IF Empty( cSourceFile )
|
||||
@@ -382,21 +381,6 @@ METHOD IdeEditsManager:addSourceInTree( cSourceFile, cView )
|
||||
ENDIF
|
||||
|
||||
hb_fNameSplit( cSourceFile, @cPath, @cFile, @cExt )
|
||||
#if 0
|
||||
cPathA := hbide_pathNormalized( cPath )
|
||||
|
||||
array2table(
|
||||
IF ( n := ascan( ::aEditorPath, {|e_| e_[ 2 ] == cPathA } ) ) == 0
|
||||
oParent := oGrand:addItem( cPath )
|
||||
aadd( ::aProjData, { oParent, "Editor Path", oGrand, cPathA, cSourceFile } )
|
||||
aadd( ::aEditorPath, { oParent, cPathA } )
|
||||
ELSE
|
||||
oParent := ::aEditorPath[ n,1 ]
|
||||
ENDIF
|
||||
|
||||
aadd( ::aProjData, { oParent:addItem( cFile + cExt ), "Opened Source", oParent, ;
|
||||
cSourceFile, hbide_pathNormalized( cSourceFile ) } )
|
||||
#endif
|
||||
|
||||
oItem := oParent:addItem( cFile + cExt )
|
||||
oItem:tooltipText := cSourceFile
|
||||
@@ -451,7 +435,7 @@ METHOD IdeEditsManager:getTabCurrent()
|
||||
|
||||
IF !empty( ::qTabWidget )
|
||||
qTab := ::qTabWidget:currentWidget()
|
||||
nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab ) } )
|
||||
nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab:pPtr ) } )
|
||||
ENDIF
|
||||
RETURN nTab
|
||||
|
||||
@@ -462,8 +446,8 @@ METHOD IdeEditsManager:getDocumentCurrent()
|
||||
|
||||
IF !empty( ::qTabWidget ) .AND. ::qTabWidget:count() > 0
|
||||
qTab := ::qTabWidget:currentWidget()
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab ) } ) ) > 0
|
||||
RETURN QTextDocument():configure( ::aTabs[ nTab, TAB_OEDITOR ]:document() )
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab:pPtr ) } ) ) > 0
|
||||
RETURN ::aTabs[ nTab, TAB_OEDITOR ]:document()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -476,7 +460,7 @@ METHOD IdeEditsManager:getEditObjectCurrent()
|
||||
|
||||
IF !empty( ::qTabWidget ) .AND. ::qTabWidget:count() > 0
|
||||
qTab := ::qTabWidget:currentWidget()
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab ) } ) ) > 0
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab:pPtr ) } ) ) > 0
|
||||
RETURN ::aTabs[ nTab, TAB_OEDITOR ]:qCoEdit
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -490,7 +474,7 @@ METHOD IdeEditsManager:getEditCurrent()
|
||||
|
||||
IF !empty( ::qTabWidget ) .AND. ::qTabWidget:count() > 0
|
||||
qTab := ::qTabWidget:currentWidget()
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab ) } ) ) > 0
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab:pPtr ) } ) ) > 0
|
||||
RETURN ::aTabs[ nTab, TAB_OEDITOR ]:qCqEdit
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -504,7 +488,7 @@ METHOD IdeEditsManager:getEditorCurrent()
|
||||
|
||||
IF !empty( ::qTabWidget ) .AND. ::qTabWidget:count() > 0
|
||||
qTab := ::qTabWidget:currentWidget()
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab ) } ) ) > 0
|
||||
IF ( nTab := ascan( ::aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ TAB_OTAB ]:oWidget:pPtr, qTab:pPtr ) } ) ) > 0
|
||||
RETURN ::aTabs[ nTab, TAB_OEDITOR ]
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -514,12 +498,12 @@ METHOD IdeEditsManager:getEditorCurrent()
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEditsManager:getEditorByIndex( nIndex ) /* Index is 0 based */
|
||||
LOCAL pTab, a_
|
||||
LOCAL qTab, a_
|
||||
|
||||
IF hb_isNumeric( nIndex ) .AND. nIndex >= 0 .AND. nIndex < ::qTabWidget:count()
|
||||
pTab := ::qTabWidget:widget( nIndex )
|
||||
qTab := ::qTabWidget:widget( nIndex )
|
||||
FOR EACH a_ IN ::aTabs
|
||||
IF !empty( a_[ TAB_OTAB ] ) .AND. hbqt_IsEqualGcQtPointer( a_[ TAB_OTAB ]:oWidget:pPtr, pTab )
|
||||
IF !empty( a_[ TAB_OTAB ] ) .AND. hbqt_IsEqualGcQtPointer( a_[ TAB_OTAB ]:oWidget:pPtr, qTab:pPtr )
|
||||
RETURN ::aTabs[ a_:__enumIndex(), TAB_OEDITOR ]
|
||||
ENDIF
|
||||
NEXT
|
||||
@@ -1028,7 +1012,7 @@ METHOD IdeEditsManager:printPreview()
|
||||
|
||||
METHOD IdeEditsManager:paintRequested( pPrinter )
|
||||
LOCAL qPrinter
|
||||
qPrinter := QPrinter():configure( pPrinter )
|
||||
qPrinter := QPrinter():from( pPrinter )
|
||||
::qCurEdit:print( qPrinter )
|
||||
RETURN Self
|
||||
|
||||
@@ -1357,12 +1341,12 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme, cView, a
|
||||
|
||||
::oEdit:qEdit:connect( "updateRequest(QRect,int)", {|| ::scrollThumbnail() } )
|
||||
|
||||
::qDocument := QTextDocument():configure( ::qEdit:document() )
|
||||
::qDocument := ::qEdit:document()
|
||||
|
||||
IF ::cType != "U"
|
||||
::qHiliter := ::oTH:SetSyntaxHilighting( ::oEdit:qEdit, @::cTheme )
|
||||
ENDIF
|
||||
::qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
::qCursor := ::qEdit:textCursor()
|
||||
|
||||
/* Populate Tabs Array */
|
||||
aadd( ::aTabs, { ::oTab, Self } )
|
||||
@@ -1549,17 +1533,17 @@ METHOD IdeEditor:reload()
|
||||
METHOD IdeEditor:setDocumentProperties()
|
||||
LOCAL qCursor
|
||||
|
||||
qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
qCursor := ::qEdit:textCursor()
|
||||
|
||||
IF !( ::lLoaded ) /* First Time */
|
||||
::qEdit:setPlainText( ::prepareBufferToLoad( hb_memoread( ::sourceFile ) ) )
|
||||
qCursor:setPosition( ::nPos )
|
||||
::qEdit:setTextCursor( qCursor )
|
||||
|
||||
QScrollBar():configure( ::qEdit:horizontalScrollBar() ):setValue( ::nHPos )
|
||||
QScrollBar():configure( ::qEdit:verticalScrollBar() ):setValue( ::nVPos )
|
||||
::qEdit:horizontalScrollBar():setValue( ::nHPos )
|
||||
::qEdit:verticalScrollBar():setValue( ::nVPos )
|
||||
|
||||
QTextDocument():configure( ::qEdit:document() ):setModified( .f. )
|
||||
::qEdit:document():setModified( .f. )
|
||||
|
||||
::qTabWidget:setTabIcon( ::qTabWidget:indexOf( ::oTab:oWidget ), ;
|
||||
hbide_image( iif( ::lReadOnly, "tabreadonly", "tabunmodified" ) ) )
|
||||
@@ -1662,8 +1646,8 @@ METHOD IdeEditor:dispEditInfo( qEdit )
|
||||
|
||||
DEFAULT qEdit TO ::qEdit
|
||||
|
||||
qDocument := QTextDocument():configure( qEdit:document() )
|
||||
qCursor := QTextCursor():configure( qEdit:textCursor() )
|
||||
qDocument := qEdit:document()
|
||||
qCursor := qEdit:textCursor()
|
||||
|
||||
s := "<b>Line "+ hb_ntos( qCursor:blockNumber() + 1 ) + " of " + ;
|
||||
hb_ntos( qDocument:blockCount() ) + "</b>"
|
||||
@@ -1758,8 +1742,8 @@ METHOD IdeEditor:scrollThumbnail()
|
||||
LOCAL qScroll
|
||||
|
||||
IF ::lLoaded .AND. ::oSourceThumbnailDock:oWidget:isVisible() .AND. !empty( ::qThumbnail )
|
||||
qScroll := QScrollBar():configure( ::oEdit:qEdit:verticalScrollBar() )
|
||||
QScrollBar():configure( ::qThumbnail:qEdit:verticalScrollBar() ):setValue( qScroll:value() )
|
||||
qScroll := ::oEdit:qEdit:verticalScrollBar()
|
||||
::qThumbnail:qEdit:verticalScrollBar():setValue( qScroll:value() )
|
||||
|
||||
::oEdit:qEdit:hbGetViewportInfo()
|
||||
|
||||
@@ -1908,7 +1892,7 @@ STATIC FUNCTION hbide_qtDesigner()
|
||||
|
||||
oEdt := QDesignerFormEditorInterface( ::oDlg:oWidget )
|
||||
HB_TRACE( HB_TR_DEBUG, 1 )
|
||||
oWM := QDesignerFormWindowManagerInterface():from( oEdt:formWindowManager() )
|
||||
oWM := oEdt:formWindowManager()
|
||||
HB_TRACE( HB_TR_DEBUG, 2 )
|
||||
oWM:createFormWindow( ::oQScintillaDock:oWidget )
|
||||
HB_TRACE( HB_TR_DEBUG, 3 )
|
||||
|
||||
@@ -98,10 +98,10 @@ METHOD IdeUpDown:position()
|
||||
IF !empty( qEdit := ::oEM:getEditCurrent() )
|
||||
::oUI:setParent( qEdit )
|
||||
|
||||
qHSBar := QScrollBar():from( qEdit:horizontalScrollBar() )
|
||||
qVSBar := QScrollBar():from( qEdit:verticalScrollBar() )
|
||||
qHSBar := qEdit:horizontalScrollBar()
|
||||
qVSBar := qEdit:verticalScrollBar()
|
||||
|
||||
qRect := QRect():from( qEdit:geometry() )
|
||||
qRect := qEdit:geometry()
|
||||
|
||||
::oUI:move( qRect:width() - ::oUI:width() - iif( qVSBar:isVisible(), qVSBar:width() , 0 ), ;
|
||||
qRect:height() - ::oUI:height() - iif( qHSBar:isVisible(), qHSBar:height(), 0 ) )
|
||||
@@ -279,13 +279,13 @@ METHOD IdeSearchReplace:create( oIde )
|
||||
::oUI:q_buttonReplace:setEnabled( i == 2 ), ;
|
||||
iif( i == 2, ::oUI:q_frameReplace:show(), ::oUI:q_frameReplace:hide() ) } )
|
||||
|
||||
::qFindLineEdit := QLineEdit():from( ::oUI:q_comboFind:lineEdit() )
|
||||
::qFindLineEdit := ::oUI:q_comboFind:lineEdit()
|
||||
::qFindLineEdit:setFocusPolicy( Qt_StrongFocus )
|
||||
::qFindLineEdit:setStyleSheet( "background-color: white;" )
|
||||
::qFindLineEdit:connect( "textChanged(QString)", {|cText| ::setFindString( cText ) } )
|
||||
::qFindLineEdit:connect( "returnPressed()" , {|| ::find( ::cFind ) } )
|
||||
|
||||
::qReplLineEdit := QLineEdit():from( ::oUI:q_comboReplace:lineEdit() )
|
||||
::qReplLineEdit := ::oUI:q_comboReplace:lineEdit()
|
||||
::qReplLineEdit:setFocusPolicy( Qt_StrongFocus )
|
||||
::qReplLineEdit:setStyleSheet( "background-color: white;" )
|
||||
|
||||
@@ -320,10 +320,10 @@ METHOD IdeSearchReplace:find( cText, lBackward )
|
||||
::nCurDirection := iif( lBackward, QTextDocument_FindBackward, 0 )
|
||||
|
||||
IF len( cText ) > 0
|
||||
qCursor := QTextCursor():configure( ::qCurEdit:textCursor() )
|
||||
qCursor := ::qCurEdit:textCursor()
|
||||
|
||||
IF ::oUI:q_checkRegEx:isChecked()
|
||||
qDoc := QTextDocument():from( ::qCurEdit:document() )
|
||||
qDoc := ::qCurEdit:document()
|
||||
qReg := QRegExp()
|
||||
qReg:setPattern( cText )
|
||||
qReg:setCaseSensitivity( iif( ::oUI:q_checkMatchCase:isChecked(), Qt_CaseSensitive, Qt_CaseInsensitive ) )
|
||||
@@ -331,7 +331,7 @@ METHOD IdeSearchReplace:find( cText, lBackward )
|
||||
nFlags += ::nCurDirection
|
||||
nFlags += iif( ::oUI:q_checkWhole:isChecked(), QTextDocument_FindWholeWords, 0 )
|
||||
|
||||
qCur := QTextCursor():from( qDoc:find_1( qReg, qCursor, nFlags ) )
|
||||
qCur := qDoc:find( qReg, qCursor, nFlags )
|
||||
lFound := ! qCur:isNull()
|
||||
IF lFound
|
||||
::qCurEdit:setTextCursor( qCur )
|
||||
@@ -382,7 +382,7 @@ METHOD IdeSearchReplace:setFindString( cText )
|
||||
RETURN .f.
|
||||
ENDIF
|
||||
|
||||
qCursor := QTextCursor():configure( ::qCurEdit:textCursor() )
|
||||
qCursor := ::qCurEdit:textCursor()
|
||||
IF ::oUI:q_radioTop:isChecked()
|
||||
nPos := qCursor:position()
|
||||
qCursor:setPosition( 0 )
|
||||
@@ -408,7 +408,7 @@ METHOD IdeSearchReplace:setFindString( cText )
|
||||
METHOD IdeSearchReplace:startFromTop()
|
||||
LOCAL qCursor
|
||||
|
||||
qCursor := QTextCursor():configure( ::qCurEdit:textCursor() )
|
||||
qCursor := ::qCurEdit:textCursor()
|
||||
qCursor:setPosition( 0 )
|
||||
::qCurEdit:setTextCursor( qCursor )
|
||||
|
||||
@@ -487,7 +487,7 @@ METHOD IdeFindReplace:create( oIde )
|
||||
::oUI:q_comboReplaceWith:setEnabled( p == 0 ), ;
|
||||
iif( p == 1, ::oUI:q_buttonReplace:setEnabled( .f. ), NIL ) } )
|
||||
|
||||
::qLineEdit := QLineEdit():configure( ::oUI:q_comboFindWhat:lineEdit() )
|
||||
::qLineEdit := ::oUI:q_comboFindWhat:lineEdit()
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -531,7 +531,7 @@ METHOD IdeFindReplace:replaceSelection( cReplWith )
|
||||
|
||||
DEFAULT cReplWith TO ""
|
||||
|
||||
qCursor := QTextCursor():configure( ::qCurEdit:textCursor() )
|
||||
qCursor := ::qCurEdit:textCursor()
|
||||
IF qCursor:hasSelection() .and. !empty( cBuffer := qCursor:selectedText() )
|
||||
nL := len( cBuffer )
|
||||
nB := qCursor:position() - nL
|
||||
@@ -554,7 +554,7 @@ METHOD IdeFindReplace:replace()
|
||||
LOCAL nFound
|
||||
|
||||
IF !empty( ::qCurEdit )
|
||||
cReplWith := QLineEdit():configure( ::oUI:q_comboReplaceWith:lineEdit() ):text()
|
||||
cReplWith := ::oUI:q_comboReplaceWith:lineEdit():text()
|
||||
::replaceSelection( cReplWith )
|
||||
|
||||
IF ::oUI:q_checkGlobal:isChecked()
|
||||
@@ -585,7 +585,7 @@ METHOD IdeFindReplace:onClickFind()
|
||||
|
||||
IF ::oUI:q_radioEntire:isChecked()
|
||||
::oUI:q_radioFromCursor:setChecked( .t. )
|
||||
qCursor := QTextCursor():configure( ::qCurEdit:textCursor() )
|
||||
qCursor := ::qCurEdit:textCursor()
|
||||
nPos := qCursor:position()
|
||||
|
||||
qCursor:setPosition( 0 )
|
||||
@@ -616,7 +616,7 @@ METHOD IdeFindReplace:onClickFind()
|
||||
|
||||
METHOD IdeFindReplace:find( lWarn )
|
||||
LOCAL nFlags
|
||||
LOCAL cText := QLineEdit():configure( ::oUI:q_comboFindWhat:lineEdit() ):text()
|
||||
LOCAL cText := ::oUI:q_comboFindWhat:lineEdit():text()
|
||||
LOCAL lFound := .f.
|
||||
|
||||
DEFAULT lWarn TO .t.
|
||||
@@ -639,7 +639,7 @@ METHOD IdeFindReplace:updateFindReplaceData( cMode )
|
||||
LOCAL cData
|
||||
|
||||
IF cMode == "find"
|
||||
cData := QLineEdit():configure( ::oUI:q_comboFindWhat:lineEdit() ):text()
|
||||
cData := ::oUI:q_comboFindWhat:lineEdit():text()
|
||||
IF !empty( cData )
|
||||
IF ascan( ::oINI:aFind, {|e| e == cData } ) == 0
|
||||
hb_ains( ::oINI:aFind, 1, cData, .t. )
|
||||
@@ -649,7 +649,7 @@ METHOD IdeFindReplace:updateFindReplaceData( cMode )
|
||||
//
|
||||
::oDK:setStatusText( SB_PNL_SEARCH, cData )
|
||||
ELSE
|
||||
cData := QLineEdit():configure( ::oUI:q_comboReplaceWith:lineEdit() ):text()
|
||||
cData := ::oUI:q_comboReplaceWith:lineEdit():text()
|
||||
IF !empty( cData )
|
||||
IF ascan( ::oINI:aReplace, cData ) == 0
|
||||
hb_ains( ::oINI:aReplace, 1, cData, .t. )
|
||||
@@ -806,7 +806,7 @@ METHOD IdeFindInFiles:buildUI()
|
||||
::oUI:q_checkListOnly:setChecked( .t. )
|
||||
::oUI:q_checkPrg:setChecked( .t. )
|
||||
|
||||
qLineEdit := QLineEdit():configure( ::oUI:q_comboExpr:lineEdit() )
|
||||
qLineEdit := ::oUI:q_comboExpr:lineEdit()
|
||||
IF !empty( ::oEM )
|
||||
IF !empty( cText := ::oEM:getSelectedText() )
|
||||
qLineEdit:setText( cText )
|
||||
@@ -853,7 +853,7 @@ METHOD IdeFindInFiles:buildUI()
|
||||
::oUI:q_editResults :connect( "copyAvailable(bool)" , {|l| ::execEvent( "editResults", l ) } )
|
||||
::oUI:q_editResults :connect( "customContextMenuRequested(QPoint)", {|p| ::execEvent( "editResults-contextMenu", p ) } )
|
||||
|
||||
::qEditFind := QLineEdit():from( ::oUI:q_comboExpr:lineEdit() )
|
||||
::qEditFind := ::oUI:q_comboExpr:lineEdit()
|
||||
::qEditFind:connect( "returnPressed()", {|| ::execEvent( "buttonFind" ) } )
|
||||
|
||||
RETURN Self
|
||||
@@ -899,7 +899,7 @@ METHOD IdeFindInFiles:execEvent( cEvent, p )
|
||||
IF !empty( cPath )
|
||||
::oIde:cLastFileOpenPath := cPath
|
||||
|
||||
qLineEdit := QLineEdit():configure( ::oUI:q_comboFolder:lineEdit() )
|
||||
qLineEdit := ::oUI:q_comboFolder:lineEdit()
|
||||
qLineEdit:setText( cPath )
|
||||
IF ascan( ::oINI:aFolders, {|e| e == cPath } ) == 0
|
||||
hb_ains( ::oINI:aFolders, 1, cPath, .t. )
|
||||
@@ -924,14 +924,14 @@ METHOD IdeFindInFiles:execEvent( cEvent, p )
|
||||
|
||||
CASE "editResults"
|
||||
IF p .AND. ! ::lNotDblClick
|
||||
qCursor := QTextCursor():configure( ::oUI:q_editResults:textCursor() )
|
||||
qCursor := ::oUI:q_editResults:textCursor()
|
||||
nInfo := qCursor:blockNumber() + 1
|
||||
|
||||
IF nInfo <= len( ::aInfo ) .AND. ::aInfo[ nInfo, 1 ] == -2
|
||||
cSource := ::aInfo[ nInfo, 2 ]
|
||||
|
||||
::oSM:editSource( cSource, 0, 0, 0, NIL, NIL, .f., .t. )
|
||||
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
|
||||
qCursor := ::oIde:qCurEdit:textCursor()
|
||||
qCursor:setPosition( 0 )
|
||||
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, ::aInfo[ nInfo, 3 ] - 1 )
|
||||
qCursor:movePosition( QTextCursor_Right, QTextCursor_MoveAnchor, ::aInfo[ nInfo, 4 ] - 1 )
|
||||
@@ -950,9 +950,9 @@ METHOD IdeFindInFiles:execEvent( cEvent, p )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeFindInFiles:execContextMenu( p )
|
||||
LOCAL nLine, qCursor, qMenu, pAct, qAct, cAct, cFind
|
||||
LOCAL nLine, qCursor, qMenu, qAct, cAct, cFind
|
||||
|
||||
qCursor := QTextCursor():configure( ::oUI:q_editResults:textCursor() )
|
||||
qCursor := ::oUI:q_editResults:textCursor()
|
||||
nLine := qCursor:blockNumber() + 1
|
||||
|
||||
IF nLine <= len( ::aInfo )
|
||||
@@ -975,9 +975,7 @@ METHOD IdeFindInFiles:execContextMenu( p )
|
||||
qMenu:addAction( "Zoom In" )
|
||||
qMenu:addAction( "Zoom Out" )
|
||||
|
||||
pAct := qMenu:exec( ::oUI:q_editResults:mapToGlobal( p ) )
|
||||
IF !hbqt_isEmptyQtPointer( pAct )
|
||||
qAct := QAction():configure( pAct )
|
||||
IF ( qAct := qMenu:exec( ::oUI:q_editResults:mapToGlobal( p ) ) ):isValidObject()
|
||||
cAct := qAct:text()
|
||||
|
||||
SWITCH cAct
|
||||
@@ -1277,7 +1275,7 @@ METHOD IdeFindInFiles:showLog( nType, cMsg, aLines )
|
||||
DEFAULT cMsg TO ""
|
||||
cMsg := hbide_convertHtmlDelimiters( cMsg )
|
||||
|
||||
qCursor := QTextCursor():configure( ::oUI:q_editResults:textCursor() )
|
||||
qCursor := ::oUI:q_editResults:textCursor()
|
||||
|
||||
SWITCH nType
|
||||
|
||||
|
||||
@@ -201,9 +201,9 @@ METHOD IdeFunctions:buildHeader()
|
||||
qFnt := QFont( "Courier New" )
|
||||
oTbl:setFont( qFnt )
|
||||
|
||||
QHeaderView():from( oTbl:verticalHeader() ):hide()
|
||||
oTbl:verticalHeader():hide()
|
||||
|
||||
qHdr := QHeaderView():from( oTbl:horizontalHeader() )
|
||||
qHdr := oTbl:horizontalHeader()
|
||||
qHdr:stretchLastSection( .t. )
|
||||
|
||||
oTbl:setColumnCount( 1 )
|
||||
|
||||
@@ -105,7 +105,7 @@ CLASS IdeDocFunction
|
||||
DATA cOneliner INIT ""
|
||||
DATA cStatus INIT ""
|
||||
DATA cPlatforms INIT ""
|
||||
DATA cSeaAlso INIT ""
|
||||
DATA cSeeAlso INIT ""
|
||||
DATA cVersion INIT ""
|
||||
DATA cInherits INIT ""
|
||||
DATA cExternalLink INIT ""
|
||||
@@ -489,7 +489,7 @@ METHOD IdeHarbourHelp:execEvent( nMode, p, p1 )
|
||||
|
||||
CASE "buttonUp_clicked"
|
||||
IF ::nCurInHist > 1 .AND. ::nCurInHist <= len( ::aHistory )
|
||||
IF !empty( qTWItem := ::oUI:q_treeDoc:itemAbove( ::oUI:q_treeDoc:currentItem( 0 ) ) )
|
||||
IF ( qTWItem := ::oUI:q_treeDoc:itemAbove( ::oUI:q_treeDoc:currentItem( 0 ) ) ):isValidObject()
|
||||
::oUI:q_treeDoc:setCurrentItem( qTWItem, 0 )
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -512,7 +512,7 @@ METHOD IdeHarbourHelp:execEvent( nMode, p, p1 )
|
||||
|
||||
CASE "treeCategory_itemSelectionChanged"
|
||||
qTWItem := ::oUI:q_treeCategory:currentItem()
|
||||
n := ascan( ::aCategory, {|e_| hbqt_IsEqualGcQtPointer( e_[ 5 ]:pPtr, qTWItem ) } )
|
||||
n := ascan( ::aCategory, {|e_| hbqt_IsEqualGcQtPointer( e_[ 5 ]:pPtr, qTWItem:pPtr ) } )
|
||||
IF n > 0
|
||||
IF ::aCategory[ n, 5 ]:childCount() == 0
|
||||
::oUI:q_treeDoc:setCurrentItem( ::aCategory[ n, 4 ], 0 )
|
||||
@@ -521,7 +521,7 @@ METHOD IdeHarbourHelp:execEvent( nMode, p, p1 )
|
||||
EXIT
|
||||
|
||||
CASE "treeDoc_itemSelectionChanged"
|
||||
qTWItem := QTreeWidgetItem():from( ::oUI:q_treeDoc:currentItem() )
|
||||
qTWItem := ::oUI:q_treeDoc:currentItem()
|
||||
cText := qTWItem:text( 0 )
|
||||
|
||||
IF ( n := ascan( ::aNodes, {|e_| e_[ 5 ] == cText } ) ) > 0
|
||||
@@ -571,7 +571,6 @@ METHOD IdeHarbourHelp:populateIndexedSelection()
|
||||
|
||||
IF !empty( ::aNodes )
|
||||
IF !empty( qItem := ::oUI:q_listIndex:currentItem() )
|
||||
qItem := QListWidgetItem():from( qItem )
|
||||
cText := qItem:text()
|
||||
IF ( n := ascan( ::aFunctions, {|e_| e_[ 2 ] == cText } ) ) > 0
|
||||
::oUI:q_treeDoc:setCurrentItem( ::aFunctions[ n, 4 ] )
|
||||
@@ -844,7 +843,7 @@ METHOD IdeHarbourHelp:pullDefinitions( acBuffer )
|
||||
IF ! lIsFunc
|
||||
LOOP // It is a fake line not within $DOC$ => $END$ block
|
||||
ENDIF
|
||||
s := substr( s, 9 )
|
||||
s := substr( s, 8 )
|
||||
|
||||
SWITCH nPart
|
||||
CASE DOC_FUN_BEGINS
|
||||
@@ -892,7 +891,7 @@ METHOD IdeHarbourHelp:pullDefinitions( acBuffer )
|
||||
oFunc:cPlatForms := alltrim( s )
|
||||
EXIT
|
||||
CASE DOC_FUN_SEEALSO
|
||||
oFunc:cSeaAlso := alltrim( s )
|
||||
oFunc:cSeeAlso := alltrim( s )
|
||||
EXIT
|
||||
CASE DOC_FUN_SEEALSO
|
||||
oFunc:cVersion := alltrim( s )
|
||||
@@ -1172,7 +1171,22 @@ METHOD IdeHarbourHelp:buildView( oFunc )
|
||||
|
||||
IF !empty( oFunc:cInherits )
|
||||
aadd( aHtm, x + "Inherits" + y )
|
||||
aadd( aHtm, v + oFunc:cInherits + w )
|
||||
a_:= hb_aTokens( oFunc:cInherits, "," )
|
||||
IF !empty( a_ )
|
||||
aadd( aHtm, "<tr><td>" )
|
||||
FOR EACH s IN a_
|
||||
s := alltrim( s )
|
||||
IF ( n := at( "(", s ) ) > 0
|
||||
s1 := substr( s, 1, n-1 )
|
||||
ELSE
|
||||
s1 := s
|
||||
ENDIF
|
||||
aadd( aHtm, '<a href="' + s1 + '">' + s + "</a>" + ;
|
||||
iif( s:__enumIndex() == len( a_ ), "", ", " ) )
|
||||
NEXT
|
||||
aadd( aHtm, "</td></tr>" )
|
||||
ENDIF
|
||||
//aadd( aHtm, v + oFunc:cInherits + w )
|
||||
aadd( aHtm, z )
|
||||
ENDIF
|
||||
#if 0
|
||||
@@ -1223,7 +1237,8 @@ METHOD IdeHarbourHelp:buildView( oFunc )
|
||||
aadd( aHtm, v + s + w )
|
||||
aadd( aHtm, z )
|
||||
ENDIF
|
||||
a_:= hb_atokens( oFunc:cSeaAlso, "," )
|
||||
HB_TRACE( HB_TR_ALWAYS, 12100, oFunc:cSeeAlso )
|
||||
a_:= hb_atokens( oFunc:cSeeAlso, "," )
|
||||
IF !empty( a_ )
|
||||
aadd( aHtm, x + "SeeAlso" + y )
|
||||
aadd( aHtm, "<tr><td>" )
|
||||
|
||||
@@ -138,8 +138,7 @@ FUNCTION hbide_setProjectTitle( cTitle )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION hbide_execPopup( aPops, aqPos, qParent )
|
||||
LOCAL i, qPop, qPoint, qAct, cAct, xRet, pAct, a_, qSub, b_
|
||||
LOCAL qSub_:={}
|
||||
LOCAL i, qPop, qPoint, qAct, cAct, xRet, a_, qSub, b_, qSub_:={}
|
||||
|
||||
qPop := QMenu( iif( hb_isObject( qParent ), qParent, NIL ) )
|
||||
qPop:setStyleSheet( GetStyleSheet( "QMenuPop", hbide_setIde():nAnimantionMode ) )
|
||||
@@ -168,11 +167,9 @@ FUNCTION hbide_execPopup( aPops, aqPos, qParent )
|
||||
IF hb_isArray( aqPos )
|
||||
qPoint := QPoint( aqPos[ 1 ], aqPos[ 2 ] )
|
||||
ELSE
|
||||
qPoint := QPoint():configure( qParent:mapToGlobal( aqPos ) )
|
||||
qPoint := qParent:mapToGlobal( aqPos )
|
||||
ENDIF
|
||||
pAct := qPop:exec( qPoint )
|
||||
IF !hbqt_isEmptyQtPointer( pAct )
|
||||
qAct := QAction():configure( pAct )
|
||||
IF ( qAct := qPop:exec( qPoint ) ):isValidObject()
|
||||
cAct := qAct:text()
|
||||
FOR EACH a_ IN aPops
|
||||
IF hb_isObject( a_[ 1 ] )
|
||||
@@ -195,7 +192,6 @@ FUNCTION hbide_execPopup( aPops, aqPos, qParent )
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
qPop := NIL
|
||||
HB_SYMBOL_UNUSED( xRet )
|
||||
RETURN cAct
|
||||
@@ -234,7 +230,7 @@ FUNCTION hbide_showWarning( cMsg, cInfo, cTitle, qParent )
|
||||
LOCAL oMB
|
||||
|
||||
DEFAULT cTitle TO "Information"
|
||||
DEFAULT qParent TO SetAppWindow():pWidget
|
||||
DEFAULT qParent TO SetAppWindow():oWidget
|
||||
|
||||
oMB := QMessageBox()
|
||||
oMB:setText( cMsg )
|
||||
@@ -261,7 +257,7 @@ FUNCTION hbide_getYesNo( cMsg, cInfo, cTitle )
|
||||
oMB:setInformativeText( cInfo )
|
||||
ENDIF
|
||||
oMB:setIcon( QMessageBox_Information )
|
||||
oMB:setParent( SetAppWindow():pWidget )
|
||||
oMB:setParent( SetAppWindow():oWidget )
|
||||
oMB:setWindowFlags( Qt_Dialog )
|
||||
oMB:setWindowTitle( cTitle )
|
||||
oMB:setStandardButtons( QMessageBox_Yes + QMessageBox_No )
|
||||
@@ -281,7 +277,7 @@ FUNCTION hbide_getYesNoCancel( cMsg, cInfo, cTitle )
|
||||
oMB:setInformativeText( cInfo )
|
||||
ENDIF
|
||||
oMB:setIcon( QMessageBox_Information )
|
||||
oMB:setParent( SetAppWindow():pWidget )
|
||||
oMB:setParent( SetAppWindow():oWidget )
|
||||
oMB:setWindowFlags( Qt_Dialog )
|
||||
oMB:setWindowTitle( cTitle )
|
||||
oMB:setStandardButtons( QMessageBox_Yes + QMessageBox_No + QMessageBox_Cancel )
|
||||
@@ -1301,8 +1297,6 @@ FUNCTION hbide_fetchADate( qParent, cTitle, cPrompt, dDefault )
|
||||
DEFAULT cTitle TO "A Date Value"
|
||||
DEFAULT cPrompt TO "What"
|
||||
|
||||
//pSlots := hbxbp_getSlotsPtr()
|
||||
|
||||
oUI := hbide_getUI( "fetchdate", qParent )
|
||||
|
||||
oUI:setWindowTitle( cTitle )
|
||||
@@ -1315,20 +1309,16 @@ FUNCTION hbide_fetchADate( qParent, cTitle, cPrompt, dDefault )
|
||||
oUI:q_editDate:setDate( qDate )
|
||||
ENDIF
|
||||
|
||||
//Qt_Slots_connect( pSlots, oUI:q_buttonOk , "clicked()", {|| oUI:done( 1 ) } )
|
||||
oUI:q_buttonOk:connect( "clicked()", {|| oUI:done( 1 ) } )
|
||||
//Qt_Slots_connect( pSlots, oUI:q_buttonOk , "clicked()", {|| oUI:done( 1 ) } )
|
||||
oUI:q_buttonCancel:connect( "clicked()", {|| oUI:done( 0 ) } )
|
||||
|
||||
nRet := oUI:exec()
|
||||
|
||||
//Qt_Slots_disconnect( pSlots, oUI:q_buttonOk )
|
||||
oUI:q_buttonOk:disconnect( "clicked()" )
|
||||
//Qt_Slots_disconnect( pSlots, oUI:q_buttonCancel )
|
||||
oUI:q_buttonCancel:disconnect( "clicked()" )
|
||||
|
||||
IF nRet == 1
|
||||
qDate := QDate():from( oUI:q_editDate:date() )
|
||||
qDate := oUI:q_editDate:date()
|
||||
RETURN stod( strzero( qDate:year(), 4 ) + strzero( qDate:month(),2 ) + strzero( qDate:day(), 2 ) )
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -1518,10 +1518,10 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess )
|
||||
::oOutputResult:find( ::cIfError )
|
||||
::oOutputResult:SelBold := .T.
|
||||
|
||||
qDoc := QTextDocument():from( ::oOutputResult:document() )
|
||||
qDoc := ::oOutputResult:document()
|
||||
FOR n := 0 TO qDoc:blockCount() - 1
|
||||
IF ::cIfError == QTextBlock():from( qDoc:findBlockByNumber( n ) ):text()
|
||||
qCursor := QTextCursor():from( qDoc:find_2( ::cIfError ) )
|
||||
IF ::cIfError == qDoc:findBlockByNumber( n ):text()
|
||||
qCursor := qDoc:find( ::cIfError )
|
||||
::oOutputResult:setTextCursor( qCursor )
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
@@ -349,7 +349,7 @@ METHOD IdeINI:save( cHbideIni )
|
||||
nTabs := ::oIde:qTabWidget:count()
|
||||
FOR n := 1 TO nTabs
|
||||
pTab := ::oIde:qTabWidget:widget( n - 1 )
|
||||
nTab := ascan( ::oIde:aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ 1 ]:oWidget:pPtr, pTab ) } )
|
||||
nTab := ascan( ::oIde:aTabs, {|e_| hbqt_IsEqualGcQtPointer( e_[ 1 ]:oWidget:pPtr, pTab:pPtr ) } )
|
||||
oEdit := ::oIde:aTabs[ nTab, TAB_OEDITOR ]
|
||||
|
||||
IF !Empty( oEdit:sourceFile ) .AND. !( ".ppo" == lower( oEdit:cExt ) )
|
||||
@@ -746,9 +746,9 @@ FUNCTION hbide_restSettings( oIde )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION hbide_getEditInfoAsString( oEdit )
|
||||
LOCAL qHScr := QScrollBar():configure( oEdit:qEdit:horizontalScrollBar() )
|
||||
LOCAL qVScr := QScrollBar():configure( oEdit:qEdit:verticalScrollBar() )
|
||||
LOCAL qCursor := QTextCursor():configure( oEdit:qEdit:textCursor() )
|
||||
LOCAL qHScr := oEdit:qEdit:horizontalScrollBar()
|
||||
LOCAL qVScr := oEdit:qEdit:verticalScrollBar()
|
||||
LOCAL qCursor := oEdit:qEdit:textCursor()
|
||||
LOCAL cBMarks := hbide_nArray2string( oEdit:oEdit:aBookMarks )
|
||||
|
||||
RETURN hbide_pathNormalized( oEdit:sourceFile, .f. ) + "," + ;
|
||||
@@ -1185,7 +1185,7 @@ METHOD IdeSetup:retrieve()
|
||||
|
||||
s := ""
|
||||
FOR i := 1 TO ::oUI:q_listTextExt:count()
|
||||
qItm := QListWidgetItem():from( ::oUI:q_listTextExt:item( i - 1 ) )
|
||||
qItm := ::oUI:q_listTextExt:item( i - 1 )
|
||||
s += "." + qItm:text() + ","
|
||||
NEXT
|
||||
s := substr( s, 1, len( s ) - 1 )
|
||||
@@ -1357,7 +1357,7 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 )
|
||||
qFontDlg:setCurrentFont( qFont )
|
||||
nOK := qFontDlg:exec()
|
||||
IF nOK == 1
|
||||
qFont := QFont():from( qFontDlg:currentFont() )
|
||||
qFont := qFontDlg:currentFont()
|
||||
|
||||
::oUI:q_editFontName:setText( qFont:family() )
|
||||
::oUI:q_editPointSize:setText( hb_ntos( qFont:pointSize() ) )
|
||||
@@ -1384,7 +1384,7 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 )
|
||||
EXIT
|
||||
|
||||
CASE "treeWidget_itemSelectionChanged"
|
||||
qItem := QTreeWidgetItem():from( ::oUI:q_treeWidget:currentItem() )
|
||||
qItem := ::oUI:q_treeWidget:currentItem()
|
||||
IF ( nIndex := ascan( ::aTree, qItem:text() ) ) > 0
|
||||
::oUI:q_stackedWidget:setCurrentIndex( nIndex - 1 )
|
||||
ENDIF
|
||||
@@ -1558,7 +1558,7 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 )
|
||||
EXIT
|
||||
CASE "buttonThmSav_clicked"
|
||||
IF ( n := ::oUI:q_listThemes:currentRow() ) > -1
|
||||
::oINI:aAppThemes[ n + 1 ] := QListWidgetItem():from( ::oUI:q_listThemes:currentItem() ):text() + "," + ;
|
||||
::oINI:aAppThemes[ n + 1 ] := ::oUI:q_listThemes:currentItem():text() + "," + ;
|
||||
::fetchThemeColorsString()
|
||||
ENDIF
|
||||
EXIT
|
||||
@@ -1844,8 +1844,8 @@ METHOD IdeSetup:buildKeywords()
|
||||
|
||||
oTbl := ::oUI:q_tableVar
|
||||
|
||||
QHeaderView():from( oTbl:verticalHeader() ):hide()
|
||||
QHeaderView():from( oTbl:horizontalHeader() ):stretchLastSection( .t. )
|
||||
oTbl:verticalHeader():hide()
|
||||
oTbl:horizontalHeader():stretchLastSection( .t. )
|
||||
|
||||
oTbl:setAlternatingRowColors( .t. )
|
||||
oTbl:setColumnCount( len( hdr_ ) )
|
||||
@@ -1910,12 +1910,12 @@ METHOD IdeSetup:setBaseColor()
|
||||
|
||||
oApp := QApplication()
|
||||
|
||||
::qOrgPalette := QPalette():from( oApp:palette() )
|
||||
::qOrgPalette := oApp:palette()
|
||||
|
||||
qColor := QColor( Qt_red )
|
||||
qBrush := QBrush( "QColor", qColor )
|
||||
|
||||
qPalette := QPalette():from( oApp:palette() )
|
||||
qPalette := oApp:palette()
|
||||
qPalette:setBrush( QPalette_Window, qBrush )
|
||||
qPalette:setColor( QPalette_Window, qColor )
|
||||
qPalette:setColor( QPalette_Base, qColor )
|
||||
|
||||
@@ -562,8 +562,8 @@ METHOD IdeShortcuts:buildUI()
|
||||
::oUI:oWidget:connect( QEvent_Close, {|| ::oIde:oINI:cShortcutsDialogGeometry := hbide_posAndSize( ::oUI:oWidget ) } )
|
||||
|
||||
oTbl := ::oUI:q_tableMacros /* Build Table Header */
|
||||
QHeaderView():from( oTbl:verticalHeader() ):hide()
|
||||
QHeaderView():from( oTbl:horizontalHeader() ):stretchLastSection( .t. )
|
||||
oTbl:verticalHeader():hide()
|
||||
oTbl:horizontalHeader():stretchLastSection( .t. )
|
||||
oTbl:setAlternatingRowColors( .t. )
|
||||
oTbl:setColumnCount( len( hdr_ ) )
|
||||
oTbl:setShowGrid( .t. )
|
||||
|
||||
@@ -184,12 +184,12 @@ METHOD IdeSkeletons:execEvent( cEvent, p )
|
||||
EXIT
|
||||
|
||||
CASE "buttonRename_clicked"
|
||||
qItem := QListWidgetItem():configure( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
qItem:setText( ::rename( qItem:text() ) )
|
||||
EXIT
|
||||
|
||||
CASE "buttonDelete_clicked"
|
||||
qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
::delete( qItem:text() )
|
||||
EXIT
|
||||
|
||||
@@ -205,12 +205,12 @@ METHOD IdeSkeletons:execEvent( cEvent, p )
|
||||
EXIT
|
||||
|
||||
CASE "buttonUpdate_clicked"
|
||||
qItem := QListWidgetItem():configure( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
::save( qItem:text(), ::oUI:q_editCode:toPlainText() )
|
||||
EXIT
|
||||
|
||||
CASE "listNames_itemSelectionChanged"
|
||||
qItem := QListWidgetItem():configure( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
cName := qItem:text()
|
||||
IF ( n := ascan( ::aSkltns, {|e_| e_[ 1 ] == cName } ) ) > 0
|
||||
::oUI:q_editCode:setPlainText( ::aSkltns[ n, 2 ] )
|
||||
@@ -328,10 +328,10 @@ METHOD IdeSkeletons:postSkeleton( cSkeleton )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeSkeletons:selectByMenuAndPostText( qEdit )
|
||||
LOCAL cText, qCursor, qRect, qMenu, qAct, pAct, a_
|
||||
LOCAL cText, qCursor, qRect, qMenu, qAct, a_
|
||||
|
||||
IF !empty( ::aSkltns )
|
||||
qCursor := QTextCursor():from( qEdit:textCursor() )
|
||||
qCursor := qEdit:textCursor()
|
||||
|
||||
/* Look for if a macro is executed */
|
||||
qCursor:select( QTextCursor_WordUnderCursor )
|
||||
@@ -342,17 +342,14 @@ METHOD IdeSkeletons:selectByMenuAndPostText( qEdit )
|
||||
::postText( qEdit, ::getText( cText ) )
|
||||
|
||||
ELSE
|
||||
qRect := QRect():from( qEdit:cursorRect( qCursor ) )
|
||||
qRect := qEdit:cursorRect( qCursor )
|
||||
|
||||
qMenu := QMenu( qEdit )
|
||||
FOR EACH a_ IN ::aSkltns
|
||||
qMenu:addAction( a_[ 1 ] )
|
||||
NEXT
|
||||
|
||||
pAct := qMenu:exec( qEdit:mapToGlobal( QPoint( qRect:x(), qRect:y() ) ) )
|
||||
IF !hbqt_isEmptyQtPointer( pAct )
|
||||
qAct := QAction():from( pAct )
|
||||
|
||||
IF ( qAct := qMenu:exec( qEdit:mapToGlobal( QPoint( qRect:x(), qRect:y() ) ) ) ):isValidObject()
|
||||
IF !empty( cText := ::getText( qAct:text() ) )
|
||||
::postText( qEdit, cText )
|
||||
ENDIF
|
||||
@@ -452,7 +449,7 @@ METHOD IdeSkeletons:getText( cSkeleton )
|
||||
|
||||
METHOD IdeSkeletons:postText( qEdit, cText )
|
||||
LOCAL s, a_, nCol, nPos, nRowCur, nColCur, n
|
||||
LOCAL qCursor := QTextCursor():from( qEdit:textCursor() )
|
||||
LOCAL qCursor := qEdit:textCursor()
|
||||
|
||||
::nPosCursor := NIL
|
||||
::aMetas := { { "", "" } }
|
||||
|
||||
@@ -664,7 +664,7 @@ METHOD IdeThemes:updateColor()
|
||||
oDlg:setCurrentColor( qColor )
|
||||
oDlg:exec()
|
||||
|
||||
qColor:configure( oDlg:currentColor() )
|
||||
qColor := oDlg:currentColor()
|
||||
|
||||
::aThemes[ ::nCurTheme, 2, ::nCurItem, 2, THM_ATR_R ] := qColor:red()
|
||||
::aThemes[ ::nCurTheme, 2, ::nCurItem, 2, THM_ATR_G ] := qColor:green()
|
||||
@@ -751,12 +751,12 @@ METHOD IdeThemes:selectThemeProc( nMode, p )
|
||||
|
||||
DO CASE
|
||||
CASE nMode == 1
|
||||
qModalIndex := QModelIndex():configure( p )
|
||||
qModalIndex := QModelIndex():from( p )
|
||||
::cSelTheme := ::aThemes[ qModalIndex:row() + 1, 1 ]
|
||||
::oSL:done( 1 )
|
||||
|
||||
CASE nMode == 2
|
||||
qModalIndex := QModelIndex():configure( ::oSL:qObj[ "listOptions" ]:currentIndex() )
|
||||
qModalIndex := ::oSL:qObj[ "listOptions" ]:currentIndex()
|
||||
::cSelTheme := ::aThemes[ qModalIndex:row() + 1, 1 ]
|
||||
::oSL:done( 1 )
|
||||
|
||||
|
||||
@@ -266,8 +266,8 @@ METHOD IdeToolsManager:show()
|
||||
hdr_:= { { "Img", 30 }, { "Tool", 218 } }
|
||||
oTbl := ::oUI:q_tableButtons
|
||||
//
|
||||
QHeaderView():from( oTbl:verticalHeader() ):hide()
|
||||
QHeaderView():from( oTbl:horizontalHeader() ):stretchLastSection( .t. )
|
||||
oTbl:verticalHeader():hide()
|
||||
oTbl:horizontalHeader():stretchLastSection( .t. )
|
||||
oTbl:setAlternatingRowColors( .t. )
|
||||
oTbl:setColumnCount( len( hdr_ ) )
|
||||
oTbl:setShowGrid( .t. )
|
||||
@@ -332,7 +332,7 @@ METHOD IdeToolsManager:execEvent( cMode, p )
|
||||
::oUI:q_listToolbars:setCurrentRow( p )
|
||||
EXIT
|
||||
CASE "listNames_itemSelectionChanged"
|
||||
qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
cName := qItem:text()
|
||||
IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0
|
||||
::ini2Controls( nIndex )
|
||||
@@ -346,7 +346,7 @@ METHOD IdeToolsManager:execEvent( cMode, p )
|
||||
EXIT
|
||||
CASE "buttonDelete_clicked"
|
||||
IF ::oUI:q_listNames:currentRow() >= 0
|
||||
qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
cName := qItem:text()
|
||||
IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0
|
||||
hb_adel( ::oINI:aTools, nIndex, .t. )
|
||||
@@ -363,7 +363,7 @@ METHOD IdeToolsManager:execEvent( cMode, p )
|
||||
IF ! ::lExecuting
|
||||
::lExecuting := .t.
|
||||
IF ::oUI:q_listNames:currentRow() >= 0
|
||||
qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
::execTool( qItem:text() )
|
||||
ENDIF
|
||||
::lExecuting := .f.
|
||||
@@ -379,7 +379,7 @@ METHOD IdeToolsManager:execEvent( cMode, p )
|
||||
EXIT
|
||||
CASE "buttonUpdate_clicked"
|
||||
IF ( nRow := ::oUI:q_listNames:currentRow() ) >= 0
|
||||
qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() )
|
||||
qItem := ::oUI:q_listNames:currentItem()
|
||||
cName := qItem:text()
|
||||
|
||||
IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0
|
||||
@@ -644,7 +644,7 @@ METHOD IdeToolsManager:buildToolsButton()
|
||||
::qToolsMenu := QMenu()
|
||||
::qToolsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) )
|
||||
FOR EACH a_ IN ::aTools
|
||||
qAct := QAction():from( ::qToolsMenu:addAction( a_[ 1 ] ) )
|
||||
qAct := ::qToolsMenu:addAction( a_[ 1 ] )
|
||||
qAct:connect( "triggered(bool)", {|| ::execTool( a_[ 1 ] ) } )
|
||||
aadd( ::aAct, qAct )
|
||||
NEXT
|
||||
@@ -684,7 +684,7 @@ METHOD IdeToolsManager:buildPanelsButton()
|
||||
METHOD IdeToolsManager:addPanelsMenu( cPrompt )
|
||||
LOCAL qAct
|
||||
|
||||
qAct := QAction():from( ::qPanelsMenu:addAction( cPrompt ) )
|
||||
qAct := ::qPanelsMenu:addAction( cPrompt )
|
||||
qAct:setIcon( ::oDK:getPanelIcon( cPrompt ) )
|
||||
qAct:connect( "triggered(bool)", {|| ::oDK:setView( cPrompt ) } )
|
||||
aadd( ::aPanelsAct, qAct )
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009-2010 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
* Copyright 2009-2010 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* www - http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -58,6 +56,40 @@
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* C R E D I T S */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Marcos Antonio Gambeta
|
||||
* for providing first ever prototype parsing methods. Though the current
|
||||
* implementation is diametrically different then what he proposed, still
|
||||
* current code shaped on those footsteps.
|
||||
*
|
||||
* Viktor Szakats
|
||||
* for directing the project with futuristic vision;
|
||||
* for designing and maintaining a complex build system for hbQT, hbIDE;
|
||||
* for introducing many constructs on PRG and C++ levels;
|
||||
* for streamlining signal/slots and events management classes;
|
||||
*
|
||||
* Istvan Bisz
|
||||
* for introducing QPointer<> concept in the generator;
|
||||
* for testing the library on numerous accounts;
|
||||
* for showing a way how a GC pointer can be detached;
|
||||
*
|
||||
* Francesco Perillo
|
||||
* for taking keen interest in hbQT development and peeking the code;
|
||||
* for providing tips here and there to improve the code quality;
|
||||
* for hitting bulls eye to describe why few objects need GC detachment;
|
||||
*
|
||||
* Carlos Bacco
|
||||
* for implementing HBQT_TYPE_Q*Class enums;
|
||||
* for peeking into the code and suggesting optimization points;
|
||||
*
|
||||
* Przemyslaw Czerpak
|
||||
* for providing tips and trick to manipulate HVM internals to the best
|
||||
* of its use and always showing a path when we get stuck;
|
||||
* A true tradition of a MASTER...
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "hbclass.ch"
|
||||
@@ -116,5 +148,5 @@ METHOD QWebSecurityOrigin:setDatabaseQuota( nQuota )
|
||||
|
||||
|
||||
METHOD QWebSecurityOrigin:allOrigins()
|
||||
RETURN Qt_QWebSecurityOrigin_allOrigins( ::pPtr )
|
||||
RETURN HB_QList():from( Qt_QWebSecurityOrigin_allOrigins( ::pPtr ) )
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009-2010 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
* Copyright 2009-2010 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* www - http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -58,6 +56,40 @@
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* C R E D I T S */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Marcos Antonio Gambeta
|
||||
* for providing first ever prototype parsing methods. Though the current
|
||||
* implementation is diametrically different then what he proposed, still
|
||||
* current code shaped on those footsteps.
|
||||
*
|
||||
* Viktor Szakats
|
||||
* for directing the project with futuristic vision;
|
||||
* for designing and maintaining a complex build system for hbQT, hbIDE;
|
||||
* for introducing many constructs on PRG and C++ levels;
|
||||
* for streamlining signal/slots and events management classes;
|
||||
*
|
||||
* Istvan Bisz
|
||||
* for introducing QPointer<> concept in the generator;
|
||||
* for testing the library on numerous accounts;
|
||||
* for showing a way how a GC pointer can be detached;
|
||||
*
|
||||
* Francesco Perillo
|
||||
* for taking keen interest in hbQT development and peeking the code;
|
||||
* for providing tips here and there to improve the code quality;
|
||||
* for hitting bulls eye to describe why few objects need GC detachment;
|
||||
*
|
||||
* Carlos Bacco
|
||||
* for implementing HBQT_TYPE_Q*Class enums;
|
||||
* for peeking into the code and suggesting optimization points;
|
||||
*
|
||||
* Przemyslaw Czerpak
|
||||
* for providing tips and trick to manipulate HVM internals to the best
|
||||
* of its use and always showing a path when we get stuck;
|
||||
* A true tradition of a MASTER...
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "hbclass.ch"
|
||||
@@ -150,7 +182,7 @@ METHOD QWebSettings:testAttribute( nAttribute )
|
||||
|
||||
|
||||
METHOD QWebSettings:userStyleSheetUrl()
|
||||
RETURN Qt_QWebSettings_userStyleSheetUrl( ::pPtr )
|
||||
RETURN HB_QUrl():from( Qt_QWebSettings_userStyleSheetUrl( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebSettings:clearIconDatabase()
|
||||
@@ -158,7 +190,7 @@ METHOD QWebSettings:clearIconDatabase()
|
||||
|
||||
|
||||
METHOD QWebSettings:globalSettings()
|
||||
RETURN Qt_QWebSettings_globalSettings( ::pPtr )
|
||||
RETURN HB_QWebSettings():from( Qt_QWebSettings_globalSettings( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebSettings:iconDatabasePath()
|
||||
@@ -166,7 +198,7 @@ METHOD QWebSettings:iconDatabasePath()
|
||||
|
||||
|
||||
METHOD QWebSettings:iconForUrl( pUrl )
|
||||
RETURN Qt_QWebSettings_iconForUrl( ::pPtr, hbqt_ptr( pUrl ) )
|
||||
RETURN HB_QIcon():from( Qt_QWebSettings_iconForUrl( ::pPtr, hbqt_ptr( pUrl ) ) )
|
||||
|
||||
|
||||
METHOD QWebSettings:maximumPagesInCache()
|
||||
@@ -206,5 +238,5 @@ METHOD QWebSettings:setWebGraphic( nType, pGraphic )
|
||||
|
||||
|
||||
METHOD QWebSettings:webGraphic( nType )
|
||||
RETURN Qt_QWebSettings_webGraphic( ::pPtr, nType )
|
||||
RETURN HB_QPixmap():from( Qt_QWebSettings_webGraphic( ::pPtr, nType ) )
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009-2010 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
* Copyright 2009-2010 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* www - http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -58,6 +56,40 @@
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* C R E D I T S */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* Marcos Antonio Gambeta
|
||||
* for providing first ever prototype parsing methods. Though the current
|
||||
* implementation is diametrically different then what he proposed, still
|
||||
* current code shaped on those footsteps.
|
||||
*
|
||||
* Viktor Szakats
|
||||
* for directing the project with futuristic vision;
|
||||
* for designing and maintaining a complex build system for hbQT, hbIDE;
|
||||
* for introducing many constructs on PRG and C++ levels;
|
||||
* for streamlining signal/slots and events management classes;
|
||||
*
|
||||
* Istvan Bisz
|
||||
* for introducing QPointer<> concept in the generator;
|
||||
* for testing the library on numerous accounts;
|
||||
* for showing a way how a GC pointer can be detached;
|
||||
*
|
||||
* Francesco Perillo
|
||||
* for taking keen interest in hbQT development and peeking the code;
|
||||
* for providing tips here and there to improve the code quality;
|
||||
* for hitting bulls eye to describe why few objects need GC detachment;
|
||||
*
|
||||
* Carlos Bacco
|
||||
* for implementing HBQT_TYPE_Q*Class enums;
|
||||
* for peeking into the code and suggesting optimization points;
|
||||
*
|
||||
* Przemyslaw Czerpak
|
||||
* for providing tips and trick to manipulate HVM internals to the best
|
||||
* of its use and always showing a path when we get stuck;
|
||||
* A true tradition of a MASTER...
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "hbclass.ch"
|
||||
@@ -114,11 +146,11 @@ METHOD QWebView:findText( cSubString, nOptions )
|
||||
|
||||
|
||||
METHOD QWebView:history()
|
||||
RETURN Qt_QWebView_history( ::pPtr )
|
||||
RETURN HB_QWebHistory():from( Qt_QWebView_history( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebView:icon()
|
||||
RETURN Qt_QWebView_icon( ::pPtr )
|
||||
RETURN HB_QIcon():from( Qt_QWebView_icon( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebView:isModified()
|
||||
@@ -126,41 +158,34 @@ METHOD QWebView:isModified()
|
||||
|
||||
|
||||
METHOD QWebView:load( ... )
|
||||
LOCAL p, aP, nP, aV := {}
|
||||
aP := hb_aParams()
|
||||
nP := len( aP )
|
||||
::valtypes( aP, aV )
|
||||
FOR EACH p IN { ... }
|
||||
hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) )
|
||||
NEXT
|
||||
DO CASE
|
||||
CASE nP == 3
|
||||
SWITCH PCount()
|
||||
CASE 3
|
||||
DO CASE
|
||||
CASE aV[ 1 ] $ "PO" .AND. aV[ 2 ] $ "N" .AND. aV[ 3 ] $ "PO"
|
||||
// void load ( const QNetworkRequest & request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray & body = QByteArray() )
|
||||
// PO p QNetworkRequest, N n QNetworkAccessManager::Operation, PO p QByteArray
|
||||
CASE hb_isObject( hb_pvalue( 1 ) ) .AND. hb_isNumeric( hb_pvalue( 2 ) ) .AND. hb_isObject( hb_pvalue( 3 ) )
|
||||
RETURN Qt_QWebView_load_1( ::pPtr, ... )
|
||||
ENDCASE
|
||||
CASE nP == 1
|
||||
EXIT
|
||||
CASE 1
|
||||
DO CASE
|
||||
CASE aV[ 1 ] $ "PO"
|
||||
// void load ( const QUrl & url )
|
||||
// PO p QUrl
|
||||
RETURN Qt_QWebView_load( ::pPtr, ... )
|
||||
// void load ( const QNetworkRequest & request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray & body = QByteArray() )
|
||||
// PO p QNetworkRequest, N n QNetworkAccessManager::Operation, PO p QByteArray
|
||||
// RETURN Qt_QWebView_load_1( ::pPtr, ... )
|
||||
CASE hb_isObject( hb_pvalue( 1 ) )
|
||||
SWITCH __objGetClsName( hb_pvalue( 1 ) )
|
||||
CASE "QURL"
|
||||
RETURN Qt_QWebView_load( ::pPtr, ... )
|
||||
CASE "QNETWORKREQUEST"
|
||||
RETURN Qt_QWebView_load_1( ::pPtr, ... )
|
||||
ENDSWITCH
|
||||
ENDCASE
|
||||
ENDCASE
|
||||
RETURN NIL
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
RETURN hbqt_error()
|
||||
|
||||
|
||||
METHOD QWebView:page()
|
||||
RETURN Qt_QWebView_page( ::pPtr )
|
||||
RETURN HB_QWebPage():from( Qt_QWebView_page( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebView:pageAction( nAction )
|
||||
RETURN Qt_QWebView_pageAction( ::pPtr, nAction )
|
||||
RETURN HB_QAction():from( Qt_QWebView_pageAction( ::pPtr, nAction ) )
|
||||
|
||||
|
||||
METHOD QWebView:selectedText()
|
||||
@@ -192,7 +217,7 @@ METHOD QWebView:setZoomFactor( nFactor )
|
||||
|
||||
|
||||
METHOD QWebView:settings()
|
||||
RETURN Qt_QWebView_settings( ::pPtr )
|
||||
RETURN HB_QWebSettings():from( Qt_QWebView_settings( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebView:textSizeMultiplier()
|
||||
@@ -208,7 +233,7 @@ METHOD QWebView:triggerPageAction( nAction, lChecked )
|
||||
|
||||
|
||||
METHOD QWebView:url()
|
||||
RETURN Qt_QWebView_url( ::pPtr )
|
||||
RETURN HB_QUrl():from( Qt_QWebView_url( ::pPtr ) )
|
||||
|
||||
|
||||
METHOD QWebView:zoomFactor()
|
||||
|
||||
@@ -162,7 +162,7 @@ FUNCTION xReleaseMemory( aObj )
|
||||
LOCAL i
|
||||
FOR i := 1 TO len( aObj )
|
||||
IF hb_isObject( aObj[ i ] )
|
||||
aObj[ i ]:pPtr := 1
|
||||
aObj[ i ] := NIL
|
||||
ELSEIF hb_isArray( aObj[ i ] )
|
||||
xReleaseMemory( aObj[ i ] )
|
||||
ENDIF
|
||||
@@ -240,17 +240,17 @@ STATIC FUNCTION Build_MenuBar( oWnd )
|
||||
oActNew:connect( "triggered(bool)", {|w,l| FileDialog( "New" , w, l ) } )
|
||||
oMenu1:addAction( oActNew )
|
||||
|
||||
oActOpen := QAction():from( oMenu1:addAction( "open.png", "&Open" ) )
|
||||
oActOpen := oMenu1:addAction( "open.png", "&Open" )
|
||||
oActOpen:connect( QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open" , w, l ) } )
|
||||
|
||||
oMenu1:addSeparator()
|
||||
|
||||
oActSave := QAction():from( oMenu1:addAction( "save.png", "&Save" ) )
|
||||
oActSave := oMenu1:addAction( "save.png", "&Save" )
|
||||
oActSave:connect( QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save" , w, l ) } )
|
||||
|
||||
oMenu1:addSeparator()
|
||||
|
||||
oActExit := QAction():from( oMenu1:addAction( "E&xit" ) )
|
||||
oActExit := oMenu1:addAction( "E&xit" )
|
||||
oActExit:connect( QT_EVE_TRIGGERED_B, {|| s_qApp:quit() } )
|
||||
|
||||
oMenuBar:addMenu( oMenu1 )
|
||||
@@ -258,31 +258,31 @@ STATIC FUNCTION Build_MenuBar( oWnd )
|
||||
oMenu2 := QMenu()
|
||||
oMenu2:setTitle( "&Dialogs" )
|
||||
|
||||
oActColors := QAction():from( oMenu2:addAction( "&Colors" ) )
|
||||
oActColors := oMenu2:addAction( "&Colors" )
|
||||
oActColors:connect( QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors", w, l ) } )
|
||||
|
||||
oActFonts := QAction():from( oMenu2:addAction( "&Fonts" ) )
|
||||
oActFonts := oMenu2:addAction( "&Fonts" )
|
||||
oActFonts:connect( QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts", w, l ) } )
|
||||
|
||||
oMenu2:addSeparator()
|
||||
|
||||
oActPgSetup := QAction():from( oMenu2:addAction( "&PageSetup" ) )
|
||||
oActPgSetup := oMenu2:addAction( "&PageSetup" )
|
||||
oActPgSetup:connect( QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } )
|
||||
|
||||
oActPreview := QAction():from( oMenu2:addAction( "P&review" ) )
|
||||
oActPreview := oMenu2:addAction( "P&review" )
|
||||
oActPreview:connect( QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview", w, l ) } )
|
||||
|
||||
oMenu2:addSeparator()
|
||||
|
||||
oActWiz := QAction():from( oMenu2:addAction( "&Wizard" ) )
|
||||
oActWiz := oMenu2:addAction( "&Wizard" )
|
||||
oActWiz:connect( QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard", w, l ) } )
|
||||
|
||||
oActWeb := QAction():from( oMenu2:addAction( "W&ebPage" ) )
|
||||
oActWeb := oMenu2:addAction( "W&ebPage" )
|
||||
oActWeb:connect( QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage", w, l ) } )
|
||||
|
||||
oMenu2:addSeparator()
|
||||
|
||||
oActOther := QAction():from( oMenu2:addAction( "&Another Dialog" ) )
|
||||
oActOther := oMenu2:addAction( "&Another Dialog" )
|
||||
oActOther:connect( QT_EVE_TRIGGERED_B, {|| ExecOneMore() } )
|
||||
|
||||
oMenuBar:addMenu( oMenu2 )
|
||||
@@ -601,7 +601,6 @@ STATIC FUNCTION Dialogs( cType )
|
||||
oDlg := QWebView()
|
||||
oUrl := QUrl()
|
||||
oUrl:setUrl( "http://www.harbour.vouch.info" )
|
||||
QT_QWebView_SetUrl( oDlg:pPtr, oUrl:pPtr )
|
||||
oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" )
|
||||
oDlg:exec()
|
||||
#endif
|
||||
@@ -631,12 +630,12 @@ FUNCTION ShowInSystemTray( oWnd )
|
||||
oMenuSys := QMenu( oWnd )
|
||||
oMenuSys:setTitle( "&File" )
|
||||
|
||||
oActShow := QAction():from( oMenuSys:addAction( "new.png" , "&Show" ) )
|
||||
oActShow := oMenuSys:addAction( "new.png" , "&Show" )
|
||||
oActShow:connect( QT_EVE_TRIGGERED_B, {|| oWnd:show() } )
|
||||
|
||||
oMenuSys:addSeparator()
|
||||
|
||||
oActHide := QAction():from( oMenuSys:addAction( "new.png" , "&Show" ) )
|
||||
oActHide := oMenuSys:addAction( "new.png" , "&Show" )
|
||||
oActHide:connect( QT_EVE_TRIGGERED_B, {|| oWnd:hide() } )
|
||||
|
||||
oSys := QSystemTrayIcon( oWnd )
|
||||
|
||||
@@ -1063,28 +1063,15 @@ METHOD HbQtSource:buildClass()
|
||||
IF "..." $ oMtd:cMtdDef /* reworked at c++ level - embed as is */
|
||||
aadd( txt_, "" )
|
||||
aadd( txt_, "METHOD " + ::cWidget + ":" + oMtd:cMtdDef )
|
||||
aadd( txt_, " LOCAL p" )
|
||||
aadd( txt_, " FOR EACH p IN { ... }" )
|
||||
aadd( txt_, " hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) )" )
|
||||
aadd( txt_, " NEXT" )
|
||||
aadd( txt_, " RETURN " + oMtd:cMtdCall )
|
||||
hbide_addReturnMethod( txt_, oMtd, ::cWidget, 3, 1, .f., .f., 0, NIL )
|
||||
aadd( txt_, "" )
|
||||
|
||||
ELSEIF lClub .AND. oMtd:nSiblings > 0 /* has more calls with same name */
|
||||
aadd( txt_, "" )
|
||||
aadd( txt_, "METHOD " + ::cWidget + ":" + oMtd:cHBFunc + "( ... )" )
|
||||
aadd( txt_, " LOCAL p, aP, nP, aV := {}" )
|
||||
aadd( txt_, " aP := hb_aParams()" )
|
||||
aadd( txt_, " nP := len( aP )" )
|
||||
aadd( txt_, " ::valtypes( aP, aV )" )
|
||||
aadd( txt_, " FOR EACH p IN { ... }" )
|
||||
aadd( txt_, " hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) )" )
|
||||
aadd( txt_, " NEXT" )
|
||||
//
|
||||
a_:= hbide_pullSameMethods( oMtd:cFun, ::aMethods, ::cWidget )
|
||||
aeval( a_, {|e| aadd( txt_, e ) } )
|
||||
//
|
||||
aadd( txt_, " RETURN NIL" )
|
||||
aadd( txt_, " RETURN hbqt_error()" )
|
||||
aadd( txt_, "" )
|
||||
|
||||
ELSEIF lClub .AND. oMtd:isSibling /* is another call with same name handedlled previously - do nothing */
|
||||
@@ -1093,7 +1080,7 @@ METHOD HbQtSource:buildClass()
|
||||
ELSE /* as usual */
|
||||
aadd( txt_, "" )
|
||||
aadd( txt_, "METHOD " + ::cWidget + ":" + oMtd:cMtdDef )
|
||||
aadd( txt_, " RETURN " + oMtd:cMtdCall )
|
||||
hbide_addReturnMethod( txt_, oMtd, ::cWidget, 3, 1, .f., .f., 0, NIL )
|
||||
aadd( txt_, "" )
|
||||
|
||||
ENDIF
|
||||
@@ -1113,7 +1100,8 @@ METHOD HbQtSource:buildClass()
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION hbide_pullSameMethods( cFun, aMethods, cWidget )
|
||||
LOCAL i, oMtd, a_:={}, b_:={}, c_:={}, nArgs, n, txt_:={}, cSpc, cCrc, lFirst, nMtds
|
||||
LOCAL i, oMtd, a_:={}, b_:={}, c_:={}, nArgs, n, txt_:={}
|
||||
LOCAL cSpc, cCrc, lFirst, nMtds, nTySame, lInIf
|
||||
|
||||
FOR EACH oMtd IN aMethods
|
||||
IF oMtd:cFun == cFun
|
||||
@@ -1129,7 +1117,7 @@ STATIC FUNCTION hbide_pullSameMethods( cFun, aMethods, cWidget )
|
||||
|
||||
/* Build the structure number of parameters wise */
|
||||
FOR EACH nArgs IN b_
|
||||
aadd( c_, { nArgs, {} } )
|
||||
aadd( c_, { nArgs, {}, {}, {} } )
|
||||
n := len( c_ )
|
||||
FOR EACH oMtd IN a_
|
||||
IF oMtd:nArgs == nArgs
|
||||
@@ -1156,69 +1144,127 @@ STATIC FUNCTION hbide_pullSameMethods( cFun, aMethods, cWidget )
|
||||
NEXT
|
||||
|
||||
cSpc := " "
|
||||
aadd( txt_, cSpc + "DO CASE" )
|
||||
aadd( txt_, cSpc + "SWITCH PCount()" )
|
||||
FOR EACH b_ IN c_
|
||||
n := b_[ 1 ]
|
||||
a_:= b_[ 2 ]
|
||||
aadd( txt_, cSpc + "CASE nP == " + hb_ntos( n ) )
|
||||
cCrc := "xxx"
|
||||
nMtds := 0
|
||||
aadd( txt_, cSpc + "CASE " + hb_ntos( n ) ) /* number of parameters */
|
||||
cCrc := "xxx"
|
||||
nMtds := 0
|
||||
lInIf := .f.
|
||||
nTySame := 0
|
||||
IF n > 0
|
||||
lFirst := .t.
|
||||
aadd( txt_, cSpc + cSpc + "DO CASE" )
|
||||
aadd( txt_, cSpc + cSpc + "DO CASE" ) /* type of parameters */
|
||||
ENDIF
|
||||
FOR EACH oMtd IN a_
|
||||
IF n > 0
|
||||
IF cCrc != TY( oMtd, n )
|
||||
cCrc := TY( oMtd, n )
|
||||
nMtds := 0
|
||||
cCrc := TY( oMtd, n )
|
||||
nMtds := 0
|
||||
nTySame := 0
|
||||
aeval( a_, {|o| iif( TY( o,n ) == cCrc, nTySame++, NIL ) } )
|
||||
lInIf := oMtd:nArgQCast > 0 .AND. oMtd:nArgQCast <= n .AND. nTySame > 1
|
||||
IF ! lFirst
|
||||
lFirst := .t.
|
||||
aadd( txt_, cSpc + cSpc + "ENDCASE" )
|
||||
ENDIF
|
||||
|
||||
aadd( txt_, cSpc + cSpc + "CASE " + TY_TYPES( oMtd,n ) )
|
||||
ENDIF
|
||||
ENDIF
|
||||
nMtds++
|
||||
hbide_addReturnMethod( txt_, oMtd, cWidget, iif( n == 0, 6, 9 ), nMtds )
|
||||
hbide_addReturnMethod( txt_, oMtd, cWidget, iif( n == 0, 6, 9 ), nMtds, .t., lInIf, nTySame, n )
|
||||
NEXT
|
||||
IF n > 0
|
||||
aadd( txt_, cSpc + cSpc + "ENDCASE" )
|
||||
aadd( txt_, cSpc + cSpc + "EXIT" )
|
||||
ENDIF
|
||||
NEXT
|
||||
aadd( txt_, cSpc + "ENDCASE" )
|
||||
aadd( txt_, cSpc + "ENDSWITCH" )
|
||||
|
||||
RETURN txt_
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION hbide_addReturnMethod( txt_, oM, cWidget, nInd, nCount )
|
||||
LOCAL s, cFun, sp := space( nInd )
|
||||
STATIC FUNCTION hbide_addReturnMethod( txt_, oM, cWidget, nInd, nCount, lClubbed, lInIf, nTySame, nArgToCheck )
|
||||
LOCAL cFun, sp := space( nInd )
|
||||
LOCAL cRetCast := oM:oRet:cCast
|
||||
LOCAL cPostFix := "" // " // " + oM:cProto
|
||||
LOCAL cPreFix
|
||||
|
||||
DEFAULT lInIf TO .f.
|
||||
DEFAULT nTySame TO 0
|
||||
DEFAULT nArgToCheck TO oM:nArgs
|
||||
|
||||
// cPreFix := "FOR EACH p IN { ... } ; hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) ; NEXT ; "
|
||||
cPreFix := ""
|
||||
|
||||
aadd( txt_, sp + " " + "// " + oM:cProto )
|
||||
IF !empty( s := hbide_methodInfo( oM ) )
|
||||
aadd( txt_, sp + " " + "// " + s )
|
||||
ENDIF
|
||||
IF ! ( "::" $ cRetCast ) .AND. ;
|
||||
! ( "<" $ cRetCast ) .AND. ;
|
||||
! ( cRetCast $ "QString,QRgb" ) .AND. ;
|
||||
( left( cRetCast, 1 ) == "Q" .OR. left( cRetCast, 3 ) == "HBQ" )
|
||||
|
||||
cFun := cRetCast + "():from( " + "Qt_" + cWidget + "_" + oM:cHBFunc + "( ::pPtr, ... )" + " )"
|
||||
IF lClubbed
|
||||
cFun := "HB_" + cRetCast + "():from( " + "Qt_" + cWidget + "_" + oM:cHBFunc + "( ::pPtr, ... )" + " )"
|
||||
ELSE
|
||||
cFun := "HB_" + cRetCast + "():from( " + oM:cMtdCall + " )"
|
||||
ENDIF
|
||||
|
||||
ELSEIF ( "<" $ cRetCast )
|
||||
IF lClubbed
|
||||
cFun := "HB_" + "QList" + "():from( " + "Qt_" + cWidget + "_" + oM:cHBFunc + "( ::pPtr, ... )" + " )"
|
||||
ELSE
|
||||
cFun := "HB_" + "QList" + "():from( " + oM:cMtdCall + " )"
|
||||
ENDIF
|
||||
|
||||
/* Workable but then code needs to be changed - defer for now*/
|
||||
//cFun := cRetCast + "( " + "Qt_" + cWidget + "_" + oM:cHBFunc + "( ::pPtr, ... )" + " )"
|
||||
ELSE
|
||||
cFun := "Qt_" + cWidget + "_" + oM:cHBFunc + "( ::pPtr, ... )"
|
||||
IF lClubbed
|
||||
cFun := "Qt_" + cWidget + "_" + oM:cHBFunc + "( ::pPtr, ... )"
|
||||
ELSE
|
||||
cFun := oM:cMtdCall
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
s := sp + iif( nCount > 1, "// ", "" ) + "RETURN " + cFun
|
||||
aadd( txt_, s )
|
||||
IF nCount > 1
|
||||
HB_TRACE( HB_TR_ALWAYS, s ) /* needed to refine the engine further */
|
||||
|
||||
IF nTySame > 0 .AND. lInIf
|
||||
HB_TRACE( HB_TR_ALWAYS, oM:nArgQCast, oM:nArgs )
|
||||
|
||||
IF oM:nArgQCast == 0
|
||||
aadd( txt_, sp + "// " + "RETURN " + cFun + cPostFix )
|
||||
HB_TRACE( HB_TR_ALWAYS, "// RETURN " + cFun + cPostFix ) /* needed to refine the engine further */
|
||||
IF nTySame > 1 .AND. nCount == nTySame
|
||||
aadd( txt_, sp + "ENDSWITCH" )
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
ENDIF
|
||||
|
||||
IF nTySame > 1 .AND. nCount == 1
|
||||
aadd( txt_, sp + "SWITCH __objGetClsName( hb_pvalue( " + hb_ntos( oM:nArgQCast ) + " ) )" )
|
||||
ENDIF
|
||||
IF nTySame > 1
|
||||
aadd( txt_, sp + "CASE " + '"' + upper( oM:hArgs[ oM:nArgQCast ]:cCast ) + '"' )
|
||||
aadd( txt_, sp + " " + cPrefix + "RETURN " + cFun + cPostFix )
|
||||
ELSE
|
||||
aadd( txt_, sp + "IF __objGetClsName( hb_pvalue( " + hb_ntos( oM:nArgQCast ) + " ) ) == " + '"' + upper( oM:hArgs[ oM:nArgQCast ]:cCast ) + '"' )
|
||||
aadd( txt_, sp + " " + cPrefix + "RETURN " + cFun + cPostFix )
|
||||
aadd( txt_, sp + "ENDIF" )
|
||||
ENDIF
|
||||
IF nTySame > 1 .AND. nCount == nTySame
|
||||
aadd( txt_, sp + "ENDSWITCH" )
|
||||
ENDIF
|
||||
ELSE
|
||||
IF nCount > 1
|
||||
aadd( txt_, sp + "// " + "RETURN " + cFun + cPostFix )
|
||||
HB_TRACE( HB_TR_ALWAYS, "// RETURN " + cFun + cPostFix ) /* needed to refine the engine further */
|
||||
ELSE
|
||||
IF "..." $ cFun
|
||||
aadd( txt_, sp + cPrefix + "RETURN " + cFun + cPostFix )
|
||||
ELSE
|
||||
aadd( txt_, sp + "RETURN " + cFun + cPostFix )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN NIL
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -1234,10 +1280,30 @@ STATIC FUNCTION hbide_methodInfo( oMtd )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION hbide_paramCheckStr( cType, nArg )
|
||||
|
||||
SWITCH cType
|
||||
CASE "PO"
|
||||
CASE "P"
|
||||
CASE "X"
|
||||
RETURN "hb_isObject( hb_pvalue( " + hb_ntos( nArg ) + " ) )"
|
||||
CASE "PCO"
|
||||
RETURN "( hb_isObject( hb_pvalue( " + hb_ntos( nArg ) + " ) ) .OR. hb_isChar( hb_pvalue( " + hb_ntos( nArg ) + " ) ) )"
|
||||
CASE "N"
|
||||
RETURN "hb_isNumeric( hb_pvalue( " + hb_ntos( nArg ) + " ) )"
|
||||
CASE "L"
|
||||
RETURN "hb_isLogical( hb_pvalue( " + hb_ntos( nArg ) + " ) )"
|
||||
CASE "C"
|
||||
RETURN "hb_isChar( hb_pvalue( " + hb_ntos( nArg ) + " ) )"
|
||||
ENDSWITCH
|
||||
RETURN ""
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION TY_TYPES( oM, nArgs )
|
||||
LOCAL i, s := ""
|
||||
FOR i := 1 TO nArgs
|
||||
s += "aV[ " + hb_ntos( i ) + ' ] $ "' + oM:hArgs[ i ]:cTypeHB + '"' + " .AND. "
|
||||
s += hbide_paramCheckStr( oM:hArgs[ i ]:cTypeHB, i ) + " .AND. "
|
||||
NEXT
|
||||
IF " .AND. " $ s
|
||||
s := substr( s, 1, len( s ) - 7 )
|
||||
@@ -1262,7 +1328,7 @@ METHOD HbQtSource:buildDocument()
|
||||
|
||||
hb_HKeepOrder( hEntry, .T. )
|
||||
|
||||
n := ascan( ::cls_, {|e_| left( lower( e_[ 1 ] ), 7 ) == "inherit" .and. !empty( e_[ 2 ] ) } )
|
||||
n := ascan( ::cls_, {|e_| left( lower( e_[ 1 ] ), 7 ) $ "inherits" .and. !empty( e_[ 2 ] ) } )
|
||||
cInherits := iif( n > 0, ::cls_[ n, 2 ], "" )
|
||||
|
||||
cLib := FNameGetName( ::cProFile )
|
||||
@@ -1277,7 +1343,6 @@ METHOD HbQtSource:buildDocument()
|
||||
hEntry[ "SYNTAX" ] := ""
|
||||
hEntry[ "SYNTAX" ] += " " + ::cWidget + "( ... )" + hb_eol()
|
||||
hEntry[ "SYNTAX" ] += " " + ::cWidget + "():from( pPtr_OR_oObj_of_type_" + ::cWidget +" )" + hb_eol()
|
||||
hEntry[ "SYNTAX" ] += " " + ::cWidget + "():configure( pPtr_OR_oObj_of_type_" + ::cWidget +" )"
|
||||
hEntry[ "ARGUMENTS" ] := ""
|
||||
hEntry[ "RETURNS" ] := " " + "An instance of the object of type " + ::cWidget
|
||||
hEntry[ "METHODS" ] := ""
|
||||
@@ -1317,8 +1382,7 @@ METHOD HbQtSource:buildDocument()
|
||||
hEntry[ "FILES" ] += " " + "C++ wrappers : " + "contrib/hbqt" + iif( Empty( cLib ), "", "/" + cLib ) + "/" + ::cWidget + ".cpp" + hb_eol()
|
||||
hEntry[ "FILES" ] += " " + "Library : " + "hb" + cLib
|
||||
hEntry[ "SEEALSO" ] := ""
|
||||
* hEntry[ "SEEALSO" ] += " " + iif( Empty( cInherits ), "", cInherits + ", " ) + QT_WEB + QT_VER + "/" + lower( ::cWidget ) + ".html" + hb_eol()
|
||||
hEntry[ "SEEALSO" ] += " " + cInherits
|
||||
hEntry[ "SEEALSO" ] += " " + iif( empty( cInherits ), "", cInherits + "()" )
|
||||
|
||||
cFile := ::cPathDoc + hb_ps() + "en" + hb_ps() + "class_" + lower( ::cWidget ) + ".txt"
|
||||
|
||||
@@ -1622,6 +1686,19 @@ METHOD HbQtSource:parseProto( cProto, fBody_ )
|
||||
|
||||
oMtd:nArgsReal := oMtd:nArgs - oMtd:nArgsOpt
|
||||
|
||||
FOR EACH oArg IN oMtd:hArgs
|
||||
IF left( oArg:cCast, 1 ) == "Q" .OR. left( oArg:cCast, 3 ) == "HBQ"
|
||||
oMtd:nArgQCast := oArg:__enumIndex()
|
||||
EXIT
|
||||
ENDIF
|
||||
NEXT
|
||||
FOR EACH oArg IN oMtd:hArgs
|
||||
IF oArg:cTypeHB $ "PO"
|
||||
oMtd:nArgHBObj := oArg:__enumIndex()
|
||||
EXIT
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
IF right( oMtd:cParas, 2 ) == ", "
|
||||
oMtd:cParas := substr( oMtd:cParas, 1, len( oMtd:cParas ) - 2 )
|
||||
oMtd:cDocs := substr( oMtd:cDocs , 1, len( oMtd:cDocs ) - 2 )
|
||||
@@ -1820,6 +1897,8 @@ CLASS HbqtMethod
|
||||
|
||||
DATA aPre INIT {}
|
||||
DATA nHBIdx
|
||||
DATA nArgQCast INIT 0 // First argument position of type Q*Class
|
||||
DATA nArgHBObj INIT 0 // First argument position of type Q*Class
|
||||
|
||||
DATA oRet
|
||||
DATA nArgs INIT 0 // Number of arguments contained
|
||||
@@ -2094,9 +2173,7 @@ STATIC FUNCTION BuildCopyrightText( txt_, nMode, cProFile )
|
||||
aadd( txt_, " * Harbour Project source code:" )
|
||||
aadd( txt_, " * QT wrapper main header" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Copyright 2009-2010 Pritpal Bedi <pritpal@vouchcac.com>" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>" )
|
||||
aadd( txt_, " * Copyright 2009-2010 Pritpal Bedi <bedipritpal@hotmail.com>" )
|
||||
aadd( txt_, " * www - http://harbour-project.org" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * This program is free software; you can redistribute it and/or modify" )
|
||||
@@ -2140,6 +2217,40 @@ STATIC FUNCTION BuildCopyrightText( txt_, nMode, cProFile )
|
||||
aadd( txt_, " *" )
|
||||
aadd( txt_, " */" )
|
||||
aadd( txt_, "/*----------------------------------------------------------------------*/" )
|
||||
aadd( txt_, "/* C R E D I T S */" )
|
||||
aadd( txt_, "/*----------------------------------------------------------------------*/" )
|
||||
aadd( txt_, "/* " )
|
||||
aadd( txt_, " * Marcos Antonio Gambeta" )
|
||||
aadd( txt_, " * for providing first ever prototype parsing methods. Though the current" )
|
||||
aadd( txt_, " * implementation is diametrically different then what he proposed, still" )
|
||||
aadd( txt_, " * current code shaped on those footsteps." )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Viktor Szakats" )
|
||||
aadd( txt_, " * for directing the project with futuristic vision; " )
|
||||
aadd( txt_, " * for designing and maintaining a complex build system for hbQT, hbIDE;" )
|
||||
aadd( txt_, " * for introducing many constructs on PRG and C++ levels;" )
|
||||
aadd( txt_, " * for streamlining signal/slots and events management classes;" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Istvan Bisz" )
|
||||
aadd( txt_, " * for introducing QPointer<> concept in the generator;" )
|
||||
aadd( txt_, " * for testing the library on numerous accounts;" )
|
||||
aadd( txt_, " * for showing a way how a GC pointer can be detached;" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Francesco Perillo" )
|
||||
aadd( txt_, " * for taking keen interest in hbQT development and peeking the code;" )
|
||||
aadd( txt_, " * for providing tips here and there to improve the code quality;" )
|
||||
aadd( txt_, " * for hitting bulls eye to describe why few objects need GC detachment;" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Carlos Bacco" )
|
||||
aadd( txt_, " * for implementing HBQT_TYPE_Q*Class enums;" )
|
||||
aadd( txt_, " * for peeking into the code and suggesting optimization points;" )
|
||||
aadd( txt_, " * " )
|
||||
aadd( txt_, " * Przemyslaw Czerpak" )
|
||||
aadd( txt_, " * for providing tips and trick to manipulate HVM internals to the best" )
|
||||
aadd( txt_, " * of its use and always showing a path when we get stuck;" )
|
||||
aadd( txt_, " * A true tradition of a MASTER..." )
|
||||
aadd( txt_, "*/ " )
|
||||
aadd( txt_, "/*----------------------------------------------------------------------*/" )
|
||||
aadd( txt_, "" )
|
||||
IF nMode == 0
|
||||
IF !( FNameGetName( cProFile ) == "qtcore" )
|
||||
@@ -2202,7 +2313,7 @@ STATIC FUNCTION DispLogo()
|
||||
|
||||
cHlp += "" + hb_eol()
|
||||
cHlp += "Harbour Source Generator for QT " + HBRawVersion() + hb_eol()
|
||||
cHlp += "Copyright (c) 2009, Pritpal Bedi <pritpal@vouchcac.com>" + hb_eol()
|
||||
cHlp += "Copyright (c) 2009, Pritpal Bedi <bedipritpal@hotmail.com>" + hb_eol()
|
||||
cHlp += "http://harbour-project.org/" + hb_eol()
|
||||
cHlp += "" + hb_eol()
|
||||
|
||||
|
||||
@@ -218,16 +218,16 @@ METHOD HbpProcess:start( cShellCmd )
|
||||
|
||||
IF ::lDetached
|
||||
IF !empty( ::qStrList )
|
||||
::qProcess:startDetached_1( ::cShellCmd, ::qStrList )
|
||||
::qProcess:startDetached( ::cShellCmd, ::qStrList )
|
||||
ELSE
|
||||
::qProcess:startDetached_2( ::cShellCmd )
|
||||
::qProcess:startDetached( ::cShellCmd )
|
||||
ENDIF
|
||||
::qProcess:waitForStarted()
|
||||
ELSE
|
||||
IF !empty( ::qStrList )
|
||||
::qProcess:start( ::cShellCmd, ::qStrList )
|
||||
ELSE
|
||||
::qProcess:start_1( ::cShellCmd )
|
||||
::qProcess:start( ::cShellCmd )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -141,8 +141,7 @@ METHOD Xbp3State:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, l
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QCheckBox()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := QCheckBox():from( pQtObject )
|
||||
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -171,10 +171,9 @@ STATIC FUNCTION hbqt_QTranslateKeyKP( kbm, key, shiftkey, altkey, controlkey, ;
|
||||
|
||||
FUNCTION XbpQKeyEventToAppEvent( pEvent )
|
||||
LOCAL c := 0
|
||||
LOCAL key, kbm, txt, x
|
||||
LOCAL oKeyEvent := QKeyEvent()
|
||||
LOCAL key, kbm, txt, x, oKeyEvent
|
||||
|
||||
oKeyEvent:pPtr := pEvent
|
||||
oKeyEvent := QKeyEvent():from( pEvent )
|
||||
|
||||
key := oKeyEvent:key()
|
||||
kbm := oKeyEvent:modifiers()
|
||||
|
||||
@@ -157,7 +157,7 @@ METHOD XbpBitmap:loadFile( cImageFileName )
|
||||
|
||||
::cImageFileName := cImageFileName
|
||||
|
||||
lSuccess := ::oWidget:load( cImageFileName, 0, Qt_AutoColor )
|
||||
lSuccess := ::oWidget:load( cImageFileName )
|
||||
|
||||
RETURN lSuccess
|
||||
|
||||
|
||||
@@ -491,33 +491,33 @@ METHOD XbpBrowse:destroy()
|
||||
NEXT
|
||||
|
||||
IF !empty( ::oModelIndex )
|
||||
::oModelIndex:pPtr := 0
|
||||
::oModelIndex := NIL
|
||||
ENDIF
|
||||
|
||||
::oHScrollBar:pPtr := 0
|
||||
::oVScrollBar:pPtr := 0
|
||||
::oHScrollBar := NIL
|
||||
::oVScrollBar := NIL
|
||||
|
||||
::oLeftView:pPtr := 0
|
||||
::oLeftDbfModel:pPtr := 0
|
||||
::oLeftVHeaderView:pPtr := 0
|
||||
::oLeftHeaderView:pPtr := 0
|
||||
::oLeftFooterView:pPtr := 0
|
||||
::oLeftFooterModel:pPtr := 0
|
||||
::oLeftView := NIL
|
||||
::oLeftDbfModel := NIL
|
||||
::oLeftVHeaderView := NIL
|
||||
::oLeftHeaderView := NIL
|
||||
::oLeftFooterView := NIL
|
||||
::oLeftFooterModel := NIL
|
||||
|
||||
::oRightView:pPtr := 0
|
||||
::oRightHeaderView:pPtr := 0
|
||||
::oRightDbfModel:pPtr := 0
|
||||
::oRightFooterView:pPtr := 0
|
||||
::oRightFooterModel:pPtr := 0
|
||||
::oRightView := NIL
|
||||
::oRightHeaderView := NIL
|
||||
::oRightDbfModel := NIL
|
||||
::oRightFooterView := NIL
|
||||
::oRightFooterModel := NIL
|
||||
|
||||
::oTableView:pPtr := 0
|
||||
::oVHeaderView:pPtr := 0
|
||||
::oDbfModel:pPtr := 0
|
||||
::oTableView := NIL
|
||||
::oVHeaderView := NIL
|
||||
::oDbfModel := NIL
|
||||
|
||||
::oFooterView:pPtr := 0
|
||||
::oFooterModel:pPtr := 0
|
||||
::oFooterView := NIL
|
||||
::oFooterModel := NIL
|
||||
|
||||
::oGridLayout:pPtr := 0
|
||||
::oGridLayout := NIL
|
||||
|
||||
::oGridLayout := NIL
|
||||
::oFooterModel := NIL
|
||||
@@ -572,12 +572,10 @@ METHOD XbpBrowse:buildLeftFreeze()
|
||||
::oLeftView:setSelectionBehavior( iif( ::cursorMode == XBPBRW_CURSOR_ROW, QAbstractItemView_SelectRows, QAbstractItemView_SelectItems ) )
|
||||
//
|
||||
/* Veritical Header because of Performance boost */
|
||||
::oLeftVHeaderView := QHeaderView()
|
||||
::oLeftVHeaderView:configure( ::oLeftView:verticalHeader() )
|
||||
::oLeftVHeaderView := ::oLeftView:verticalHeader()
|
||||
::oLeftVHeaderView:hide()
|
||||
/* Horizontal Header Fine Tuning */
|
||||
::oLeftHeaderView := QHeaderView()
|
||||
::oLeftHeaderView:configure( ::oLeftView:horizontalHeader() )
|
||||
::oLeftHeaderView := ::oLeftView:horizontalHeader()
|
||||
::oLeftHeaderView:setHighlightSections( .F. )
|
||||
|
||||
::oLeftDbfModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 151, t, role, x, y ) } )
|
||||
@@ -624,12 +622,10 @@ METHOD XbpBrowse:buildRightFreeze()
|
||||
::oRightView:setSelectionBehavior( iif( ::cursorMode == XBPBRW_CURSOR_ROW, QAbstractItemView_SelectRows, QAbstractItemView_SelectItems ) )
|
||||
//
|
||||
/* Veritical Header because of Performance boost */
|
||||
oVHdr := QHeaderView()
|
||||
oVHdr:configure( ::oRightView:verticalHeader() )
|
||||
oVHdr := ::oRightView:verticalHeader()
|
||||
oVHdr:hide()
|
||||
/* Horizontal Header Fine Tuning */
|
||||
::oRightHeaderView := QHeaderView()
|
||||
::oRightHeaderView:configure( ::oRightView:horizontalHeader() )
|
||||
::oRightHeaderView := ::oRightView:horizontalHeader()
|
||||
::oRightHeaderView:setHighlightSections( .F. )
|
||||
|
||||
::oRightDbfModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 161, t, role, x, y ) } )
|
||||
@@ -705,13 +701,11 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::oVScrollBar:connect( "sliderReleased()" , {|i| ::execSlot( __ev_vertscroll_sliderreleased__, i ) } )
|
||||
|
||||
/* Veritical Header because of Performance boost */
|
||||
::oVHeaderView := QHeaderView()
|
||||
::oVHeaderView:configure( ::oTableView:verticalHeader() )
|
||||
::oVHeaderView := ::oTableView:verticalHeader()
|
||||
::oVHeaderView:hide()
|
||||
|
||||
/* Horizontal Header Fine Tuning */
|
||||
::oHeaderView := QHeaderView()
|
||||
::oHeaderView:configure( ::oTableView:horizontalHeader() )
|
||||
::oHeaderView := ::oTableView:horizontalHeader()
|
||||
::oHeaderView:setHighlightSections( .F. )
|
||||
//
|
||||
::oHeaderView:connect( "sectionPressed(int)" , {|i | ::execSlot( __ev_columnheader_pressed__, i ) } )
|
||||
@@ -744,25 +738,11 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::buildRightFreeze()
|
||||
|
||||
/* Place all widgets in a Grid Layout */
|
||||
::oGridLayout := QGridLayout( ::pWidget )
|
||||
::oGridLayout := QGridLayout( ::oWidget )
|
||||
::oGridLayout:setContentsMargins( 0,0,0,0 )
|
||||
::oGridLayout:setHorizontalSpacing( 0 )
|
||||
::oGridLayout:setVerticalSpacing( 0 )
|
||||
/* Rows */
|
||||
#if 0
|
||||
::oGridLayout:addWidget_1( ::oLeftView , 0, 0, 1, 1 )
|
||||
::oGridLayout:addWidget_1( ::oLeftFooterView , 1, 0, 1, 1 )
|
||||
//
|
||||
::oGridLayout:addWidget_1( ::oTableView , 0, 1, 1, 1 )
|
||||
::oGridLayout:addWidget_1( ::oFooterView , 1, 1, 1, 1 )
|
||||
//
|
||||
::oGridLayout:addWidget_1( ::oRightView , 0, 2, 1, 1 )
|
||||
::oGridLayout:addWidget_1( ::oRightFooterView, 1, 2, 1, 1 )
|
||||
//
|
||||
::oGridLayout:addWidget_1( ::oHScrollBar , 2, 0, 1, 3 )
|
||||
/* Columns */
|
||||
::oGridLayout:addWidget_1( ::oVScrollBar , 0, 3, 2, 1 )
|
||||
#else
|
||||
::oGridLayout:addWidget( ::oLeftView , 0, 0, 1, 1 )
|
||||
::oGridLayout:addWidget( ::oLeftFooterView , 1, 0, 1, 1 )
|
||||
//
|
||||
@@ -775,7 +755,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::oGridLayout:addWidget( ::oHScrollBar , 2, 0, 1, 3 )
|
||||
/* Columns */
|
||||
::oGridLayout:addWidget( ::oVScrollBar , 0, 3, 2, 1 )
|
||||
#endif
|
||||
|
||||
IF ::visible
|
||||
::show()
|
||||
ENDIF
|
||||
@@ -784,11 +764,11 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::oFooterView:hide()
|
||||
|
||||
/* Viewport */
|
||||
::oViewport:configure( ::oTableView:viewport() )
|
||||
::oViewport := ::oTableView:viewport()
|
||||
|
||||
::oWidget:connect( QEvent_Resize, {|| ::execSlot( __ev_frame_resized__ ) } )
|
||||
|
||||
qRect := QRect():from( ::oWidget:geometry() )
|
||||
qRect := ::oWidget:geometry()
|
||||
::oWidget:setGeometry( qRect )
|
||||
|
||||
/* Handle the delegate */
|
||||
@@ -817,7 +797,7 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 )
|
||||
|
||||
DO CASE
|
||||
CASE nEvent == __ev_contextMenuRequested__
|
||||
oPoint := QPoint():from( ::oTableView:mapToGlobal( p1 ) )
|
||||
oPoint := ::oTableView:mapToGlobal( p1 )
|
||||
::hbContextMenu( { oPoint:x(), oPoint:y() } )
|
||||
|
||||
CASE nEvent == __editor_commitData__
|
||||
@@ -868,10 +848,11 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 )
|
||||
::oTableView:setFocus()
|
||||
|
||||
CASE nEvent == __ev_mousepress__
|
||||
oMouseEvent := QMouseEvent():configure( p1 )
|
||||
oMouseEvent := QMouseEvent():from( p1 )
|
||||
|
||||
oPoint := QPoint( oMouseEvent:x(), oMouseEvent:y() )
|
||||
::oModelIndex:configure( ::oTableView:indexAt( oPoint ) )
|
||||
// ::oModelIndex:configure( ::oTableView:indexAt( oPoint ) )
|
||||
::oModelIndex := ::oTableView:indexAt( oPoint )
|
||||
IF ::oModelIndex:isValid() /* Reposition the record pointer */
|
||||
SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, ( ::oModelIndex:row() + 1 ) - ::rowPos, Self )
|
||||
|
||||
@@ -887,13 +868,13 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 )
|
||||
ENDIF
|
||||
|
||||
CASE nEvent == __ev_xbpBrw_itemSelected__
|
||||
oMouseEvent := QMouseEvent():configure( p1 )
|
||||
oMouseEvent := QMouseEvent():from( p1 )
|
||||
IF oMouseEvent:button() == Qt_LeftButton
|
||||
SetAppEvent( xbeBRW_ItemSelected, NIL, NIL, Self )
|
||||
ENDIF
|
||||
|
||||
CASE nEvent == __ev_wheel__
|
||||
oWheelEvent := QWheelEvent():configure( p1 )
|
||||
oWheelEvent := QWheelEvent():from( p1 )
|
||||
IF oWheelEvent:orientation() == Qt_Vertical
|
||||
IF oWheelEvent:delta() > 0
|
||||
SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, -1, Self )
|
||||
|
||||
@@ -132,9 +132,7 @@ METHOD XbpCheckBox:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QCheckBox()
|
||||
::oWidget:pPtr := pQtObject
|
||||
|
||||
::oWidget := QCheckBox():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -167,7 +167,7 @@ METHOD XbpClipBoard:open()
|
||||
METHOD XbpClipBoard:queryFormats()
|
||||
LOCAL aFormats := {}
|
||||
LOCAL cText := ::oWidget:text()
|
||||
LOCAL qImage := QImage():from( ::oWidget:image() )
|
||||
LOCAL qImage := ::oWidget:image()
|
||||
|
||||
IF !empty( cText )
|
||||
aadd( aFormats, XBPCLPBRD_TEXT )
|
||||
|
||||
@@ -140,10 +140,9 @@ METHOD XbpComboBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
::oWidget := QComboBox( ::pParent )
|
||||
|
||||
::oWidget:setModel( QAbstractItemModel():from( ::xbpListBox:model() ) )
|
||||
::oWidget:setModel( ::xbpListBox:model() )
|
||||
::oWidget:setView( ::xbpListBox:oWidget )
|
||||
::oWidget:setLineEdit( ::xbpSLE:oWidget )
|
||||
//::oWidget:setLineEdit( ::XbpSLE:oWidget:pPtr )
|
||||
::oWidget:setEditable( ::xbpSLE:editable )
|
||||
::oWidget:setFrame( ::xbpSLE:border )
|
||||
|
||||
@@ -166,15 +165,13 @@ METHOD XbpComboBox:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QComboBox()
|
||||
::oWidget:pPtr := pQtObject
|
||||
|
||||
::oWidget := QComboBox():from( pQtObject )
|
||||
ELSE
|
||||
::oSLE := XbpSLE():new():create( ::oParent, ::oOwner, ::aPos, ::aSize, ::aPresParams, ::lVisible )
|
||||
::oLB := XbpListBox():new():create( ::oParent, ::oOwner, ::aPos, ::aSize, ::aPresParams, ::lVisible )
|
||||
|
||||
::oWidget := QComboBox( ::pParent )
|
||||
::oWidget:setModel( QAbstractItemModel():from( ::xbpListBox:model() ) )
|
||||
::oWidget:setModel(::xbpListBox:model() )
|
||||
::oWidget:setView( ::xbpListBox:oWidget )
|
||||
::oWidget:setLineEdit( ::xbpSLE:oWidget )
|
||||
::oWidget:setEditable( ::xbpSLE:editable )
|
||||
|
||||
@@ -208,7 +208,7 @@ METHOD XbpDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
ENDIF
|
||||
|
||||
/* Install Event Loop per Dialog Basis */
|
||||
::oEventLoop := QEventLoop( ::pWidget )
|
||||
::oEventLoop := QEventLoop( ::oWidget )
|
||||
hbxbp_SetEventLoop( ::oEventLoop )
|
||||
|
||||
/* Instal Event Filter */
|
||||
@@ -244,7 +244,7 @@ METHOD XbpDialog:destroy()
|
||||
|
||||
hbxbp_SetEventLoop( NIL )
|
||||
::oEventLoop:exit( 0 )
|
||||
::oEventLoop:pPtr := NIL
|
||||
::oEventLoop := NIL
|
||||
::oMenu := NIL
|
||||
|
||||
IF ::isViaQtObject
|
||||
|
||||
@@ -276,7 +276,7 @@ METHOD XbpFileDialog:extractFileNames( lAllowMultiple )
|
||||
|
||||
DEFAULT lAllowMultiple TO .F.
|
||||
|
||||
oFiles := QStringList():configure( ::oWidget:selectedFiles() )
|
||||
oFiles := ::oWidget:selectedFiles()
|
||||
FOR i := 1 TO oFiles:size()
|
||||
aadd( f_, oFiles:at( i-1 ) )
|
||||
NEXT
|
||||
|
||||
@@ -319,7 +319,7 @@ METHOD XbpFontDialog:XbpFontObject()
|
||||
LOCAL oXbp
|
||||
|
||||
::oFont := QFont()
|
||||
::oFont:pPtr := ::oWidget:currentFont()
|
||||
::oFont := ::oWidget:currentFont()
|
||||
|
||||
oXbp := XbpFont():new()
|
||||
|
||||
@@ -496,8 +496,8 @@ METHOD XbpFont:configure( cFontName )
|
||||
|
||||
METHOD XbpFont:destroy()
|
||||
|
||||
::oFontInfo:pPtr := NIL
|
||||
::oWidget:pPtr := 0
|
||||
::oFontInfo := NIL
|
||||
::oWidget := NIL
|
||||
|
||||
RETURN NIL
|
||||
|
||||
@@ -505,8 +505,8 @@ METHOD XbpFont:destroy()
|
||||
|
||||
METHOD XbpFont:_destroy()
|
||||
|
||||
::oFontInfo:pPtr := NIL
|
||||
::oWidget:pPtr := 0
|
||||
::oFontInfo := NIL
|
||||
::oWidget := NIL
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
@@ -187,8 +187,7 @@ METHOD XbpHTMLViewer:destroy()
|
||||
::oWidget:stop()
|
||||
::disconnect()
|
||||
IF !empty( ::oURL )
|
||||
::oURL:pPtr := NIL
|
||||
::oURL := NIL
|
||||
::oURL := NIL
|
||||
ENDIF
|
||||
::sl_beforeNavigate := NIL
|
||||
::sl_navigateComplete := NIL
|
||||
|
||||
@@ -234,8 +234,7 @@ METHOD XbpListBox:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QListView()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := pQtObject
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
@@ -328,25 +327,12 @@ METHOD XbpListBox:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
|
||||
METHOD XbpListBox:destroy()
|
||||
|
||||
::clear()
|
||||
|
||||
::xbpWindow:destroy()
|
||||
|
||||
RETURN NIL
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpListBox:addItem( cItem )
|
||||
LOCAL qItm := QListWidgetItem()
|
||||
|
||||
qItm:setText( cItem )
|
||||
//::oWidget:addItem_1( qItm )
|
||||
::oWidget:addItem( qItm )
|
||||
aadd( ::aItems, qItm )
|
||||
|
||||
RETURN len( ::aItems )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpListBox:clear()
|
||||
LOCAL qItm
|
||||
|
||||
@@ -356,14 +342,26 @@ METHOD XbpListBox:clear()
|
||||
qItm := NIL
|
||||
NEXT
|
||||
::aItems := {}
|
||||
::oWidget:clear()
|
||||
|
||||
IF ::oWidget:isValidObject()
|
||||
::oWidget:clear()
|
||||
ENDIF
|
||||
::connectAll()
|
||||
|
||||
RETURN .t.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpListBox:addItem( cItem )
|
||||
LOCAL qItm := QListWidgetItem()
|
||||
|
||||
qItm:setText( cItem )
|
||||
::oWidget:addItem( qItm )
|
||||
aadd( ::aItems, qItm )
|
||||
|
||||
RETURN len( ::aItems )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpListBox:delItem( nIndex )
|
||||
|
||||
IF hb_isNumeric( nIndex ) .AND. nIndex > 0 .AND. nIndex <= len( ::aItems )
|
||||
|
||||
@@ -201,7 +201,7 @@ METHOD xbpMenuBar:hbCreateFromQtPtr( oParent, aPresParams, lVisible, pQtObject )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QMenuBar()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget:pPtr := hbqt_ptr( pQtObject )
|
||||
|
||||
ENDIF
|
||||
|
||||
@@ -254,7 +254,6 @@ METHOD xbpMenuBar:delItem( aItem )
|
||||
::disConnect( aItem[ 5 ], "hovered()" )
|
||||
ENDIF
|
||||
::oWidget:removeAction( aItem[ 5 ] )
|
||||
aItem[ 5 ]:pPtr := NIL
|
||||
aItem[ 5 ] := NIL
|
||||
ENDIF
|
||||
|
||||
@@ -279,9 +278,9 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos )
|
||||
DO CASE
|
||||
CASE cType == "U" .OR. empty( xCaption ) .OR. nStyle == XBPMENUBAR_MIS_SEPARATOR
|
||||
IF lInsert
|
||||
oAction := QAction():configure( ::oWidget:insertSeparator() )
|
||||
oAction := ::oWidget:insertSeparator()
|
||||
ELSE
|
||||
QAction():configure( ::oWidget:addSeparator() )
|
||||
::oWidget:addSeparator()
|
||||
ENDIF
|
||||
aItem := { QMF_SEPARATOR, 0, 0, NIL, oAction }
|
||||
|
||||
|
||||
@@ -191,9 +191,7 @@ METHOD XbpMLE:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVis
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QPlainTextEdit()
|
||||
::oWidget:pPtr := pQtObject
|
||||
|
||||
::oWidget := QPlainTextEdit():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
@@ -221,7 +219,7 @@ METHOD XbpMLE:clear()
|
||||
METHOD XbpMLE:copyMarked()
|
||||
LOCAL qCursor, cText
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
cText := qCursor:selectedText()
|
||||
|
||||
::oWidget:copy()
|
||||
@@ -233,7 +231,7 @@ METHOD XbpMLE:copyMarked()
|
||||
METHOD XbpMLE:cutMarked()
|
||||
LOCAL qCursor, cText
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
cText := qCursor:selectedText()
|
||||
|
||||
::oWidget:cut()
|
||||
@@ -245,7 +243,7 @@ METHOD XbpMLE:cutMarked()
|
||||
METHOD XbpMLE:deleteMarked()
|
||||
LOCAL qCursor, cText
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
cText := qCursor:selectedText()
|
||||
qCursor:removeSelectedText()
|
||||
::oWidget:setTextCursor( qCursor )
|
||||
@@ -257,7 +255,7 @@ METHOD XbpMLE:deleteMarked()
|
||||
METHOD XbpMLE:delete( nPos, nChars )
|
||||
LOCAL qCursor, cText
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
qCursor:setPosition( nPos )
|
||||
qCursor:movePosition( QTextCursor_Right, QTextCursor_KeepAnchor, nChars )
|
||||
cText := qCursor:selectedText()
|
||||
@@ -287,7 +285,7 @@ METHOD XbpMLE:queryFirstChar()
|
||||
METHOD XbpMLE:queryMarked()
|
||||
LOCAL qCursor, a_
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
IF qCursor:hasSelection()
|
||||
a_:= { qCursor:selectionStart(), qCursor:selectionEnd() }
|
||||
ELSE
|
||||
@@ -310,7 +308,7 @@ METHOD XbpMLE:setMarked( aStartEnd )
|
||||
LOCAL qCursor, cText
|
||||
|
||||
IF hb_isArray( aStartEnd ) .AND. len( aStartEnd ) == 2 .AND. aStartEnd[ 1 ] >= 0 .AND. aStartEnd[ 2 ] > aStartEnd[ 1 ]
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
qCursor:setPosition( aStartEnd[ 1 ] )
|
||||
qCursor:movePosition( QTextCursor_Right, QTextCursor_KeepAnchor, aStartEnd[ 2 ] - aStartEnd[ 1 ] )
|
||||
cText := qCursor:selectedText()
|
||||
@@ -328,7 +326,7 @@ METHOD XbpMLE:insert( nPos, cString )
|
||||
LOCAL qCursor
|
||||
|
||||
IF hb_isChar( cString )
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
IF hb_isNumeric( nPos ) .AND. nPos >= 0
|
||||
qCursor:setPosition( nPos )
|
||||
ENDIF
|
||||
@@ -344,7 +342,7 @@ METHOD XbpMLE:insert( nPos, cString )
|
||||
METHOD XbpMLE:charFromLine( nLine )
|
||||
LOCAL qCursor, nPos
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
IF hb_isNumeric( nLine )
|
||||
qCursor:movePosition( QTextCursor_Start )
|
||||
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, nLine )
|
||||
@@ -361,7 +359,7 @@ METHOD XbpMLE:charFromLine( nLine )
|
||||
METHOD XbpMLE:lineFromChar( nPos )
|
||||
LOCAL qCursor, nLine
|
||||
|
||||
qCursor := QTextCursor():from( ::oWidget:textCursor() )
|
||||
qCursor := ::oWidget:textCursor()
|
||||
IF hb_isNumeric( nPos )
|
||||
qCursor:setPosition( nPos )
|
||||
nLine := qCursor:blockNumber()
|
||||
@@ -374,7 +372,7 @@ METHOD XbpMLE:lineFromChar( nPos )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpMLE:pos()
|
||||
RETURN QTextCursor():from( ::oWidget:textCursor() ):position()
|
||||
RETURN ::oWidget:textCursor():position()
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -125,7 +125,6 @@ METHOD XbpPrintDialog:destroy()
|
||||
::aConnections := {}
|
||||
ENDIF
|
||||
|
||||
::oWidget:pPtr := NIL
|
||||
::oWidget := NIL
|
||||
|
||||
RETURN nil
|
||||
@@ -167,9 +166,10 @@ METHOD XbpPrintDialog:display( oXbpPrinter )
|
||||
oXbpPrinter := XbpPrinter():new()
|
||||
oXbpPrinter:oWidget := QPrinter()
|
||||
ENDIF
|
||||
oXbpPrinter:oWidget:pPtr := ::pPrinter
|
||||
// oXbpPrinter:oWidget:pPtr := ::pPrinter
|
||||
oXbpPrinter:oWidget := QPrinter( ::pPrinter )
|
||||
oXbpPrinter:oPrintEngine := QPrintEngine()
|
||||
oXbpPrinter:oPrintEngine:pPtr := oXbpPrinter:oWidget:printEngine()
|
||||
oXbpPrinter:oPrintEngine := oXbpPrinter:oWidget:printEngine()
|
||||
|
||||
oXbpPrinter:setDevName( oXbpPrinter:oWidget:printerName() )
|
||||
|
||||
|
||||
@@ -146,8 +146,7 @@ METHOD XbpPushButton:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParam
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QPushButton()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := QPushButton():from( pQtObject )
|
||||
|
||||
ELSE
|
||||
::oWidget := QPushButton( ::oParent:oWidget )
|
||||
|
||||
@@ -132,8 +132,7 @@ METHOD XbpRadioButton:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresPara
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QRadioButton()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := QRadioButton():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -185,9 +185,9 @@ METHOD XbpRtf:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
ENDIF
|
||||
::oParent:AddChild( SELF )
|
||||
|
||||
::oTextDocument:pPtr := ::oWidget:document()
|
||||
::oTextCursor:pPtr := ::oWidget:textCursor()
|
||||
::oTextCharFormat:pPtr := ::oTextCursor:charFormat()
|
||||
::oTextDocument := ::oWidget:document()
|
||||
::oTextCursor := ::oWidget:textCursor()
|
||||
::oTextCharFormat := ::oTextCursor:charFormat()
|
||||
|
||||
::postCreate()
|
||||
RETURN Self
|
||||
@@ -200,7 +200,7 @@ METHOD XbpRtf:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVis
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QTextEdit()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := pQtObject
|
||||
|
||||
ENDIF
|
||||
|
||||
@@ -217,7 +217,7 @@ METHOD XbpRtf:execSlot( cSlot, p )
|
||||
CASE cSlot == "currentCharFormatChanged(QTextCharFormat)"
|
||||
|
||||
CASE cSlot == "cursorPositionChanged()"
|
||||
::oTextCursor:configure( ::oWidget:textCursor() )
|
||||
::oTextCursor := ::oWidget:textCursor()
|
||||
::oCurCursor := ::oTextCursor
|
||||
CASE cSlot == "redoAvailable(bool)"
|
||||
CASE cSlot == "undoAvailable(bool)"
|
||||
@@ -225,7 +225,7 @@ METHOD XbpRtf:execSlot( cSlot, p )
|
||||
::changed := .t. /* .f. only at save */
|
||||
::change()
|
||||
CASE cSlot == "selectionChanged()" /* Xbase++ Implements */
|
||||
::oTextCursor:configure( ::oWidget:textCursor() )
|
||||
::oTextCursor := ::oWidget:textCursor()
|
||||
::oCurCursor := ::oTextCursor
|
||||
::selChange()
|
||||
ENDCASE
|
||||
@@ -305,8 +305,8 @@ METHOD XbpRtf:find( cSearchString, nStart, nEnd, nOptions )
|
||||
HB_SYMBOL_UNUSED( nOptions )
|
||||
|
||||
IF hb_isChar( cSearchString )
|
||||
::oTextDocument:pPtr := ::oWidget:document()
|
||||
::oTextCursor:pPtr := ::oTextDocument:find_2( cSearchString )
|
||||
::oTextDocument := ::oWidget:document()
|
||||
::oTextCursor := ::oTextDocument:find( cSearchString )
|
||||
::oCurCursor := ::oTextCursor
|
||||
nPos := ::oTextCursor:position()
|
||||
ENDIF
|
||||
@@ -426,7 +426,7 @@ METHOD XbpRtf:selAlignment( ... ) // XBPRTF_ALIGN_LEFT
|
||||
LOCAL oTBFormat
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isNumeric( aP[ 1 ] )
|
||||
oTBFormat := QTextBlockFormat():configure( ::oCurCursor:blockFormat() )
|
||||
oTBFormat := ::oCurCursor:blockFormat()
|
||||
xRet := oTBFormat:alignment()
|
||||
oTBFormat:setAlignment( hbxbp_ConvertAFactFromXBP( "RTFSELALIGNMENT", aP[ 1 ] ) )
|
||||
::oCurCursor:setBlockFormat( oTBFormat )
|
||||
@@ -440,7 +440,7 @@ METHOD XbpRtf:selBold( ... ) // .F.
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isLogical( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
::oTextCharFormat:setFontWeight( QFont_Bold )
|
||||
::oCurCursor:setCharFormat( ::oTextCharFormat )
|
||||
@@ -468,7 +468,7 @@ METHOD XbpRtf:selCharOffset( ... ) // 0
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isNumeric( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
nAlign := IF( aP[ 1 ] < 0, -1, IF( aP[ 1 ] > 0, 1, 0 ) )
|
||||
xRet := ::oTextCharFormat:verticalAlignment()
|
||||
@@ -485,8 +485,8 @@ METHOD XbpRtf:selColor( ... )
|
||||
LOCAL oBrush, nColor, oColor
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isNumeric( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
IF len( aP ) >= 1 .AND. hb_isNumeric( aP[ 1 ] )
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
xRet := ::oTextCharFormat:foreground()
|
||||
nColor := hbxbp_ConvertAFactFromXBP( "COLOR", aP[ 1 ] )
|
||||
@@ -506,7 +506,7 @@ METHOD XbpRtf:selFont( ... ) // ""
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isObject( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
::oTextCharFormat:setFont( aP[ 1 ]:oWidget )
|
||||
::oCurCursor:setCharFormat( ::oTextCharFormat )
|
||||
@@ -521,7 +521,7 @@ METHOD XbpRtf:selFontName( ... ) // ""
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isChar( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
xRet := ::oTextCharFormat:fontFamily()
|
||||
::oTextCharFormat:setFontFamily( aP[ 1 ] )
|
||||
@@ -536,7 +536,7 @@ METHOD XbpRtf:selFontSize( ... ) // 0
|
||||
LOCAL xRet := 0
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
xRet := ::oTextCharFormat:fontPointSize()
|
||||
IF len( aP ) >= 1 .and. hb_isNumeric( aP[ 1 ] )
|
||||
@@ -575,7 +575,7 @@ METHOD XbpRtf:selItalic( ... ) // .F.
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isLogical( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
::oTextCharFormat:setFontItalic( aP[ 1 ] )
|
||||
::oCurCursor:setCharFormat( ::oTextCharFormat )
|
||||
@@ -612,7 +612,7 @@ METHOD XbpRtf:selStart( ... ) // 0
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isNumeric( aP[ 1 ] )
|
||||
::oTextCursor:pPtr := ::oWidget:textCursor()
|
||||
::oTextCursor := ::oWidget:textCursor()
|
||||
::oCurCursor := ::oTextCursor
|
||||
xRet := ::oCurCursor:position()
|
||||
::oCurCursor:setPosition( aP[ 1 ] )
|
||||
@@ -626,7 +626,7 @@ METHOD XbpRtf:selStrikeThru( ... ) // .F.
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isLogical( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
::oTextCharFormat:setFontStrikeOut( aP[ 1 ] )
|
||||
::oCurCursor:setCharFormat( ::oTextCharFormat )
|
||||
@@ -678,7 +678,7 @@ METHOD XbpRtf:selUnderline( ... ) // .F.
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF len( aP ) >= 1 .and. hb_isLogical( aP[ 1 ] )
|
||||
::oTextCharFormat:pPtr := ::oCurCursor:charFormat()
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
::oTextCharFormat:setFontUnderline( aP[ 1 ] )
|
||||
::oCurCursor:setCharFormat( ::oTextCharFormat )
|
||||
@@ -727,9 +727,6 @@ METHOD XbpRtf:insertText( cText )
|
||||
|
||||
METHOD XbpRtf:insertImage( cImageFilename )
|
||||
|
||||
//::oTextCursor:configure( ::oWidget:textCursor() )
|
||||
//::oCurCursor := ::oTextCursor
|
||||
|
||||
::oCurCursor:insertImage( cImageFilename )
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -137,9 +137,7 @@ METHOD XbpScrollBar:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QScrollBar()
|
||||
::oWidget:pPtr := pQtObject
|
||||
|
||||
::oWidget := QScrollBar():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -132,8 +132,7 @@ METHOD XbpSLE:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVis
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QLineEdit()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := QLineEdit():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -173,8 +173,7 @@ METHOD XbpSpinButton:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParam
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QSpinBox()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := QSpinBox():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -253,65 +253,62 @@ METHOD XbpStatic:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, l
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
DO CASE
|
||||
CASE ::type == XBPSTATIC_TYPE_TEXT
|
||||
::oWidget := QLabel()
|
||||
DO CASE
|
||||
CASE ::type == XBPSTATIC_TYPE_TEXT
|
||||
::oWidget := QLabel():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_GROUPBOX
|
||||
::oWidget := QGroupBox()
|
||||
CASE ::type == XBPSTATIC_TYPE_GROUPBOX
|
||||
::oWidget := QGroupBox():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_RAISEDBOX
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_RAISEDBOX
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_RECESSEDBOX
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_RECESSEDBOX
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_RAISEDRECT
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_RAISEDRECT
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_RECESSEDRECT
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_RECESSEDRECT
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_FGNDFRAME // rectangle in foreground color, not filled
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_FGNDFRAME // rectangle in foreground color, not filled
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_BGNDFRAME
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_BGNDFRAME
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_FGNDRECT
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_FGNDRECT
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_BGNDRECT
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_BGNDRECT
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_HALFTONERECT
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_HALFTONERECT
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_HALFTONEFRAME
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_HALFTONEFRAME
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_RAISEDLINE
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_RAISEDLINE
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_RECESSEDLINE
|
||||
::oWidget := QFrame()
|
||||
CASE ::type == XBPSTATIC_TYPE_RECESSEDLINE
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_ICON
|
||||
::oWidget := QLabel()
|
||||
CASE ::type == XBPSTATIC_TYPE_ICON
|
||||
::oWidget := QLabel():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_SYSICON
|
||||
::oWidget := QLabel()
|
||||
CASE ::type == XBPSTATIC_TYPE_SYSICON
|
||||
::oWidget := QLabel():from( pQtObject )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_BITMAP
|
||||
::oWidget := QLabel()
|
||||
CASE ::type == XBPSTATIC_TYPE_BITMAP
|
||||
::oWidget := QLabel():from( pQtObject )
|
||||
|
||||
OTHERWISE
|
||||
::oWidget := QFrame()
|
||||
|
||||
ENDCASE
|
||||
|
||||
::oWidget:pPtr := pQtObject
|
||||
OTHERWISE
|
||||
::oWidget := QFrame():from( pQtObject )
|
||||
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
@@ -345,7 +342,7 @@ METHOD XbpStatic:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpStatic:setCaption( xCaption, cDll )
|
||||
LOCAL oStyle, pPixmap, oIcon, oPixmap
|
||||
LOCAL oStyle, oIcon, oPixmap
|
||||
|
||||
HB_SYMBOL_UNUSED( cDll )
|
||||
|
||||
@@ -379,38 +376,34 @@ METHOD XbpStatic:setCaption( xCaption, cDll )
|
||||
::oWidget:setPixmap( QPixmap( ::caption ):scaled( ::aSize[ 1 ], ::aSize[ 2 ] ) )
|
||||
|
||||
CASE ::type == XBPSTATIC_TYPE_SYSICON
|
||||
oPixmap := QPixmap()
|
||||
oIcon := QIcon()
|
||||
oStyle := QStyle()
|
||||
oStyle:pPtr := QApplication():style()
|
||||
oStyle := QApplication():style()
|
||||
|
||||
DO CASE
|
||||
CASE ::caption == XBPSTATIC_SYSICON_ICONINFORMATION
|
||||
oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxInformation )
|
||||
oIcon := oStyle:standardIcon( QStyle_SP_MessageBoxInformation )
|
||||
|
||||
CASE ::caption == XBPSTATIC_SYSICON_ICONQUESTION
|
||||
oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxQuestion )
|
||||
oIcon := oStyle:standardIcon( QStyle_SP_MessageBoxQuestion )
|
||||
|
||||
CASE ::caption == XBPSTATIC_SYSICON_ICONERROR
|
||||
oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxCritical )
|
||||
oIcon := oStyle:standardIcon( QStyle_SP_MessageBoxCritical )
|
||||
|
||||
CASE ::caption == XBPSTATIC_SYSICON_ICONWARNING
|
||||
oIcon:pPtr := oStyle:standardIcon( QStyle_SP_MessageBoxWarning )
|
||||
oIcon := oStyle:standardIcon( QStyle_SP_MessageBoxWarning )
|
||||
|
||||
OTHERWISE
|
||||
/* It is a Harbour Extension - you have 60+ icons to display
|
||||
* Check hbqtgui.ch : #define QStyle_SP_* constants
|
||||
*/
|
||||
oIcon:pPtr := oStyle:standardIcon( ::caption )
|
||||
oIcon := oStyle:standardIcon( ::caption )
|
||||
|
||||
ENDCASE
|
||||
|
||||
/* Harbour can also implement if icon be displayed scaled or proportionate
|
||||
*/
|
||||
oPixmap:pPtr := oIcon:pixmap( ::aSize[ 1 ], ::aSize[ 2 ] )
|
||||
pPixmap := oPixmap:scaled( ::aSize[ 1 ], ::aSize[ 2 ] )
|
||||
oPixmap := oIcon:pixmap( ::aSize[ 1 ], ::aSize[ 2 ] ):scaled( ::aSize[ 1 ], ::aSize[ 2 ] )
|
||||
|
||||
::oWidget:setPixmap( pPixmap )
|
||||
::oWidget:setPixmap( oPixmap )
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -144,9 +144,7 @@ METHOD XbpStatusBar:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QStatusBar()
|
||||
::oWidget:pPtr := pQtObject
|
||||
|
||||
::oWidget := QStatusBar():from( pQtObject )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
@@ -178,7 +176,6 @@ METHOD XbpStatusBar:destroy()
|
||||
FOR EACH obj IN ::aItems
|
||||
::oWidget:removeWidget( obj )
|
||||
obj:oParent := NIL
|
||||
obj:oWidget:pPtr := NIL
|
||||
obj := NIL
|
||||
NEXT
|
||||
::aItems := {}
|
||||
|
||||
@@ -139,7 +139,7 @@ METHOD XbpTabPage:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::oWidget:setContextMenuPolicy( Qt_CustomContextMenu )
|
||||
::oWidget:setObjectName( "Tab_Page" )
|
||||
|
||||
oPar:oWidget:addTab( ::pWidget, ::caption )
|
||||
oPar:oWidget:addTab( ::oWidget, ::caption )
|
||||
|
||||
::setPosAndSize()
|
||||
IF ::visible
|
||||
@@ -157,8 +157,7 @@ METHOD XbpTabPage:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QWidget()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget := QWidget():from( pQtObject )
|
||||
|
||||
ENDIF
|
||||
|
||||
@@ -319,9 +318,10 @@ METHOD XbpTabWidget:execSlot( cSlot, p )
|
||||
LOCAL iIndex
|
||||
|
||||
IF hb_isPointer( p )
|
||||
qPoint := QPoint():from( ::oWidget:mapToGlobal( p ) )
|
||||
qPoint := ::oWidget:mapToGlobal( p )
|
||||
qApp := QApplication()
|
||||
pWidget := QWidget():from( qApp:widgetAt( qPoint ) )
|
||||
pWidget := qApp:widgetAt( qPoint )
|
||||
|
||||
iIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, pWidget:pPtr ) } ) - 1
|
||||
HB_TRACE( HB_TR_DEBUG, "iIndex", iIndex, pWidget:objectName() )
|
||||
ELSE
|
||||
@@ -331,7 +331,7 @@ HB_TRACE( HB_TR_DEBUG, "iIndex", iIndex, pWidget:objectName() )
|
||||
IF !empty( ::aChildren ) .and. iIndex >= 0 .and. iIndex < len( ::aChildren )
|
||||
qTab := ::oWidget:widget( iIndex )
|
||||
|
||||
IF ( nIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, qTab ) } ) ) > 0
|
||||
IF ( nIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, qTab:pPtr ) } ) ) > 0
|
||||
oTab := ::aChildren[ nIndex ]
|
||||
|
||||
DO CASE
|
||||
|
||||
@@ -199,7 +199,7 @@ METHOD XbpToolbar:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QToolBar()
|
||||
::oWidget:pPtr := pQtObject
|
||||
::oWidget:pPtr := hbqt_ptr( pQtObject )
|
||||
|
||||
ENDIF
|
||||
|
||||
@@ -217,7 +217,6 @@ METHOD XbpToolbar:destroy()
|
||||
|
||||
::disConnect( oBtn:oAction, "triggered(bool)" )
|
||||
|
||||
oBtn:oAction:pPtr := NIL
|
||||
oBtn:oAction := NIL
|
||||
ELSE
|
||||
aItem := NIL
|
||||
|
||||
@@ -131,7 +131,6 @@ METHOD XbpTreeView:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
LOCAL oW
|
||||
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
@@ -141,7 +140,6 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::oWidget:setHeaderHidden( .t. )
|
||||
::oWidget:setContextMenuPolicy( Qt_CustomContextMenu )
|
||||
|
||||
|
||||
#if 0
|
||||
IF ::alwaysShowSelection
|
||||
::style += TVS_SHOWSELALWAYS
|
||||
@@ -158,9 +156,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
::oRootItem:hTree := ::oWidget
|
||||
::oRootItem:oXbpTree := self
|
||||
|
||||
oW := QTreeWidgetItem()
|
||||
oW:pPtr := ::oWidget:invisibleRootItem()
|
||||
::oRootItem:oWidget := oW
|
||||
::oRootItem:oWidget := ::oWidget:invisibleRootItem()
|
||||
|
||||
* ::oWidget:connect( "currentItemChanged(QTWItem)" , {|p1| ::execSlot( "currentItemChanged(QTWItem)", p1 ) } )
|
||||
* ::oWidget:connect( "itemActivated(QTWItem)" , {|p1| ::execSlot( "itemActivated(QTWItem)" , p1 ) } )
|
||||
@@ -189,9 +185,7 @@ METHOD XbpTreeView:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
IF hb_isPointer( pQtObject )
|
||||
::oWidget := QTreeWidget()
|
||||
::oWidget:pPtr := pQtObject
|
||||
|
||||
::oWidget := pQtObject
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
@@ -199,7 +193,7 @@ METHOD XbpTreeView:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpTreeView:execSlot( cSlot, p )
|
||||
LOCAL oItem, n, qPt, pNode
|
||||
LOCAL n, qPt, qItem, oItem, qPos
|
||||
|
||||
IF hb_isPointer( p )
|
||||
IF ( n := ascan( ::aItems, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, p ) } ) ) > 0
|
||||
@@ -219,13 +213,12 @@ METHOD XbpTreeView:execSlot( cSlot, p )
|
||||
CASE cSlot == "itemEntered(QTWItem)"
|
||||
::oWidget:setToolTip( iif( empty( oItem:tooltipText ), oItem:caption, oItem:tooltipText ) )
|
||||
CASE cSlot == "customContextMenuRequested(QPoint)"
|
||||
pNode := ::oWidget:itemAt( p )
|
||||
IF !hbqt_isEmptyQtPointer( pNode )
|
||||
qPt := QPoint():from( ::oWidget:mapToGlobal( p ) )
|
||||
IF ( n := ascan( ::aItems, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, pNode ) } ) ) > 0
|
||||
oItem := ::aItems[ n ]
|
||||
IF hb_isBlock( ::hb_contextMenu )
|
||||
eval( ::hb_contextMenu, { qPt:x(), qPt:y() }, NIL, oItem )
|
||||
IF hb_isBlock( ::hb_contextMenu )
|
||||
qPos := QPoint( p )
|
||||
IF ( qItem := ::oWidget:itemAt( qPos ) ):isValidObject()
|
||||
IF ( n := ascan( ::aItems, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, qItem:pPtr ) } ) ) > 0
|
||||
qPt := ::oWidget:mapToGlobal( p )
|
||||
eval( ::hb_contextMenu, { qPt:x(), qPt:y() }, NIL, ::aItems[ n ] )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -412,7 +405,8 @@ METHOD XbpTreeViewItem:addItem( xItem, xNormalImage, xMarkedImage, xExpandedImag
|
||||
oItem:xValue := xValue
|
||||
ENDIF
|
||||
|
||||
::oWidget:addChild( oItem:oWidget:pPtr )
|
||||
// ::oWidget:addChild( oItem:oWidget:pPtr )
|
||||
::oWidget:addChild( oItem:oWidget )
|
||||
|
||||
aadd( ::aChilds, oItem )
|
||||
aadd( oItem:aChilds, oItem )
|
||||
@@ -447,11 +441,9 @@ METHOD XbpTreeViewItem:destroy()
|
||||
LOCAL i
|
||||
|
||||
FOR i := 1 TO len( ::aChilds )
|
||||
::aChilds[ i ]:oWidget:pPtr := NIL
|
||||
::aChilds[ i ]:oWidget := NIL
|
||||
NEXT
|
||||
|
||||
//::oItem:pPtr := NIL
|
||||
::oWidget:pPtr := NIL
|
||||
::oWidget := NIL
|
||||
|
||||
RETURN NIL
|
||||
|
||||
@@ -486,7 +478,7 @@ METHOD XbpTreeViewItem:delItem( oItem )
|
||||
|
||||
IF ( n := ascan( ::aChilds, {|o| o == oItem } ) ) > 0
|
||||
::oWidget:removeChild( ::aChilds[ n ]:oWidget:pPtr )
|
||||
::aChilds[ n ]:oWidget:pPtr := NIL
|
||||
::aChilds[ n ]:oWidget := NIL
|
||||
adel( ::aChilds, n )
|
||||
asize( ::aChilds, len( ::aChilds )-1 )
|
||||
ENDIF
|
||||
|
||||
@@ -501,13 +501,13 @@ METHOD XbpWindow:grabEvent( nEvent, pEvent )
|
||||
SWITCH ( nEvent )
|
||||
|
||||
CASE QEvent_MouseMove // :motion()
|
||||
oEvent := QMouseEvent():configure( pEvent )
|
||||
oEvent := QMouseEvent():from( pEvent )
|
||||
SetAppEvent( xbeM_Motion, { oEvent:x(), oEvent:y() }, NIL, self )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_MouseButtonPress // :lbClick() :mbClick() :rbClick()
|
||||
// :lbDown() :mbDown() :rbDown()
|
||||
oEvent := QMouseEvent():configure( pEvent )
|
||||
oEvent := QMouseEvent():from( pEvent )
|
||||
DO CASE
|
||||
CASE oEvent:button() == Qt_LeftButton
|
||||
SetAppEvent( xbeM_LbDown, { oEvent:x(), oEvent:y() }, NIL, self )
|
||||
@@ -519,7 +519,7 @@ METHOD XbpWindow:grabEvent( nEvent, pEvent )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_MouseButtonRelease // :mbUp() :rbUp() :lbUp()
|
||||
oEvent := QMouseEvent():configure( pEvent )
|
||||
oEvent := QMouseEvent():from( pEvent )
|
||||
DO CASE
|
||||
CASE oEvent:button() == Qt_LeftButton
|
||||
SetAppEvent( xbeM_LbUp, { oEvent:x(), oEvent:y() }, NIL, self )
|
||||
@@ -531,7 +531,7 @@ METHOD XbpWindow:grabEvent( nEvent, pEvent )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_MouseButtonDblClick // :lbDblClick() :mbDblClick() :rbDblClick()
|
||||
oEvent := QMouseEvent():configure( pEvent )
|
||||
oEvent := QMouseEvent():from( pEvent )
|
||||
DO CASE
|
||||
CASE oEvent:button() == Qt_LeftButton
|
||||
SetAppEvent( xbeM_LbDblClick, { oEvent:x(), oEvent:y() }, NIL, self )
|
||||
@@ -543,26 +543,26 @@ METHOD XbpWindow:grabEvent( nEvent, pEvent )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_ContextMenu //
|
||||
oEvent := QContextMenuEvent():configure( pEvent )
|
||||
oEvent := QContextMenuEvent():from( pEvent )
|
||||
//SetAppEvent( xbeM_Context, { oEvent:globalX(), oEvent:globalY() }, NIL, self )
|
||||
::hbContextMenu( { oEvent:globalX(), oEvent:globalY() } )
|
||||
EXIT
|
||||
CASE QEvent_Enter // :enter()
|
||||
IF ( ::lTrack )
|
||||
oEvent := QMouseEvent():configure( pEvent )
|
||||
oEvent := QMouseEvent():from( pEvent )
|
||||
SetAppEvent( xbeM_Enter, { oEvent:x(), oEvent:y() }, NIL, self )
|
||||
ENDIF
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_Leave // :leave()
|
||||
IF ( ::lTrack )
|
||||
oEvent := QMouseEvent():configure( pEvent )
|
||||
oEvent := QMouseEvent():from( pEvent )
|
||||
SetAppEvent( xbeM_Leave, { oEvent:x(), oEvent:y() }, NIL, self )
|
||||
ENDIF
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_Wheel // :wheel()
|
||||
oEvent := QWheelEvent():configure( pEvent )
|
||||
oEvent := QWheelEvent():from( pEvent )
|
||||
SetAppEvent( xbeM_Wheel, { oEvent:x(), oEvent:y() }, { oEvent:buttons(), oEvent:delta() }, self )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
@@ -575,41 +575,41 @@ METHOD XbpWindow:grabEvent( nEvent, pEvent )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_Paint // :paint()
|
||||
oEvent := QPaintEvent():configure( pEvent )
|
||||
oObj_N := QRect():configure( oEvent:rect() )
|
||||
oEvent := QPaintEvent():from( pEvent )
|
||||
oObj_N := oEvent:rect()
|
||||
SetAppEvent( xbeP_Paint, { oObj_N:left(), oObj_N:top(), oObj_N:right(), oObj_N:bottom() }, NIL, Self )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_Move // :move()
|
||||
oEvent := QMoveEvent():configure( pEvent )
|
||||
oP0 := QPoint():configure( oEvent:oldPos() )
|
||||
oP1 := QPoint():configure( oEvent:pos() )
|
||||
oEvent := QMoveEvent():from( pEvent )
|
||||
oP0 := oEvent:oldPos()
|
||||
oP1 := oEvent:pos()
|
||||
SetAppEvent( xbeP_Move, { oP0:x(), oP0:y() }, { oP1:x(), oP1:y() }, Self )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_Resize // :resize()
|
||||
oEvent := QResizeEvent():configure( pEvent )
|
||||
oObj_O := QSize():configure( oEvent:oldSize() )
|
||||
oObj_N := QSize():configure( oEvent:size() )
|
||||
oEvent := QResizeEvent():from( pEvent )
|
||||
oObj_O := oEvent:oldSize()
|
||||
oObj_N := oEvent:size()
|
||||
SetAppEvent( xbeP_Resize, { oObj_O:width(), oObj_O:height() }, { oObj_N:width(), oObj_N:height() }, Self )
|
||||
lRet := .f.
|
||||
EXIT
|
||||
CASE QEvent_DragEnter // :dragEnter()
|
||||
oEvent := QDragEnterEvent():configure( pEvent )
|
||||
oObj_O := QPoint():configure( oEvent:pos() )
|
||||
oEvent := QDragEnterEvent():from( pEvent )
|
||||
oObj_O := oEvent:pos()
|
||||
SetAppEvent( xbeP_DragEnter, { oEvent:mouseButtons(), { oObj_O:x(), oObj_O:y() } }, /* oDragObj */, Self )
|
||||
EXIT
|
||||
CASE QEvent_DragLeave // :dragLeave()
|
||||
SetAppEvent( xbeP_DragLeave, NIL, NIL, Self )
|
||||
EXIT
|
||||
CASE QEvent_DragMove // :dragMotion()
|
||||
oEvent := QDragEnterEvent():configure( pEvent )
|
||||
oObj_O := QPoint():configure( oEvent:pos() )
|
||||
oEvent := QDragEnterEvent():from( pEvent )
|
||||
oObj_O := oEvent:pos()
|
||||
SetAppEvent( xbeP_DragMotion, { oEvent:mouseButtons(), { oObj_O:x(), oObj_O:y() } }, NIL, Self )
|
||||
EXIT
|
||||
CASE QEvent_Drop // :dragDrop()
|
||||
oEvent := QDragEnterEvent():configure( pEvent )
|
||||
oObj_O := QPoint():configure( oEvent:pos() )
|
||||
oEvent := QDragEnterEvent():from( pEvent )
|
||||
oObj_O := oEvent:pos()
|
||||
SetAppEvent( xbeP_DragDrop, { oEvent:mouseButtons() , { oObj_O:x(), oObj_O:y() } }, /* oDragObj */, Self )
|
||||
EXIT
|
||||
CASE QEvent_WhatsThis // :helpRequest()
|
||||
@@ -905,8 +905,7 @@ METHOD XbpWindow:setColorFG( nRGB )
|
||||
|
||||
IF hb_isNumeric( nRGB )
|
||||
IF empty( ::oPalette )
|
||||
::oPalette := QPalette()
|
||||
::oPalette:pPtr := ::oWidget:palette()
|
||||
::oPalette := ::oWidget:palette()
|
||||
ENDIF
|
||||
|
||||
DO CASE
|
||||
|
||||
Reference in New Issue
Block a user