How to change the the text color of a button inserted in the native RibbonBar?
Obs.: Fwh 10.6
[b]METHOD[/b] AddButton( nRow, nCol, nHeight, nWidth, cPrompt, ;
bAction, cType, bWhen, cFile, lBorder, ;
lRound, cLayout, oPopup, lGrouping, lFirstElm, lEndElm ,cMsg, nRound, nClrText ) //-- Anderson - 14/7/2010 - Inclusão da cor do texto
local oBtn, oThis := Self
local nType
local aLayout := { "TOP", "LEFT", "BOTTOM", "RIGHT", "MOSTLEFT", "MOSTRIGHT", "CENTER" }
local aType := { "NORMAL", "POPUP", "SPLITPOPUP", "SAYBUTTON" }
DEFAULT nRow := 2, nCol:= 2, nHeight := 32, nWidth := 100, cType := "NORMAL", cLayout := "TOP",;
lBorder := .f., lRound := .f., lGrouping := .f., lFirstElm:= .f., lEndElm:= .f.,;
nClrText := CLR_BLACK //-- Anderson - 14/7/2010 - Inclusão da cor do texto
nType := Max( AScan( aType, cType ), 1 )
cLayout := aLayout[ Max( AScan( aLayout, cLayout ), 1 ) ]
oBtn := TRBtn():New( nRow, nCol, nWidth, nHeight, cFile, ;
bAction, Self, cMsg, bWhen, .f., .f.,;
cPrompt, , lBorder, lRound, cLayout, ;
::hBrushUnSel, , -nRow - ::nTop, -nCol - ::nLeft, aType[ nType ], oPopup, , , , ;
, , , , , lGrouping, lFirstElm, lEndElm, , , , , nRound )
oBtn:bClrText := {| lEnable | if( lEnable, nClrText, GetSysColor( COLOR_GRAYTEXT ) ) } //-- Anderson - 14/7/2010 - Inclusão da cor do texto
[b]return[/b] oBtn
#xcommand @ <nRow>, <nCol> ADD BUTTON [ <oBtn> ] ;
[ PROMPT <cCaption> ];
[ SIZE <nWidth>, <nHeight> ] ;
[ BITMAP <cBitmap> ] ;
[ ACTION <uAction> ] ;
[ <of: OF, GROUP> <oGr> ] ;
[ WHEN <WhenFunc> ] ;
[ <lBorder: BORDER> ] ;
[ <lRound: ROUND> [ <rs: RSIZE, ROUNDSIZE><nRound> ] ] ;
[ <layout: TOP, LEFT, BOTTOM, RIGHT, MOSTLEFT, MOSTRIGHT, CENTER> ] ;
[ <type: NORMAL, POPUP, SPLITPOPUP, SAYBUTTON> ] ;
[ <lGrouping: GROUPBUTTON> [<lFirstElm: FIRST>][ <lEndElm: END> ] ];
[ MENU <oPopup> ];
[ MESSAGE <cMsg> ] ;
[ COLOR <nRGBColor>]; //-- Anderson - 14/7/2010 - Inclusão da cor do texto
=>;
[ <oBtn> := ] <oGr>:AddButton( <nRow>, <nCol>, <nHeight>, <nWidth>, <cCaption>,;
[{|Self|<uAction>}], [ Upper(<(type)>) ], <{WhenFunc}>, ;
<cBitmap>, [<.lBorder.>], <.lRound.>, [ Upper(<(layout)>) ], ;
[<oPopup>], [<.lGrouping.>], [<.lFirstElm.>], [<.lEndElm.>], <cMsg>, [<nRound>] , [<nRGBColor>])
@ 02,05 ADD BUTTON oBtn21 ;
PROMPT "Configuração de parametros" ;
BITMAP "Parametros32" ;
GROUP oGr10 ;
ACTION Configuracao() ;
COLOR RGB(255,255,0) ; //-- Anderson - 14/7/2010 - Inclusão da cor do texto
SIZE 85, 80
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 99 guests