From 0c887e73d1816ceac3eb1e89eebbd601b9a54d26 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 31 Aug 2010 20:56:34 +0000 Subject: [PATCH] 2010-08-31 13:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbp.ch * contrib/hbxbp/xbp3state.prg * contrib/hbxbp/xbpbrowse.prg * contrib/hbxbp/xbpcheckbox.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/xbpparthandler.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 + Implemented: :status() method as per Shum's request. It just remained unimplemented for so long. --- harbour/ChangeLog | 30 +++++ harbour/contrib/hbxbp/xbp.ch | 6 + harbour/contrib/hbxbp/xbp3state.prg | 1 + harbour/contrib/hbxbp/xbpbrowse.prg | 5 +- harbour/contrib/hbxbp/xbpcheckbox.prg | 1 + harbour/contrib/hbxbp/xbpcombobox.prg | 1 + harbour/contrib/hbxbp/xbpdialog.prg | 2 + harbour/contrib/hbxbp/xbpfiledialog.prg | 1 + harbour/contrib/hbxbp/xbpfontdialog.prg | 1 + harbour/contrib/hbxbp/xbphtmlviewer.prg | 2 +- harbour/contrib/hbxbp/xbplistbox.prg | 1 + harbour/contrib/hbxbp/xbpmenubar.prg | 2 + harbour/contrib/hbxbp/xbpmle.prg | 153 ++++++++++++----------- harbour/contrib/hbxbp/xbpparthandler.prg | 13 +- harbour/contrib/hbxbp/xbpprintdialog.prg | 1 + harbour/contrib/hbxbp/xbppushbutton.prg | 1 + harbour/contrib/hbxbp/xbpradiobutton.prg | 1 + harbour/contrib/hbxbp/xbprtf.prg | 1 + harbour/contrib/hbxbp/xbpscrollbar.prg | 1 + harbour/contrib/hbxbp/xbpsle.prg | 1 + harbour/contrib/hbxbp/xbpspinbutton.prg | 1 + harbour/contrib/hbxbp/xbpstatic.prg | 1 + harbour/contrib/hbxbp/xbpstatusbar.prg | 8 +- harbour/contrib/hbxbp/xbptabpage.prg | 3 +- harbour/contrib/hbxbp/xbptoolbar.prg | 2 +- harbour/contrib/hbxbp/xbptreeview.prg | 1 + harbour/contrib/hbxbp/xbpwindow.prg | 22 ++-- 27 files changed, 161 insertions(+), 102 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 67a04a7df6..870f97438c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,36 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-31 13:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbp.ch + * contrib/hbxbp/xbp3state.prg + * contrib/hbxbp/xbpbrowse.prg + * contrib/hbxbp/xbpcheckbox.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/xbpparthandler.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 + + Implemented: :status() method as per Shum's request. + It just remained unimplemented for so long. + 2010-08-30 18:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp * contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp diff --git a/harbour/contrib/hbxbp/xbp.ch b/harbour/contrib/hbxbp/xbp.ch index ecd00c95c2..b517e2f2c6 100644 --- a/harbour/contrib/hbxbp/xbp.ch +++ b/harbour/contrib/hbxbp/xbp.ch @@ -471,5 +471,11 @@ /*----------------------------------------------------------------------*/ +#define XBP_STAT_INIT 0 +#define XBP_STAT_CREATE 1 +#define XBP_STAT_FAILURE 2 + +/*----------------------------------------------------------------------*/ + #define _XBP_CH #endif diff --git a/harbour/contrib/hbxbp/xbp3state.prg b/harbour/contrib/hbxbp/xbp3state.prg index 9beb968b80..fdb48f9c7d 100644 --- a/harbour/contrib/hbxbp/xbp3state.prg +++ b/harbour/contrib/hbxbp/xbp3state.prg @@ -131,6 +131,7 @@ METHOD Xbp3State:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::editBuffer := ::oWidget:checkState() ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 16b589dc8c..27b62e44e2 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -719,11 +719,10 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /* .DBF Manipulation Model */ ::oDbfModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 141, t, role, x, y ) } ) -HB_TRACE( HB_TR_DEBUG, "20000 9" ) /* Attach Model with the View */ ::oTableView:setModel( ::oDbfModel ) -HB_TRACE( HB_TR_DEBUG, "20000 10" ) + /* Horizontal Footer */ ::oFooterView := QHeaderView():new( Qt_Horizontal ) // @@ -790,6 +789,8 @@ HB_TRACE( HB_TR_DEBUG, "20000 10" ) //::oTableView:setEditTriggers( QAbstractItemView_SelectedClicked ) ::oTableView:setEditTriggers( QAbstractItemView_AnyKeyPressed ) + ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpcheckbox.prg b/harbour/contrib/hbxbp/xbpcheckbox.prg index fc7bd51dc5..dc97782047 100644 --- a/harbour/contrib/hbxbp/xbpcheckbox.prg +++ b/harbour/contrib/hbxbp/xbpcheckbox.prg @@ -122,6 +122,7 @@ METHOD XbpCheckBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::editBuffer := ::oWidget:isChecked() ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpcombobox.prg b/harbour/contrib/hbxbp/xbpcombobox.prg index f6820ec296..f1ebffecbd 100644 --- a/harbour/contrib/hbxbp/xbpcombobox.prg +++ b/harbour/contrib/hbxbp/xbpcombobox.prg @@ -152,6 +152,7 @@ METHOD XbpComboBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::show() ENDIF ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index 7c373c80dc..969b081055 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -218,6 +218,8 @@ METHOD XbpDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget:connect( QEvent_WindowActivate , {|e| ::execEvent( QEvent_WindowActivate , e ) } ) ::oWidget:connect( QEvent_WindowDeactivate , {|e| ::execEvent( QEvent_WindowDeactivate , e ) } ) + ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index 45d47df84c..c79aff32c9 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -125,6 +125,7 @@ METHOD XbpFileDialog:create( oParent, oOwner, aPos ) ::oWidget:connect( "filesSelected(QStringList)", {|p| ::execSlot( "filesSelected(QStringList)", p ) } ) ::oWidget:connect( "filterSelected(QString)" , {|p| ::execSlot( "filterSelected(QString)" , p ) } ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfontdialog.prg b/harbour/contrib/hbxbp/xbpfontdialog.prg index 2466ac2a50..2be938f710 100644 --- a/harbour/contrib/hbxbp/xbpfontdialog.prg +++ b/harbour/contrib/hbxbp/xbpfontdialog.prg @@ -199,6 +199,7 @@ METHOD XbpFontDialog:create( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) ::oWidget:connect( "currentFontChanged(QFont)", {|p| ::execSlot( "currentFontChanged(QFont)", p ) } ) ::oWidget:connect( "fontSelected(QFont)" , {|p| ::execSlot( "fontSelected(QFont)" , p ) } ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbphtmlviewer.prg b/harbour/contrib/hbxbp/xbphtmlviewer.prg index 5a21d1b45f..d7c3cffc8e 100644 --- a/harbour/contrib/hbxbp/xbphtmlviewer.prg +++ b/harbour/contrib/hbxbp/xbphtmlviewer.prg @@ -177,7 +177,7 @@ METHOD XbpHTMLViewer:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::oParent:addChild( SELF ) #endif - + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index 54e1a2cf72..c81efd2436 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -190,6 +190,7 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::show() ENDIF ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index 9695033999..07cc4c2ec6 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -190,6 +190,7 @@ METHOD xbpMenuBar:create( oParent, aPresParams, lVisible ) endif ::oParent:addChild( self ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -745,6 +746,7 @@ METHOD xbpMenu:create( oParent, aPresParams, lVisible ) ::oParent:oWidget:addMenu( ::oWidget ) ::oParent:addChild( self ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmle.prg b/harbour/contrib/hbxbp/xbpmle.prg index 9cfacc50a2..a857270280 100644 --- a/harbour/contrib/hbxbp/xbpmle.prg +++ b/harbour/contrib/hbxbp/xbpmle.prg @@ -93,32 +93,32 @@ CLASS XbpMLE INHERIT XbpWindow, XbpDataRef METHOD execSlot( cSlot, p ) METHOD setStyle() - METHOD clear() - METHOD copyMarked() - METHOD cutMarked() - METHOD deleteMarked() + METHOD clear() + METHOD copyMarked() + METHOD cutMarked() + METHOD deleteMarked() METHOD delete( nPos, nChars ) - METHOD pasteMarked() - METHOD queryFirstChar() - METHOD queryMarked() - METHOD setFirstChar( nBufferPos ) - METHOD setMarked( aStartEnd ) - METHOD insert( nPos, cString ) - METHOD charFromLine( nLine ) - METHOD lineFromChar( nPos ) - METHOD pos() + METHOD pasteMarked() + METHOD queryFirstChar() + METHOD queryMarked() + METHOD setFirstChar( nBufferPos ) + METHOD setMarked( aStartEnd ) + METHOD insert( nPos, cString ) + METHOD charFromLine( nLine ) + METHOD lineFromChar( nPos ) + METHOD pos() DATA sl_undo INIT .T. DATA sl_hScroll DATA sl_vScroll - METHOD undo( ... ) SETGET - METHOD hScroll( ... ) SETGET - METHOD vScroll( ... ) SETGET + METHOD undo( ... ) SETGET + METHOD hScroll( ... ) SETGET + METHOD vScroll( ... ) SETGET + + METHOD setEditable( lYes ) + METHOD setWrap( lWrap ) - METHOD setEditable( lYes ) - METHOD setWrap( lWrap ) - ENDCLASS /*----------------------------------------------------------------------*/ @@ -181,6 +181,7 @@ METHOD XbpMLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::setStyle() ::oParent:addChild( Self ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -203,14 +204,14 @@ METHOD XbpMLE:execSlot( cSlot, p ) HB_SYMBOL_UNUSED( cSlot ) HB_SYMBOL_UNUSED( p ) - + RETURN .t. /*----------------------------------------------------------------------*/ METHOD XbpMLE:clear() LOCAL nChars := len( ::oWidget:toPlainText() ) - + ::oWidget:clear() RETURN nChars @@ -219,10 +220,10 @@ METHOD XbpMLE:clear() METHOD XbpMLE:copyMarked() LOCAL qCursor, cText - + qCursor := QTextCursor():from( ::oWidget:textCursor() ) cText := qCursor:selectedText() - + ::oWidget:copy() RETURN len( cText ) @@ -231,10 +232,10 @@ METHOD XbpMLE:copyMarked() METHOD XbpMLE:cutMarked() LOCAL qCursor, cText - + qCursor := QTextCursor():from( ::oWidget:textCursor() ) cText := qCursor:selectedText() - + ::oWidget:cut() RETURN len( cText ) @@ -243,7 +244,7 @@ METHOD XbpMLE:cutMarked() METHOD XbpMLE:deleteMarked() LOCAL qCursor, cText - + qCursor := QTextCursor():from( ::oWidget:textCursor() ) cText := qCursor:selectedText() qCursor:removeSelectedText() @@ -255,59 +256,59 @@ METHOD XbpMLE:deleteMarked() METHOD XbpMLE:delete( nPos, nChars ) LOCAL qCursor, cText - + qCursor := QTextCursor():from( ::oWidget:textCursor() ) qCursor:setPosition( nPos ) qCursor:movePosition( QTextCursor_Right, QTextCursor_KeepAnchor, nChars ) cText := qCursor:selectedText() qCursor:removeSelectedText() - + ::oWidget:setTextCursor( qCursor ) RETURN len( cText ) /*----------------------------------------------------------------------*/ -METHOD XbpMLE:pasteMarked() +METHOD XbpMLE:pasteMarked() LOCAL cText2 LOCAL cText1 := ::oWidget:toPlainText() - + ::oWidget:paste() ; cText2 := ::oWidget:toPlainText() - + RETURN len( cText2 ) - len( cText1 ) - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:queryFirstChar() RETURN 0 /* Cannot be calculated until it is subclassed */ - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:queryMarked() LOCAL qCursor, a_ - + qCursor := QTextCursor():from( ::oWidget:textCursor() ) IF qCursor:hasSelection() a_:= { qCursor:selectionStart(), qCursor:selectionEnd() } - ELSE + ELSE a_:= { 0,0 } - ENDIF - + ENDIF + RETURN a_ - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:setFirstChar( nBufferPos ) HB_SYMBOL_UNUSED( nBufferPos ) - + RETURN .f. /* Cannot be achieved unless it is subclassed*/ - + /*----------------------------------------------------------------------*/ 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:setPosition( aStartEnd[ 1 ] ) @@ -316,30 +317,30 @@ METHOD XbpMLE:setMarked( aStartEnd ) IF len( cText ) > 0 ::oWidget:setTextCursor( qCursor ) RETURN .t. - ENDIF + ENDIF ENDIF - + RETURN .f. - + /*----------------------------------------------------------------------*/ - -METHOD XbpMLE:insert( nPos, cString ) + +METHOD XbpMLE:insert( nPos, cString ) LOCAL qCursor - + IF hb_isChar( cString ) qCursor := QTextCursor():from( ::oWidget:textCursor() ) IF hb_isNumeric( nPos ) .AND. nPos >= 0 qCursor:setPosition( nPos ) - ENDIF + ENDIF qCursor:insertText( cString ) ::oWidget:setTextCursor( qCursor ) RETURN .t. - ENDIF - + ENDIF + RETURN .f. - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:charFromLine( nLine ) LOCAL qCursor, nPos @@ -351,41 +352,41 @@ METHOD XbpMLE:charFromLine( nLine ) ELSE qCursor:movePosition( QTextCursor_StartOfLine ) nPos := qCursor:position() - ENDIF - + ENDIF + RETURN nPos - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:lineFromChar( nPos ) LOCAL qCursor, nLine - + qCursor := QTextCursor():from( ::oWidget:textCursor() ) IF hb_isNumeric( nPos ) qCursor:setPosition( nPos ) nLine := qCursor:blockNumber() ELSE nLine := qCursor:blockNumber() - ENDIF - - RETURN nLine - + ENDIF + + RETURN nLine + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:pos() RETURN QTextCursor():from( ::oWidget:textCursor() ):position() - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:hScroll( ... ) LOCAL a_:= hb_aParams() IF len( a_ ) == 1 .AND. hb_isBlock( a_[ 1 ] ) ::sl_hScroll := a_[ 1 ] ELSEIF len( a_ ) >= 2 .AND. hb_isBlock( ::sl_hScroll ) eval( ::sl_hScroll, NIL, NIL, Self ) - ENDIF + ENDIF RETURN Self - + /*----------------------------------------------------------------------*/ METHOD XbpMLE:vScroll( ... ) @@ -394,9 +395,9 @@ METHOD XbpMLE:vScroll( ... ) ::sl_vScroll := a_[ 1 ] ELSEIF len( a_ ) >= 0 .AND. hb_isBlock( ::sl_vScroll ) eval( ::sl_vScroll, NIL, NIL, Self ) - ENDIF + ENDIF RETURN Self - + /*----------------------------------------------------------------------*/ METHOD XbpMLE:undo( ... ) @@ -405,9 +406,9 @@ METHOD XbpMLE:undo( ... ) ::sl_undo := a_[ 1 ] ELSEIF len( a_ ) >= 1 .AND. hb_isBlock( ::sl_undo ) eval( ::sl_undo, a_[ 1 ], NIL, Self ) - ENDIF + ENDIF RETURN Self - + /*----------------------------------------------------------------------*/ METHOD XbpMLE:setWrap( lWrap ) @@ -416,14 +417,14 @@ METHOD XbpMLE:setWrap( lWrap ) RETURN ::xDummy == 1 /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:setEditable( lYes ) ::xDummy := ::oWidget:readOnly() ::oWidget:setReadOnly( !lYes ) RETURN ! ::xDummy - + /*----------------------------------------------------------------------*/ - + METHOD XbpMLE:handleEvent( nEvent, mp1, mp2 ) HB_SYMBOL_UNUSED( nEvent ) diff --git a/harbour/contrib/hbxbp/xbpparthandler.prg b/harbour/contrib/hbxbp/xbpparthandler.prg index 111f5d7d90..e3e884a65b 100644 --- a/harbour/contrib/hbxbp/xbpparthandler.prg +++ b/harbour/contrib/hbxbp/xbpparthandler.prg @@ -83,7 +83,7 @@ CLASS XbpPartHandler METHOD configure( oParent, oOwner ) METHOD destroy() METHOD handleEvent( hEvent, mp1, mp2 ) - METHOD status() + METHOD status( nStatus ) SETGET METHOD addChild( oXbp ) METHOD addAsChild() @@ -100,7 +100,7 @@ CLASS XbpPartHandler DATA nNameId DATA oParent DATA oOwner - DATA nStatus INIT 0 + DATA nStatus INIT XBP_STAT_INIT ENDCLASS @@ -161,9 +161,14 @@ METHOD handleEvent( hEvent, mp1, mp2 ) CLASS XbpPartHandler /*----------------------------------------------------------------------*/ -METHOD status() CLASS XbpPartHandler +METHOD status( nStatus ) CLASS XbpPartHandler + LOCAL nOldStatus := ::nStatus - RETURN ::nStatus + IF hb_isNumeric( nStatus ) + ::nStatus := nStatus + ENDIF + + RETURN nOldStatus /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpprintdialog.prg b/harbour/contrib/hbxbp/xbpprintdialog.prg index 097fcdba07..cfdb78c8b6 100644 --- a/harbour/contrib/hbxbp/xbpprintdialog.prg +++ b/harbour/contrib/hbxbp/xbpprintdialog.prg @@ -114,6 +114,7 @@ METHOD XbpPrintDialog:create( oParent, oOwner ) ::oWidget:connect( "accepted(QPrinter)", {|p| ::pPrinter := p } ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbppushbutton.prg b/harbour/contrib/hbxbp/xbppushbutton.prg index 808a76d255..d4952a9de6 100644 --- a/harbour/contrib/hbxbp/xbppushbutton.prg +++ b/harbour/contrib/hbxbp/xbppushbutton.prg @@ -167,6 +167,7 @@ METHOD XbpPushButton:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParam ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) ::addAsChild() + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpradiobutton.prg b/harbour/contrib/hbxbp/xbpradiobutton.prg index 344f4d8336..d58fc4a4b8 100644 --- a/harbour/contrib/hbxbp/xbpradiobutton.prg +++ b/harbour/contrib/hbxbp/xbpradiobutton.prg @@ -122,6 +122,7 @@ METHOD XbpRadioButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisibl ENDIF ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbprtf.prg b/harbour/contrib/hbxbp/xbprtf.prg index 242488b730..7150c1cd87 100644 --- a/harbour/contrib/hbxbp/xbprtf.prg +++ b/harbour/contrib/hbxbp/xbprtf.prg @@ -189,6 +189,7 @@ METHOD XbpRtf:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oTextCursor:pPtr := ::oWidget:textCursor() ::oTextCharFormat:pPtr := ::oTextCursor:charFormat() + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpscrollbar.prg b/harbour/contrib/hbxbp/xbpscrollbar.prg index a7591e929a..6658a9eabb 100644 --- a/harbour/contrib/hbxbp/xbpscrollbar.prg +++ b/harbour/contrib/hbxbp/xbpscrollbar.prg @@ -127,6 +127,7 @@ METHOD XbpScrollBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ENDIF ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpsle.prg b/harbour/contrib/hbxbp/xbpsle.prg index 82ba85da9d..9ff30ad522 100644 --- a/harbour/contrib/hbxbp/xbpsle.prg +++ b/harbour/contrib/hbxbp/xbpsle.prg @@ -182,6 +182,7 @@ METHOD XbpSLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF ::oParent:addChild( Self ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpspinbutton.prg b/harbour/contrib/hbxbp/xbpspinbutton.prg index 9aeb00cf18..87a1d47376 100644 --- a/harbour/contrib/hbxbp/xbpspinbutton.prg +++ b/harbour/contrib/hbxbp/xbpspinbutton.prg @@ -163,6 +163,7 @@ METHOD XbpSpinButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::setData() ::oParent:addChild( Self ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpstatic.prg b/harbour/contrib/hbxbp/xbpstatic.prg index bbd0809196..9457e6a570 100644 --- a/harbour/contrib/hbxbp/xbpstatic.prg +++ b/harbour/contrib/hbxbp/xbpstatic.prg @@ -243,6 +243,7 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::show() ENDIF ::oParent:addChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpstatusbar.prg b/harbour/contrib/hbxbp/xbpstatusbar.prg index d46b74df8f..44707b8b48 100644 --- a/harbour/contrib/hbxbp/xbpstatusbar.prg +++ b/harbour/contrib/hbxbp/xbpstatusbar.prg @@ -92,7 +92,7 @@ CLASS XbpStatusBar INHERIT XbpWindow METHOD delItem( nItemORcKey ) METHOD getItem( nItemORcKey ) METHOD clear() - + METHOD panelClick( ... ) SETGET METHOD panelDblClick( ... ) SETGET @@ -134,7 +134,7 @@ METHOD XbpStatusBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::show() ENDIF ::oParent:AddChild( SELF ) - + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -283,7 +283,7 @@ METHOD XbpStatusBar:panelClick( ... ) ::sl_lbClick := a_[ 1 ] ELSEIF len( a_ ) >= 1 .AND. hb_isBlock( ::sl_lbClick ) eval( ::sl_lbClick, a_[ 1 ], NIL, Self ) - ENDIF + ENDIF RETURN Self /*----------------------------------------------------------------------*/ @@ -294,7 +294,7 @@ METHOD XbpStatusBar:panelDblClick( ... ) ::sl_lbDblClick := a_[ 1 ] ELSEIF len( a_ ) >= 1 .AND. hb_isBlock( ::sl_lbDblClick ) eval( ::sl_lbDblClick, a_[ 1 ], NIL, Self ) - ENDIF + ENDIF RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptabpage.prg b/harbour/contrib/hbxbp/xbptabpage.prg index 28eea6e94d..a449b63483 100644 --- a/harbour/contrib/hbxbp/xbptabpage.prg +++ b/harbour/contrib/hbxbp/xbptabpage.prg @@ -293,9 +293,8 @@ METHOD XbpTabWidget:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible IF ::visible ::show() ENDIF - ::oParent:addChild( SELF ) - + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptoolbar.prg b/harbour/contrib/hbxbp/xbptoolbar.prg index 374df1681f..233a866b67 100644 --- a/harbour/contrib/hbxbp/xbptoolbar.prg +++ b/harbour/contrib/hbxbp/xbptoolbar.prg @@ -188,7 +188,7 @@ METHOD XbpToolbar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::show() ENDIF ::oParent:AddChild( SELF ) - + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptreeview.prg b/harbour/contrib/hbxbp/xbptreeview.prg index 6d68cc3643..aaa739619e 100644 --- a/harbour/contrib/hbxbp/xbptreeview.prg +++ b/harbour/contrib/hbxbp/xbptreeview.prg @@ -179,6 +179,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::show() ENDIF ::oParent:AddChild( SELF ) + ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index e502e2f862..6f5109f397 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -262,6 +262,8 @@ CLASS XbpWindow INHERIT XbpPartHandler ACCESS pWidget INLINE iif( empty( ::oWidget ), NIL, ::oWidget:pPtr ) ACCESS pParent INLINE iif( empty( ::oParent ), NIL, ::oParent:oWidget:pPtr ) + METHOD postCreate() + ENDCLASS /*----------------------------------------------------------------------*/ @@ -363,6 +365,14 @@ METHOD XbpWindow:setQtProperty( cProperty ) /*----------------------------------------------------------------------*/ +METHOD XbpWindow:postCreate() + + ::status := iif( hbqt_isEmptyQtPointer( ::oWidget:pPtr ), XBP_STAT_FAILURE, XBP_STAT_CREATE ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD XbpWindow:connectWindowEvents() ::oWidget:connect( QEvent_MouseButtonPress , {|e| ::grabEvent( QEvent_MouseButtonPress , e ) } ) @@ -417,18 +427,6 @@ HB_TRACE( HB_TR_DEBUG, hb_threadId(),"Destroy[ B ] "+pad(cCls,12)+ cMsg, memory ::oParent := NIL ::oOwner := NIL - //::oWidget:disconnect() - - IF len( ::aEConnections ) > 0 - #if 0 - FOR EACH e_ IN ::aEConnections -// ::xDummy := Qt_Events_DisConnect( ::pEvents, e_[ 1 ], e_[ 2 ] ) - NEXT - ::aEConnections := {} -// ::oWidget:removeEventFilter( ::pEvents ) - #endif - ENDIF - IF Len( ::aChildren ) > 0 aeval( ::aChildren, {|o| o:destroy() } ) ::aChildren := {}