diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7356d19cf1..74dc3b53f6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-21 16:50 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/tests/demoqt.prg + + Implemented: pushbutton differentiates color based on its state. + 2011-12-21 16:23 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/QPushButton.qth * contrib/hbqt/qtgui/qth/QWidget.qth diff --git a/harbour/contrib/hbqt/tests/demoqt.prg b/harbour/contrib/hbqt/tests/demoqt.prg index 8021f28307..d9d812b9f8 100644 --- a/harbour/contrib/hbqt/tests/demoqt.prg +++ b/harbour/contrib/hbqt/tests/demoqt.prg @@ -115,7 +115,7 @@ PROCEDURE Main() oProg := Build_ProgressBar( oDA, { 30,300 }, { 200,30 } ) aList := Build_ListBox( oDA, { 310,240 }, { 150, 100 } ) - oBtn:hbSetEventBlock( QEvent_Paint, {|oEvent,oPainter| RePaint( oEvent, oPainter ) } ) + oBtn:hbSetEventBlock( QEvent_Paint, {|oEvent,oPainter| RePaint( oEvent, oPainter, oBtn ) } ) oWnd:connect( 6, {|e| My_Events( e ) } ) oWnd:connect( 19, {|| QApplication():quit() } ) @@ -617,10 +617,15 @@ FUNCTION ShowInSystemTray( oWnd ) /*----------------------------------------------------------------------*/ -FUNCTION RePaint( oPaintEvent, oPainter ) +FUNCTION RePaint( oPaintEvent, oPainter, oBtn ) LOCAL qRect := oPaintEvent:rect() - oPainter:fillRect( qRect, QColor( 120,12,200 ) ) + + IF oBtn:isDown() + oPainter:fillRect( qRect, QColor( 120,12,200 ) ) + ELSE + oPainter:fillRect( qRect, QColor( 220,100,12 ) ) + ENDIF oPainter:drawText( 30, 30, "Harbour" ) RETURN .f.