Cambiar el color de un GROUP

Cambiar el color de un GROUP

Postby José Camilo » Wed Mar 22, 2023 4:30 pm

Buenos dias.
Necesito cambiar el color de un GROUP desde un radio segun el valor que tome esta variable.
Como se puede hacer? Gracias
José Camilo
 
Posts: 212
Joined: Wed Apr 07, 2021 3:56 pm

Re: Cambiar el color de un GROUP

Postby karinha » Wed Mar 22, 2023 6:10 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Cambiar el color de un GROUP

Postby José Camilo » Wed Mar 22, 2023 6:24 pm

Gracias Joao.
Pero sigo sin solución.
Gracias por tu tiempo
José Camilo
 
Posts: 212
Joined: Wed Apr 07, 2021 3:56 pm

Re: Cambiar el color de un GROUP

Postby karinha » Wed Mar 22, 2023 10:20 pm

Mira se ayuda:

Code: Select all  Expand view  RUN

// C:\FWH..\SAMPLES\CAMILO.PRG

#include "FiveWin.ch"

#Define CLR_ORANGE     nRGB( 255, 165, 000 ) //-> Orange - Laranja
#Define CLR_SOFTYELLOW nRGB( 255, 251, 225 )

FUNCTION Main()

   LOCAL oDlg, oGroup, oSalida, oFont, oSkinB, aGrad
   LOCAL lFivePro  := .T.
   LOCAL lDialog   := .T.
   LOCAL lObjects  := .F.
   LOCAL oRadMenu  := 1
   LOCAL cName     := SPACE( 10 )
   LOCAL cAddress  := SPACE( 30 )
   LOCAL oBtn, oGet1, oGet2
   LOCAL nColor    := 1

   oSkinB = TSkinButton():New()

   oSkinB:nClrBorder0_N := RGB( 249, 194, 179 )
   oSkinB:nClrBorder1_N := RGB( 181, 61, 29 )
   oSkinB:aClrNormal    := { { 0.2, RGB( 000, 128, 000 ), RGB( 000, 128, 000 ) }, ;
                             { 0.8, RGB( 109, 135, 100 ), RGB( 109, 135, 100 ) } }

   SkinButtons( oSkinB )

   SetGetColorFocus()

   tGet():lDisColors  := .F.
   tGet():nClrTextDis := CLR_HBLUE
   tGet():nClrPaneDis := CLR_WHITE

   aGrad := { { 1, CLR_WHITE, CLR_HCYAN  } }

   DEFINE FONT oFont  NAME "Ms Sans Serif"  SIZE 00, -14 BOLD

   DEFINE DIALOG oDlg FROM 8, 2 TO 25, 50 TITLE "Group Color by Camilo"      ;
      FONT oFont GRADIENT aGrad

   oDlg:lHelpIcon := .F.

   @ 1,  1 SAY "&Name:" OF oDlg COLORS CLR_CYAN, CLR_WHITE TRANSPARENT UPDATE

   @ 1,  6 GET oGet1 VAR cName OF oDlg COLORS CLR_BLACK, CLR_WHITE UPDATE

   @ 2,  1 SAY "&Address:" OF oDlg COLORS CLR_CYAN, CLR_WHITE TRANSPARENT    ;
      UPDATE

   @ 2,  6 GET oGet2 VAR cAddress OF oDlg COLORS CLR_BLACK, CLR_WHITE UPDATE

   @ 3,  9 GROUP oGroup TO 7, 20 LABEL "Group Color" OF oDlg                 ;
      COLOR CLR_ORANGE, CLR_WHITE TRANSPARENT

   @ 4,  9 RADIO oRadMenu PROMPT "&Novice", "A&vanced", "&Expert" OF oDlg

   @ 6,  5 BUTTON oBtn PROMPT "&Color" OF oDlg SIZE 50, 12                   ;
      ACTION SET_COLOR( oGroup, nColor )

   oBtn:cToolTip := "Cambiar Color del Group"

   @ 6, 17 BUTTON oSalida PROMPT "&Salida" OF oDlg SIZE 50, 12               ;
      ACTION( oDlg:End() ) CANCEL

   oSalida:cToolTip := "salida - Exit - Cancelar"

   ACTIVATE DIALOG oDlg CENTERED ON INIT( CTRLS_COLORS( oDlg ) )

   oFont:End()

RETURN NIL

FUNCTION SET_COLOR( oGroup, nColor )

   LOCAL oIni, oBrush, oBmp
   LOCAL nTipo, cStyle, cFile, cLogo, nRow, nCol, lSelect

   nColor := ChooseColor()

   oGroup:SetColor( nColor, CLR_WHITE )
   oGroup:Refresh()

RETURN( nColor )
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )

   LOCAL lc_aCtrls := {}, lc_iFor := 0
   LOCAL lc_aItemsRadio := {}

   lc_aCtrls := f_oDlgContainer:aControls

   FOR lc_iFor := 1 TO Len( lc_aCtrls )

      IF ValType( lc_aCtrls[lc_iFor] ) == "O"

         IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"

            aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems,                 ;
                   {|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
                   _oRadId:SetColor( CLR_CYAN, CLR_WHITE ) } } )
                   
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

            // SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )

            // lc_aCtrls[lc_iFor]:SetColor( G_COLOR_SYS( 31 ), G_COLOR_SYS( 1 ) )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN -> kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Cambiar el color de un GROUP

Postby karinha » Wed Mar 22, 2023 10:29 pm

Imagen:

https://imgur.com/vKushME

Image

Regards, saludos
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

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

cron