2011-04-15 01:52 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbxbp/xbpwindow.prg
    ! Depricated: setting fore/background colors of a part via 
      style sheet which was raising some issues. It needs further
      rationalization as well for some type of components.
This commit is contained in:
Pritpal Bedi
2011-04-15 08:55:52 +00:00
parent 2b2549b74a
commit 44957ef52d
2 changed files with 16 additions and 49 deletions

View File

@@ -16,6 +16,12 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-04-15 01:52 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbxbp/xbpwindow.prg
! Depricated: setting fore/background colors of a part via
style sheet which was raising some issues. It needs further
rationalization as well for some type of components.
2011-04-15 10:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/harbour.hbx
+ added HB_MUTEXEVAL

View File

@@ -894,66 +894,27 @@ STATIC FUNCTION Xbp_RgbToName( nRgb )
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setColorBG( nRGB )
LOCAL oldRGB, cName, cQTName
LOCAL oldRGB := hbxbp_SetPresParam( ::aPresParams, XBP_PP_BGCLR, nRGB )
LOCAL oPalette
cName := Xbp_RgbToName( nRGB )
IF hb_isNumeric( nRGB )
oldRGB := hbxbp_SetPresParam( ::aPresParams, XBP_PP_BGCLR, nRGB )
cQTName := Xbp_XbpToQTName( __ObjGetClsName( self ) )
IF empty( cQTName )
::setStyleSheet( "background-color: "+ cName +";" )
ELSE
::setStyleSheet( "background-color: "+ cName +";" )
ENDIF
ELSE
oldRGB := hbxbp_SetPresParam( ::aPresParams, XBP_PP_BGCLR )
ENDIF
oPalette := ::oWidget:palette()
oPalette:setColor( QPalette_Window, QColor( nRGB ) )
::oWidget:setPalette( oPalette )
RETURN oldRGB
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setColorFG( nRGB )
LOCAL oldRGB, cName
LOCAL oldRGB := hbxbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR, nRGB )
LOCAL oPalette
cName := Xbp_RgbToName( nRGB )
IF hb_isNumeric( nRGB )
oldRGB := hbxbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR, nRGB )
::setStyleSheet( "color: "+ cName +";" )
ELSE
oldRGB := hbxbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR )
ENDIF
oPalette := ::oWidget:palette()
oPalette:setColor( QPalette_WindowText, QColor( nRGB ) )
::oWidget:setPalette( oPalette )
RETURN oldRGB
#if 0
LOCAL cClass := __ObjGetClsName( self )
IF hb_isNumeric( nRGB )
IF empty( ::oPalette )
::oPalette := ::oWidget:palette()
ENDIF
DO CASE
CASE cClass $ 'XBPPUSHBUTTON,XBPMENUBAR,XBPMENU,XBPTOOLBAR,XBPTABPAGE'
::oPalette:setColor( QPalette_ButtonText, QColor( nRGB ) )
OTHERWISE
::oPalette:setColor( QPalette_Foreground, QColor( nRGB ) )
::oPalette:setColor( QPalette_Text , QColor( nRGB ) )
ENDCASE
::oWidget:setPalette( ::oPalette )
ENDIF
LOCAL oColor := QColor( nRGB )
hbxbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR, nRGB )
::setStyleSheet( "color: "+ oColor:name +";" )
RETURN Self
#endif
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setFont( oFont )