Page 1 of 1

Textcolor from Skinbuttons

Posted: Tue May 22, 2012 10:43 am
by byte-one
Is there a way to change the textcolor of Skinbuttons?

Re: Textcolor from Skinbuttons

Posted: Tue May 22, 2012 11:38 pm
by DevBr
Try this way:

Code: Select all

Function FwChangeSkinColor()
 Local oClr
  With Object ( oClr := SetSkinBtnDefaultClrs() )
      :aClrFocused       := { { 1/2, nRGB( 255, 253, 219 ), nRGB( 255, 231, 144 ) },{ 1/2, nRGB( 255, 215,  76 ), nRGB( 255, 231, 153 ) } }
      :aClrPressed       := { { 1/2, nRGB( 249, 188, 107 ), nRGB( 253, 163,  97 ) },{ 1/2, nRGB( 251, 142,  61 ), nRGB( 254, 191, 102 ) } }
      :aClrNormal        := { { 1/2, nRGB( 231, 240, 244 ), nRGB( 159, 212, 240 ) },{ 1/2, nRGB( 126, 188, 224 ), nRGB( 188, 227, 244 ) } }
      :aClrDisabled      := { { 1/2, nRGB( 255,255,255 ),RGB(167,166,170)  }, { 1/2, RGB(167,166,170), nRGB( 255,255,255 ) } }
      :nClrBorder0_F     := nRGB( 219, 206, 153 )
      :nClrBorder1_F     := nRGB( 255, 255, 251 )
      :nClrBorder0_P     := nRGB( 123, 102, 69 )
      :nClrBorder1_P     := nRGB( 204, 150, 102 )
      :nClrBorder0_N     := nRGB( 121, 157, 182 )
      :nClrBorder1_N     := nRGB( 255, 255, 255 )
      :nClrTextDisable_0 := CLR_GRAY
      :nClrTextDisable_1 := CLR_WHITE
  End
Return SetSkinButtonsColors( oClr )

 
I have not tested. :)
( It's normal color, change for you see new result :) )

Re: Textcolor from Skinbuttons

Posted: Wed May 23, 2012 2:15 pm
by byte-one
Thanks, but no effect. It seems, that on standard buttons from windows-API we cannot change the text-color. Antonio??

Re: Textcolor from Skinbuttons

Posted: Fri Jun 22, 2012 3:33 am
by DevBr
It work fine for me. :)

Code: Select all

#include "Fivewin.ch"
Function Main()
Local oDlg
SkinButtons()
FwChangeSkinColor()

Define Dialog oDlg Pixel From 0,0 To 500,500
@ 10,10 Button oBtn Prompt "Test" Size 20,100 Pixel
Activate Dialog oDlg Centered
Return Nil

Function FwChangeSkinColor()
 Local oClr
  With Object ( oClr := SetSkinBtnDefaultClrs() )
      :aClrFocused       := { { 1/2, CLR_RED, CLR_RED },{ 1/2, CLR_RED, CLR_RED } }
      :aClrPressed       := { { 1/2, CLR_GREEN, CLR_GREEN },{ 1/2, CLR_GREEN, CLR_GREEN } }
      :aClrNormal        := { { 1/2, CLR_YELLOW, CLR_YELLOW },{ 1/2, CLR_YELLOW, CLR_YELLOW } }
      :aClrDisabled      := { { 1/2, CLR_BLACK,CLR_BLACK  }, { 1/2, CLR_BLACK, CLR_BLACK } }
      :nClrBorder0_F     := CLR_BLUE
      :nClrBorder1_F     := CLR_BLUE
      :nClrBorder0_P     := CLR_BLUE
      :nClrBorder1_P     := CLR_BLUE
      :nClrBorder0_N     := CLR_BLUE
      :nClrBorder1_N     := CLR_BLUE
      :nClrTextDisable_0 := CLR_BLUE
      :nClrTextDisable_1 := CLR_BLUE
  End
Return SetSkinButtonsColors( oClr )

Re: Textcolor from Skinbuttons

Posted: Fri Jun 22, 2012 10:29 am
by byte-one
Thanks! But only the disabled text-colors are able to change. Not the normal text-color!?