Textcolor from Skinbuttons

Textcolor from Skinbuttons

Postby byte-one » Tue May 22, 2012 10:43 am

Is there a way to change the textcolor of Skinbuttons?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Textcolor from Skinbuttons

Postby DevBr » Tue May 22, 2012 11:38 pm

Try this way:

Code: Select all  Expand view

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 :) )
DevBr
 
Posts: 13
Joined: Mon Apr 23, 2012 7:43 am

Re: Textcolor from Skinbuttons

Postby byte-one » Wed May 23, 2012 2:15 pm

Thanks, but no effect. It seems, that on standard buttons from windows-API we cannot change the text-color. Antonio??
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Textcolor from Skinbuttons

Postby DevBr » Fri Jun 22, 2012 3:33 am

It work fine for me. :)

Code: Select all  Expand view
#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 )
DevBr
 
Posts: 13
Joined: Mon Apr 23, 2012 7:43 am

Re: Textcolor from Skinbuttons

Postby byte-one » Fri Jun 22, 2012 10:29 am

Thanks! But only the disabled text-colors are able to change. Not the normal text-color!?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 124 guests