From 06871d3ce6b8dbbdff6cda2c62a6f9d27b719cd2 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Fri, 6 May 2011 18:09:12 +0000 Subject: [PATCH] 2011-05-06 11:00 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/QPrinterInfo.qth ! Fixed: constructor. * contrib/hbxbp/xbpgeneric.prg ! Minor. * contrib/hbxbp/xbpwindow.prg ! Fixed: rather commented out the code where :handleEvent() was destroying the object. I will look into another way how this can be achieved where :close callback is not defined to destroy the object and only xbeP_Close is sent via PostAppEvent(). Like: oXbpDialog:close := {|mp1,mp2,obj| PostAppEvent( xbeP_Close, , , obj ) } instead of oXbpDialog:close := {|mp1,mp2,obj| PostAppEvent( xbeP_Close, , , obj ), obj:destroy() } --- harbour/ChangeLog | 15 +++++++++++++ .../contrib/hbqt/qtgui/qth/QPrinterInfo.qth | 22 ++++++++++++++----- harbour/contrib/hbxbp/xbpgeneric.prg | 2 -- harbour/contrib/hbxbp/xbpwindow.prg | 2 ++ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a1340a1c5a..971167a27c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-06 11:00 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/qth/QPrinterInfo.qth + ! Fixed: constructor. + * contrib/hbxbp/xbpgeneric.prg + ! Minor. + * contrib/hbxbp/xbpwindow.prg + ! Fixed: rather commented out the code where :handleEvent() + was destroying the object. I will look into another way + how this can be achieved where :close callback is not + defined to destroy the object and only xbeP_Close is + sent via PostAppEvent(). Like: + oXbpDialog:close := {|mp1,mp2,obj| PostAppEvent( xbeP_Close, , , obj ) } + instead of + oXbpDialog:close := {|mp1,mp2,obj| PostAppEvent( xbeP_Close, , , obj ), obj:destroy() } + 2011-05-06 16:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * ChangeLog ! typo in last entry diff --git a/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth b/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth index d1c2aed463..859797c3d7 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth @@ -75,11 +75,23 @@ HB_FUNC( QT_QPRINTERINFO ) { if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - __HB_RETPTRGC__( new QPrinterInfo( *hbqt_par_QPrinterInfo( 1 ) ) ); - } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) - { - __HB_RETPTRGC__( new QPrinterInfo( *hbqt_par_QPrinter( 2 ) ) ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hbqt_par_ptr( 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QPrinterInfo ) + { + __HB_RETPTRGC__( new QPrinterInfo( *hbqt_par_QPrinterInfo( 1 ) ) ); + } + if( q->type == HBQT_TYPE_QPrinter ) + { + __HB_RETPTRGC__( new QPrinterInfo( *hbqt_par_QPrinter( 1 ) ) ); + } + } + else + { + __HB_RETPTRGC__( new QPrinterInfo() ); + } + } else { diff --git a/harbour/contrib/hbxbp/xbpgeneric.prg b/harbour/contrib/hbxbp/xbpgeneric.prg index 3ec3e19e0f..36e0ffe4da 100644 --- a/harbour/contrib/hbxbp/xbpgeneric.prg +++ b/harbour/contrib/hbxbp/xbpgeneric.prg @@ -210,8 +210,6 @@ PROCEDURE SetAppEvent( nEvent, mp1, mp2, oXbp ) aadd( t_events, { nEvent, mp1, mp2, iif( empty( oXbp ), t_oAppWindow, oXbp ) } ) - /* HB_TRACE( HB_TR_ALWAYS, len( t_events ) ) */ - RETURN /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index 78c1c85e9a..b889d1dc95 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -673,9 +673,11 @@ METHOD XbpWindow:handleEvent( nEvent, mp1, mp2 ) SWITCH ( nEvent ) CASE xbeP_Close + #if 0 IF ! empty( ::oWidget ) ::destroy() ENDIF + #endif EXIT CASE xbeP_Keyboard ::keyboard( mp1 )