diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8333827486..76e260be1b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-23 07:47 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/THbQtUI.prg + ! Fixed wronly used MsgBox(), converted to hbqt_showError(). + 2010-06-23 16:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbmisc/hbeditc.c % Deleted unnecessary casts. diff --git a/harbour/contrib/hbqt/THbQtUI.prg b/harbour/contrib/hbqt/THbQtUI.prg index 83b96a1218..eb4aff0df3 100644 --- a/harbour/contrib/hbqt/THbQtUI.prg +++ b/harbour/contrib/hbqt/THbQtUI.prg @@ -321,7 +321,7 @@ METHOD HbQtUI:OnError( ... ) IF hb_hHasKey( ::qObj, substr( cMsg, 3 ) ) xReturn := ::qObj[ substr( cMsg, 3 ) ] ELSE - MsgBox( "Control < " + substr( cMsg, 3 ) + " > does not exists!" ) + hbqt_showError( "Control < " + substr( cMsg, 3 ) + " > does not exists!" ) ENDIF ELSE xReturn := ::oWidget:&cMsg( ... ) @@ -333,7 +333,7 @@ METHOD HbQtUI:OnError( ... ) METHOD HbQtUI:build( cFileOrBuffer, qParent ) LOCAL s, n, n1, cCls, cNam, lCreateFinished, cMCls, cMNam, cText - LOCAL cCmd, aReg, aCommands, aConst, cBlock, bBlock, x, a_, prg_ + LOCAL cCmd, aReg, aCommands, aConst, cBlock, bBlock, x, a_ LOCAL regEx := hb_regexComp( "\bQ[A-Za-z_]+ \b" ) DEFAULT cFileOrBuffer TO ::cFile @@ -486,15 +486,7 @@ METHOD HbQtUI:build( cFileOrBuffer, qParent ) NEXT #define STRINGIFY( cStr ) '"' + cStr + '"' - #define PAD_30( cStr ) pad( cStr, max( len( cStr ), 15 ) ) - - prg_:={} - aadd( prg_, "FUNCTION ui_Shortcuts( qParent )" ) - aadd( prg_, " LOCAL oWidget" ) - aadd( prg_, " LOCAL qObj := {=>}" ) - aadd( prg_, " " ) - aadd( prg_, " hb_hCaseMatch( qObj, .f. )" ) - aadd( prg_, " " ) + #define PAD_30( cStr ) pad( cStr, max( len( cStr ), 20 ) ) /* Platform is ready */ ::cMainWidgetName := cMNam @@ -502,23 +494,17 @@ METHOD HbQtUI:build( cFileOrBuffer, qParent ) SWITCH cMCls CASE "QDialog" ::oWidget := QDialog():new( ::qParent ) - aadd( prg_, " oWidget := QDialog():new( qParent )" ) EXIT CASE "QWidget" ::oWidget := QWidget():new( ::qParent ) - aadd( prg_, " oWidget := QWidget():new( qParent )" ) EXIT CASE "QMainWindow" ::oWidget := QMainWindow():new( ::qParent ) - aadd( prg_, " oWidget := QMainWindow():new( qParent )" ) EXIT ENDSWITCH ::oWidget:setObjectName( cMNam ) - aadd( prg_, " oWidget:setObjectName( " + STRINGIFY( cMNam ) + " )" ) ::qObj[ cMNam ] := ::oWidget - aadd( prg_, " qObj[ " + STRINGIFY( cMNam ) + " ] := oWidget" ) - aadd( prg_, " " ) FOR EACH a_ IN ::widgets IF a_:__enumIndex() > 1 @@ -534,11 +520,8 @@ METHOD HbQtUI:build( cFileOrBuffer, qParent ) ELSE ENDIF - - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( a_[ 2 ] ) ) + " ] := " + strtran( a_[ 4 ], "o[", "qObj[" ) ) ENDIF NEXT - aadd( prg_, " " ) ::aCommands := aCommands @@ -563,27 +546,22 @@ METHOD HbQtUI:build( cFileOrBuffer, qParent ) IF "setToolTip(" $ cCmd s := hbq_pullToolTip( cCmd ) ::qObj[ cNam ]:setToolTip( s ) - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( cNam ) ) + " ]:setToolTip( [" + s + "] )" ) ELSEIF "setPlainText(" $ cCmd s := hbq_pullToolTip( cCmd ) ::qObj[ cNam ]:setPlainText( s ) - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( cNam ) ) + " ]:setPlainText( [" + s + "] )" ) ELSEIF "setStyleSheet(" $ cCmd s := hbq_pullToolTip( cCmd ) ::qObj[ cNam ]:setStyleSheet( s ) - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( cNam ) ) + " ]:setStyleSheet( [" + s + "] )" ) ELSEIF "setText(" $ cCmd s := hbq_pullToolTip( cCmd ) ::qObj[ cNam ]:setText( s ) - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( cNam ) ) + " ]:setText( [" + s + "] )" ) ELSEIF "setWhatsThis(" $ cCmd s := hbq_pullToolTip( cCmd ) ::qObj[ cNam ]:setWhatsThis( s ) - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( cNam ) ) + " ]:setWhatsThis( [" + s + "] )" ) ELSEIF "header()->" $ cCmd // TODO: how to handle : __qtreeviewitem->header()->setVisible( .f. ) @@ -594,15 +572,10 @@ METHOD HbQtUI:build( cFileOrBuffer, qParent ) bBlock := &( cBlock ) eval( bBlock, ::qObj, cNam ) - aadd( prg_, " qObj[ " + PAD_30( STRINGIFY( cNam ) ) + " ]:" + strtran( cCmd, "o[", "qObj[" ) ) - ENDIF ENDIF NEXT - * aeval( prg_, {|e| HB_TRACE( HB_TR_ALWAYS, e ) } ) - * HB_TRACE( HB_TR_ALWAYS, ".............." ) - RETURN Self /*----------------------------------------------------------------------*/