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.
This commit is contained in:
Pritpal Bedi
2011-12-22 00:52:36 +00:00
parent e278bae975
commit f551a1ca42
2 changed files with 12 additions and 3 deletions

View File

@@ -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

View File

@@ -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.