FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda Cambiar el Color de un SAY "SOLUCIONADO"
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Ayuda Cambiar el Color de un SAY "SOLUCIONADO"
Posted: Wed Jun 10, 2020 10:09 PM
Hola Amigos.

Quiz谩s sea muy b谩sico, pero estoy cambiando la forma de mostrar los datos en pantalla y me he encontrado con un problema que no logro solucionar.

Lo que necesito es poder mostrar los datos en un Dialogo, como por ejemplo Nombre, Rut y Direcci贸n, que se encuentran en la Dbf, pero quiero en el fondo de Say, tome un color que le asigno y que solo sea el largo del texto que trae el registro y no logro dar con la solucion, lo unico que logre fue cambiar el color del Font.

Muchos Saludos

Antonio

Este es parte del codigo:
Code (fw): Select all Collapse
聽 聽DEFINE DIALOG oDlg2 SIZE 600,570 PIXEL TRUEPIXEL FONT oFont2 聽 STYLE nOr( WS_POPUP, WS_VISIBLE, WS_DLGFRAME )

聽 聽 聽@ 10,150 SAY otitu PROMPT " MUESTRA PROFESIONAL " 聽PIXEL OF oDlg2 COLORS RGB(0,100,0) 聽 FONT oFont5

聽 聽 聽@ 055,050 SAY 聽"C贸digo :" 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽SIZE 100,20聽 聽 聽 聽 聽PIXEL OF oDlg2 聽RIGHT 聽 聽 FONT oFont6
聽 聽 聽@ 105,050 SAY "Nombre :" 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽SIZE 100,20聽 聽 聽 聽 聽PIXEL OF oDlg2 聽RIGHT 聽 聽 FONT oFont6
聽 聽 聽@ 130,050 SAY "R.u.t. :" 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽SIZE 100,20聽 聽 聽 聽 聽PIXEL OF oDlg2 聽RIGHT 聽 聽 FONT oFont6

聽 聽 聽 聽 聽// Aqui necesito que estos Say, tengan un fondo en color y solo del largo del texto de la variable no considerando los caracteres en blanco.

聽 聽 聽@ 053,160 SAY Profe->Cod_Pro 聽 聽 聽 SIZE 60,22 聽PIXEL OF oDlg2 聽 聽 聽 聽 聽COLOR RGB(0,0,128) 聽 FONT oFont6 聽 BORDER 聽CENTER
聽 聽 聽@ 105,160 SAY Profe->Nom_Doc 聽 聽 聽 SIZE 350,22 聽PIXEL OF oDlg2 聽 聽 聽COLOR RGB(0,0,128) 聽 FONT oFont6
聽 聽 聽@ 130,160 SAY Profe->Rut_Pro 聽 聽 聽 SIZE 160,22 PIXEL OF oDlg2 聽 聽 聽 聽 COLOR RGB(0,0,128) 聽 FONT oFont6
.....
.....
FWH 22.10 - HARBOUR - PELLES C
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Ayuda Cambiar el Color de un SAY ??
Posted: Thu Jun 11, 2020 12:08 PM
Don't know if this is what you are looking for .. I use this code to apply a specific font and color to a specific say .. from resources

Code (fw): Select all Collapse
REDEFINE SAY oSay19 聽ID 151 of oGrps UPDATE 聽 聽
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oSay19:SetFont( oFontB )
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oSay19:SetColor(nRgb(7,7,224)) 聽 聽 聽// blue


oSay is the text value of the resource ID 151 .. or you could do it like this

Code (fw): Select all Collapse
cSay19 := "This is some text"

SAY oSay19 聽var cSay 聽of oGrps UPDATE 聽 聽
聽 聽 聽 聽oSay19:SetFont( oFontB )
聽 聽 聽 聽oSay19:SetColor(nRgb(7,7,224)) 聽 聽 聽// blue


Hope this is what you are looking for ..

Rick Lipkin
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda Cambiar el Color de un SAY ??
Posted: Thu Jun 11, 2020 03:21 PM
Hola Rick

Muchas gracias por responder.

Lamentablemente no me funciona, solo cambia el color del Texto, algo que si puedo hacer, pero no logra poner un color en el fondo del texto, es lo basico que necesito.

Incluso le agregue 2 colores, pensando obtener color texto y fondo, pero no logro dar con el requerimiento.

Pense que seria mas facil y que mi pregunta era muy basica, pero me doy cuenta no es algo comun.

Como siempre sigo molestando para lograr el requerimiento que se me ha planteado.

Muchos Saludos.

Antonio

