Uso de IMAGE en BROWSE

HMG Samples and Enhancements

Moderator: Rathinagiri

claudiotedesco
Posts: 132
Joined: Thu Jul 31, 2008 12:05 pm

Uso de IMAGE en BROWSE

Post by claudiotedesco »

HOLA, mi consulta es como hago para que en la columna fecha_fa aparezca la imagen "igok" si el campo fecha esta vacia en caso contrario que aparezca otra imagen "ignok"
Espero que se haya entendido lo que necesito
Gracias por la ayuda
Claudio


DEFINE BROWSE Browse_1
ROW 10
COL 10
WIDTH 750
HEIGHT 200
HEADERS { 'fallecio', 'Nombre' ,'Apellido', 'Lugar'}
WIDTHS { 40, 220 , 250, 250 }
WORKAREA OBISPOS
FIELDS { 'fecha_fa', 'nom', 'ape' , 'lugar'}
Value 1
DYNAMICBACKCOLOR { bColor , bColor, bColor, bColor }
ONHEADCLICK { {|| Activarorden(1) } , { || Activarorden(1)} , { || Activarorden(2)} }
ON CHANGE ChangeTest()
ALLOWEDIT .F.
ALLOWAPPEND .f.
ALLOWDELETE .F.
IMAGE {"igok", "ignok" }
LOCK .t.
END BROWSE
jucar_es
Posts: 82
Joined: Thu Nov 13, 2008 11:12 pm

Re: Uso de IMAGE en BROWSE

Post by jucar_es »

Hola, Pruebe cambienado el campo asi
DEFINE BROWSE Browse_1
ROW 10
COL 10
WIDTH 750
HEIGHT 200
HEADERS { 'fallecio', 'Nombre' ,'Apellido', 'Lugar'}
WIDTHS { 40, 220 , 250, 250 }
WORKAREA OBISPOS
FIELDS { 'iif(empty(fecha_fa),1,2)', 'nom', 'ape' , 'lugar'}
Value 1
DYNAMICBACKCOLOR { bColor , bColor, bColor, bColor }
ONHEADCLICK { {|| Activarorden(1) } , { || Activarorden(1)} , { || Activarorden(2)} }
ON CHANGE ChangeTest()
ALLOWEDIT .F.
ALLOWAPPEND .f.
ALLOWDELETE .F.
IMAGE {"igok", "ignok" }
LOCK .t.
END BROWSE

saludos
Juan carlos Escobar
Bogota-Colombia
claudiotedesco
Posts: 132
Joined: Thu Jul 31, 2008 12:05 pm

Re: Uso de IMAGE en BROWSE

Post by claudiotedesco »

Juan carlos Escobar

Te queria avisar que funciono correctamente lo que me indicaste del iif
Espero que esto le sirva a otra persona.
Gracias por tu ayuda
Claudio
arroya2
Posts: 172
Joined: Thu Aug 06, 2009 7:16 am

Re: Uso de IMAGE en BROWSE

Post by arroya2 »

Yo necesito hacer algo similar, en la columna lSelec, si es cierto que se vea la imagen br_ok y si no lo es que se vea la imagen br_no.
Siguiendo el consejo de jucar_es, he echo lo siguiente:

@ 10, 10 BROWSE Browse_1 OF wCategorias ;
WIDTH 514 ;
HEIGHT 300 ;
HEADERS { 'lSelec', 'Categorías', 'Descripción' } ;
WIDTHS { 60, 80, 380 } ;
WORKAREA Categori ;
FIELDS { 'If(Categori->lSelec=.T., 1, 2)', 'Categori->Cod', 'Categori->Des' } ;
FONT 'Arial' ;
SIZE 8 ;
ON DBLCLICK SelecDesCat() ;
NOLINES ;
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT } ;
IMAGE {'br_no', 'br_ok'}

pero no sale nada en la columna lSelec. ¿A que puede ser debido?

Gracias




I need to do something similar in the column lSelec if it is true that the image br_ok and see if it is not showing the image br_no.
Following the advice of jucar_es, I echo the following:

@ 10, 10 BROWSE Browse_1 OF wCategorias ;
WIDTH 514 ;
HEIGHT 300 ;
HEADERS { 'lSelec', 'Categorías', 'Descripción' } ;
WIDTHS { 60, 80, 380 } ;
WORKAREA Categori ;
FIELDS { 'If(Categori->lSelec=.T., 1, 2)', 'Categori->Cod', 'Categori->Des' } ;
FONT 'Arial' ;
SIZE 8 ;
ON DBLCLICK SelecDesCat() ;
NOLINES ;
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT } ;
IMAGE {'br_no', 'br_ok'}

but nothing comes out in column lSelec. How can that be so?

Thank you
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Uso de IMAGE en BROWSE

Post by gfilatov »

arroya2 wrote:I need to do something similar in the column lSelec if it is true that the image br_ok and see if it is not showing the image br_no.
Following the advice of jucar_es, I echo the following:

@ 10, 10 BROWSE Browse_1 OF wCategorias ;
WIDTH 514 ;
HEIGHT 300 ;
HEADERS { 'lSelec', 'Categorías', 'Descripción' } ;
WIDTHS { 60, 80, 380 } ;
WORKAREA Categori ;
FIELDS { 'If(Categori->lSelec=.T., 1, 2)', 'Categori->Cod', 'Categori->Des' } ;
FONT 'Arial' ;
SIZE 8 ;
ON DBLCLICK SelecDesCat() ;
NOLINES ;
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT } ;
IMAGE {'br_no', 'br_ok'}

but nothing comes out in column lSelec. How can that be so?
Hi,

