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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user