Aplique lo que me indicaste y adem谩s modifique tu c贸digo quedando as铆:
Code (fw): Select all Collapse
聽 聽 聽@ 200,160 SAY oSay1 Var Profe->Nom_Pro 聽 聽 聽 SIZE 350,22 PIXEL OF oDlg2 聽 PICTURE "@!" 聽UPDATE 聽 聽// CUEBANNER "User Id"
聽 聽 聽 聽 聽 聽 聽 聽 oSay1:SetFont( oFont6 )
聽 聽 聽 聽聽 聽 聽 聽 聽oSay1:SetColor(RGB(0,0,128), RGB(82,171,38))
FWH 22.10 - HARBOUR - PELLES C
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 04:28 PM
Try this function .. This sets the background to the color of your choice of the active get .. again, may or may not what be are looking for ..

Code (fw): Select all Collapse
SetGetColorFocus( rgb(209,224,252) ) 聽 聽 聽// color for gets


Place this above code before your fields and this code at the end of your code to set the get background back to normal.

Code (fw): Select all Collapse
SetGetColorFocus( CLR_WHITE ))



Rick Lipkin
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 06:02 PM

Hola Rick

Reitero las gracias por tu interes y disponibilidad de ayudarme.

Lo que me indicas, lo uso para los GET cuando corresponde a la actualizaci贸n de datos, pero para este caso, solo se necesita mostrar los datos y no permitir su actualizaci贸n, es por este motivo que uso SAY.

Me pregunto como lo haran otros colegas o no es la forma correcta o que me permite Fivewin, para solo mostrar datos en un dialogo por pantalla.

Muchos Saludos.
Anotio.

FWH 22.10 - HARBOUR - PELLES C
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 06:41 PM
Hola Antonio, intenta asi:
local oSay1,oSay2,oSay3
Code (fw): Select all Collapse
     @ 053,160 SAY oSay1 Profe->Cod_Pro      SIZE 60,22  PIXEL OF oDlg2    COLOR RGB(0,0,128), CLR_YELLOW   FONT oFont6   BORDER  CENTER
     @ 105,160 SAY oSay2 Profe->Nom_Doc    SIZE 350,22  PIXEL OF oDlg2  COLOR RGB(0,0,128) , CLR_YELLOW  FONT oFont6
     @ 130,160 SAY oSay3 Profe->Rut_Pro      SIZE 160,22 PIXEL OF oDlg2   COLOR RGB(0,0,128) , CLR_YELLOW  FONT oFont6

Saludos.
Francisco J. Alegr铆a P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 06:59 PM
Hola Francisco,

Amigo como estas?

Muchas gracias por responder.

Tu codigo sugerido me arroja un error, lo modifique pero igual NO funciona, no se si alguien lo ha logrado, que error puedo estar cometiendo, pero finalmente no logro dar con la soluci贸n y los tiempos se vienen encima.

Muchos Saludos
Antonio

As铆 deje tu codigo, tuve agregar Var:
Code (fw): Select all Collapse
@ 200,160 SAY oSay1 Var Profe->Nom_Doc    SIZE 350,22  PIXEL OF oDlg2  COLOR RGB(0,0,128) , CLR_YELLOW  FONT oFont6
FWH 22.10 - HARBOUR - PELLES C
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 07:13 PM

Antonio, pon el c贸digo que utilizas para definir el di谩logo que hace de contenedor de los says

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 07:25 PM

Hola Cristobal.

Muchas gracias por responder.

Si entiendo bien tu respuesta, te refieres a esto:
DEFINE DIALOG oDlg2 SIZE 600,570 PIXEL TRUEPIXEL FONT oFont2 STYLE nOr( WS_POPUP, WS_VISIBLE, WS_DLGFRAME )

Si es asi, le saque el Style, no hay cambios, sigue sin funcionar, quiz谩s sea alg煤n error que estoy cometiendo, pero no doy con el.

Muchos Saludos,
Antonio

FWH 22.10 - HARBOUR - PELLES C
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 08:13 PM
Antonio, en el ON INIT del ACTIVATE, ponle

ON INIT MsgInfo( oDlg:lTransparent )

y dime qu茅 te aparece
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 08:33 PM

Hola Cristobal

Muchas gracias.

Al aplicar lo que dices.

Me muestra un mensaje: .T.

Muchos Saludos
Antonio

FWH 22.10 - HARBOUR - PELLES C
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 08:35 PM
Ok, despu茅s del DEFINE DIALOG pon

oDlg:lTransparent := .F.

y prueba
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda Cambiar el Color de un SAY "URGENTE"
Posted: Thu Jun 11, 2020 08:48 PM

Hola Cristobal,

Grande Maestro, como siempre, funciono perfecto.

Eternamente agradecido, mil gracias.

Muchos Saludos
Antonio

FWH 22.10 - HARBOUR - PELLES C

Continue the discussion