Take a look for sample at your folder hmg\samples\browse.8 :idea:
I hope that give you an idea, f.e.
...
FIELDS { 'Categori->lSelec', 'Categori->Cod', 'Categori->Des' } ;
...
IMAGE {'br_no', 'br_ok'}
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
arroya2
Posts: 172
Joined: Thu Aug 06, 2009 7:16 am

Re: Uso de IMAGE en BROWSE

Post by arroya2 »

gfilatov wrote: Hi,

Take a look for sample at your folder hmg\samples\browse.8 :idea:
I hope that give you an idea, f.e.
...
FIELDS { 'Categori->lSelec', 'Categori->Cod', 'Categori->Des' } ;
...
IMAGE {'br_no', 'br_ok'}
Español:
Hola, me he basado en el ejemplo que me indicas. No entiendo porqué funciona en ese ejemplo y en mi programa no.
He utilizado las mismas imágenes. He colocado las imágenes en el mismo directorio que la aplicación. Y aún así, sigue sin funcionar.
¿Hay que hacer algo más en otro sitio?

Intento escribir frases cortas para que el traductor funcione bien.

Gracias

English:
Hi, I have based on the example that I provided. I do not understand why it works in this instance and not on my agenda.
I used the same images. I've placed the images in the same directory as the application. And yet, still not working.
Should we do something else somewhere else?

I try to write short phrases that the translator works.

Thank you
arroya2
Posts: 172
Joined: Thu Aug 06, 2009 7:16 am

Re: Uso de IMAGE en BROWSE

Post by arroya2 »

Español
Hola, perdornarme por mi insistencia.

A ver si alguien me puede decir que tengo mal en la definición de este Browse:

@ 10, 10 BROWSE Browse_1 OF wCategorias ;
WIDTH 514 ;
HEIGHT 300 ;
HEADERS { 'lSelec', 'Categorías', 'Descripción' } ;
WIDTHS { 60, 80, 380 } ;
WORKAREA Categori ;
FIELDS { 'Categori->lSelec', 'Categori->Cod', 'Categori->Des' } ;
VALUE 1 ;
FONT 'Arial' ;
SIZE 8 ;
ON DBLCLICK SelecDesCat() ;
NOLINES ;
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT } ;
IMAGE {"br_no", "br_ok"}

Yo creo que está igual que en el ejemplo del Browse.8. En la columna lSelec no sale nada. Ni imagen ni texto

Gracias

English
Hello, forgive my insistence.

Let's see if someone can tell me that I am wrong in defining such Browse:

@ 10, 10 BROWSE Browse_1 OF wCategorias ;
WIDTH 514 ;
HEIGHT 300 ;
HEADERS { 'lSelec', 'Categorías', 'Descripción' } ;
WIDTHS { 60, 80, 380 } ;
WORKAREA Categori ;
FIELDS { 'Categori->lSelec', 'Categori->Cod', 'Categori->Des' } ;
VALUE 1 ;
FONT 'Arial' ;
SIZE 8 ;
ON DBLCLICK SelecDesCat() ;
NOLINES ;
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT } ;
IMAGE {"br_no", "br_ok"}


I think that is the same as in the example of Browse.8. In column lSelec nothing comes out. Neither text nor image

Thank you
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Uso de IMAGE en BROWSE

Post by luisvasquezcl »

Hola Arroya2
No sé si solucionaste el problema o no, pero igual voy a contestar este post ya que no hay respuesta de resolución al problema.
Comparando tu codigo con el que aparece en Samples\Browse_7\demo.prg veo algunas diferencias con respecto a tu código:
1. En los widths el campo de la imagen es 0.
2. En el justify, la justificación no lleva nada en el campo de la imagen.
Los cambios estan en negrita a continuación de la linea con problema en Bold e italic, deberás cambiar tu código con las correcciones sugeridas, por lo tanto debería quedar asi:
@ 10, 10 BROWSE Browse_1 OF wCategorias ;
WIDTH 514 ;
HEIGHT 300 ;
HEADERS { 'lSelec', 'Categorías', 'Descripción' } ;
WIDTHS { 60, 80, 380 } ; { 0, 80, 380}
WORKAREA Categori ;
FIELDS { 'Categori->lSelec', 'Categori->Cod', 'Categori->Des' } ;
VALUE 1 ;
FONT 'Arial' ;
SIZE 8 ;
ON DBLCLICK SelecDesCat() ;
NOLINES ;
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT } ;
JUSTIFY { , BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT };
IMAGE {"br_no", "br_ok"}

espero te sea de ayuda.
Por favor informanos si solucionaste el problema.
arroya2
Posts: 172
Joined: Thu Aug 06, 2009 7:16 am

Re: Uso de IMAGE en BROWSE

Post by arroya2 »

Español:

Hola Luis.

He hecho las modificaciones que me indicas y siguen sin aparecer las imágenes en el Browse.
¿Hay que configurar algo más en algún otro sitio?

Gracias



English:

Hello Luis

I made the changes and tells me that still appear
Browse the images.
Is there something else that set somewhere else?

Thank you
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Uso de IMAGE en BROWSE

Post by luisvasquezcl »

Estimado,
creo que tengo la solución:
1.las imagenes que llamas como "br_no", "br_ok" debes tenerlas definidas en un archivo .rc para que los pueda leer.
EJEMPLO DE DEFINICION ARCHIVO .RC
Main.rc
br_no bitmap br_no.bmp
br_ok bitmap br_ok.bmp

2. Si las imagenes las lees directo del disco debes poner "c:\carpeta\br_no.bmp","c:\carpeta\br_ok.bmp"

espero que esto sea solucion.
Suerte.
Luis Vasquez
Post Reply