From 619d4eb0e8a3cb415701ab1e514694ed3836b86e Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 23 Dec 2009 17:11:04 +0000 Subject: [PATCH] 2009-12-23 09:07 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/hbide.prg * contrib/hbide/resources/mainwindow.ui * contrib/hbxbp/xbpbrowse.prg * contrib/hbxbp/xbpdialog.prg + Added an experimental protocol scheduled to be polished in next few days. --- harbour/ChangeLog | 8 ++ harbour/contrib/hbide/hbide.prg | 36 +++++++++ harbour/contrib/hbide/resources/mainwindow.ui | 78 +++++++++++++++++++ harbour/contrib/hbxbp/xbpbrowse.prg | 9 --- harbour/contrib/hbxbp/xbpdialog.prg | 41 +++++++++- 5 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 harbour/contrib/hbide/resources/mainwindow.ui diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 31d4c508fa..f4d2b9f80b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-23 09:07 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/hbide.prg + * contrib/hbide/resources/mainwindow.ui + * contrib/hbxbp/xbpbrowse.prg + * contrib/hbxbp/xbpdialog.prg + + Added an experimental protocol scheduled to be + polished in next few days. + 2009-12-23 13:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * package/winuni/mpkg_win_uni_extra_copy.bat + Added automatized (but not generic) logic to assemble 'unified' package. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index cc2ce84854..8baef55d6d 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -257,6 +257,9 @@ CLASS HbIde METHOD readProcessInfo() METHOD goto() + + METHOD testBuildDialog() + ENDCLASS /*----------------------------------------------------------------------*/ @@ -1582,6 +1585,7 @@ METHOD HbIde:executeAction( cKey ) ::lDockRVisible := !( ::lDockRVisible ) CASE cKey == "Compile" + ::testBuildDialog() CASE cKey == "CompilePPO" @@ -2166,3 +2170,35 @@ METHOD HbIde:goto() RETURN nLine /*----------------------------------------------------------------------*/ + +METHOD HbIde:testBuildDialog() + LOCAL oUI, oDlg + LOCAL mp1, mp2, oXbp, nEvent + + oUI := XbpQtUiLoader():new() + oUI:file := s_resPath + "mainWindow.ui" + oUI:create() + + oDlg := XbpDialog():new() + oDlg:hbCreateFromQtPtr( ::oDlg, , , , , , oUI:oWidget:pPtr ) + //oDlg:drawingArea := oUI:qObj[ "drawingArea" ] + + oDlg:show() + DO WHILE .t. + nEvent := AppEvent( @mp1, @mp2, @oXbp ) + + IF nEvent == xbeP_Keyboard + DO CASE + + CASE mp1 == xbeK_ESC + EXIT + + ENDCASE + ENDIF + + oXbp:handleEvent( nEvent, mp1, mp2 ) + ENDDO + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/resources/mainwindow.ui b/harbour/contrib/hbide/resources/mainwindow.ui new file mode 100644 index 0000000000..4b93bda50d --- /dev/null +++ b/harbour/contrib/hbide/resources/mainwindow.ui @@ -0,0 +1,78 @@ + + + mainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 0 + 0 + 800 + 18 + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + Qt::LeftDockWidgetArea + + + 1 + + + + + + Qt::LeftDockWidgetArea + + + 1 + + + + + + Qt::BottomDockWidgetArea + + + 8 + + + + + + Qt::RightDockWidgetArea + + + 2 + + + + + + + diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 0634e6c70f..85e54e03a4 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -750,15 +750,6 @@ METHOD XbpBrowse:destroy() /*----------------------------------------------------------------------*/ -FUNCTION ShowMem( lYes ) - IF lYes - HBXBP_DEBUG( " ." ) - ENDIF - HBXBP_DEBUG( " Mem Used "+IF( lYes, "1001", " " ), memory( 1001 ) ) - RETURN nil - -/*----------------------------------------------------------------------*/ - METHOD XbpBrowse:exeBlock( nEvent, p1, p2, p3 ) LOCAL oWheelEvent, oMouseEvent, i, nRow, nRowPos, nCol, nColPos, oPoint diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index c24452c4bf..09553197be 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -173,12 +173,45 @@ METHOD XbpDialog:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, l ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - IF hb_isPointer( pQtObject ) - ::oWidget := QMainWindow() - ::oWidget:pPtr := pQtObject - + IF !hb_isPointer( pQtObject ) + RETURN Self ENDIF + ::cargo := hb_threadId() /* To Be Removed */ + + ::oWidget := QMainWindow() + ::oWidget:pPtr := pQtObject + + IF !empty( ::title ) + ::oWidget:setWindowTitle( ::title ) + ENDIF + IF hb_isChar( ::icon ) + ::oWidget:setWindowIcon( ::icon ) + ENDIF + + #if 0 + ::drawingArea := XbpDrawingArea():new( self, , {0,0}, ::aSize, , .t. ):create() + ::oWidget:setCentralWidget( ::drawingArea:oWidget ) + + SetAppWindow( Self ) + #endif + + /* Thread specific event buffer */ + hbxbp_InitializeEventBuffer() + + /* Install Event Loop per Dialog Basis */ + ::oEventLoop := QEventLoop():new( ::pWidget ) + hbxbp_SetEventLoop( ::oEventLoop ) + + /* Instal Event Filter */ + ::oWidget:installEventFilter( QT_GetEventFilter() ) + + ::connectWindowEvents() + // + ::connectEvent( ::pWidget, QEvent_Close , {|o,e| ::exeBlock( QEvent_Close , e, o ) } ) + ::connectEvent( ::pWidget, QEvent_WindowActivate , {|o,e| ::exeBlock( QEvent_WindowActivate , e, o ) } ) + ::connectEvent( ::pWidget, QEvent_WindowDeactivate, {|o,e| ::exeBlock( QEvent_WindowDeactivate, e, o ) } ) + RETURN Self /*----------------------------------------------------------------------*/