GRID with image help
Moderator: Rathinagiri
GRID with image help
how to use grid with image : in my app i use :
@ 56,10 GRID grid_1 ;
WIDTH 290 ;
HEIGHT 660 ;
HEADERS {'...','RECIBO' } ;
IMAGE {'\icones\bmp\pago.BMP','\icones\bmp\aberto.BMP'} ;
WIDTHS { 50, 200 } ;
ROWSOURCE "COBRANCA" ;
COLUMNFIELDS { VERIFICAIMAGE() ,'COBRANCA->ANO+COBRANCA->MES+COBRANCA->CODIMOVEL' } ;
JUSTIFY { GRID_JTFY_CENTER, GRID_JTFY_CENTER } ;
//DYNAMICDISPLAY { val(VERIFICAIMAGE()), { || This.CellValue} } ;
ON CHANGE Atualizar() //refresh controls the form
static Function VERIFICAIMAGE()
Local nIndice:=0
If PAGO == 'P'
/*em DIA*/
nIndice:=0
Endif
iF PAGO == 'A'
/*em atraso*/
nIndice:=1
Endif
how to use image in this case.
thanks
Marcos
@ 56,10 GRID grid_1 ;
WIDTH 290 ;
HEIGHT 660 ;
HEADERS {'...','RECIBO' } ;
IMAGE {'\icones\bmp\pago.BMP','\icones\bmp\aberto.BMP'} ;
WIDTHS { 50, 200 } ;
ROWSOURCE "COBRANCA" ;
COLUMNFIELDS { VERIFICAIMAGE() ,'COBRANCA->ANO+COBRANCA->MES+COBRANCA->CODIMOVEL' } ;
JUSTIFY { GRID_JTFY_CENTER, GRID_JTFY_CENTER } ;
//DYNAMICDISPLAY { val(VERIFICAIMAGE()), { || This.CellValue} } ;
ON CHANGE Atualizar() //refresh controls the form
static Function VERIFICAIMAGE()
Local nIndice:=0
If PAGO == 'P'
/*em DIA*/
nIndice:=0
Endif
iF PAGO == 'A'
/*em atraso*/
nIndice:=1
Endif
how to use image in this case.
thanks
Marcos
- Amarante
- Posts: 182
- Joined: Fri Apr 27, 2012 9:44 pm
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
- Location: Araruama-RJ, Brazil
Re: GRID with image help
--------------- Portugues
No meu caso Eu uso COLUMNWHEN porque o usuário pode mudar a imagem com o double click do mouse, mas depende do que você quer fazer
-----------------------English
In my case I use COLUMNWHEN because the user can change the image with the double click of the mouse, but it depends what you want to do
No meu caso Eu uso COLUMNWHEN porque o usuário pode mudar a imagem com o double click do mouse, mas depende do que você quer fazer
-----------------------English
In my case I use COLUMNWHEN because the user can change the image with the double click of the mouse, but it depends what you want to do
Re: GRID with image help
Obrigado pela resposta mas columwhen nao e para validação. Desculpe nao entendi
Re: GRID with image help
Eu so gostaria de a cada linha carregada exibir um icone .
Seo o status da fatura estivar paga exibir um icone verde
se o staus da fatura nao estiver paga exibir icone vermelho.
espero ter conseguido explicar, mas muito obrigado pela atenção
Seo o status da fatura estivar paga exibir um icone verde
se o staus da fatura nao estiver paga exibir icone vermelho.
espero ter conseguido explicar, mas muito obrigado pela atenção
- vagblad
- Posts: 160
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: GRID with image help
Hello maaupe,
If i understood correctly what you wanna do, here is how i do it with Grid control:
Inside the IMAGE { } you put the image files you want to use. In my case i used 2 files.
Notice that i have left the 1st column of the grid empty.
Add items to the grid control like this:
In the above example the grid at row 1,col1 will have the Green.bmp and at row 2,col 1 will have the Red.bmp.
It's all about the values in the 1st column. 0 and 1
I hope it helps
Best Regards
Vag
P.S.: I forgot to say that you can see an excellent example of grid and images at : \SAMPLES\Controls\Grid\GRID_19
If i understood correctly what you wanna do, here is how i do it with Grid control:
Code: Select all
DEFINE GRID Grid_1
ROW 10
COL 10
WIDTH 530
HEIGHT 500
ITEMS {{ "","", "", "", "" }}
WIDTHS { 20,100, 100, 150, 100 }
HEADERS { "", "Invoice No.", "Date", "Supplier", "Value" }
FONTNAME 'Arial'
FONTSIZE 12
TOOLTIP ''
IMAGE { 'GREEN.BMP' ,'RED.BMP' }
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_RIGHT, BROWSE_JTFY_RIGHT, BROWSE_JTFY_RIGHT, BROWSE_JTFY_LEFT }
END GRID
Notice that i have left the 1st column of the grid empty.
Add items to the grid control like this:
Code: Select all
MainForm.Grid_1.AddItem({ 0, "1234", "10/6/2014", "Supplier 1", "1200.20" })
MainForm.Grid_1.AddItem({ 1, "1235", "11/6/2014", "Supplier 2", "800.45" })
It's all about the values in the 1st column. 0 and 1
I hope it helps
Best Regards
Vag
P.S.: I forgot to say that you can see an excellent example of grid and images at : \SAMPLES\Controls\Grid\GRID_19
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
Re: GRID with image help
Thank you. Vagblad
I can not do this by loading the grid from a table?
using rowsource?
only through an array?
\ samples \ gri.xx only with array
rowsource without using images.
thank you
im sorry idont speak english very well
Marcos
I can not do this by loading the grid from a table?
using rowsource?
only through an array?
\ samples \ gri.xx only with array
rowsource without using images.
thank you
im sorry idont speak english very well
Marcos
- vagblad
- Posts: 160
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: GRID with image help
Maaupe try this:
I am attaching the example files also. (With the 2 images needed and the simple .dbf file i used)
Feel free to ask if you want any more help
Best Regards
Vag
Code: Select all
#include "hmg.ch"
FUNCTION Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 800 ;
HEIGHT 600 ;
TITLE 'Grid And Dbf With Status Images' ;
MAIN
USE TEST
GO TOP
DEFINE GRID Grid_1
ROW 10
COL 10
WIDTH 770
HEIGHT 440
HEADERS {'Status', 'First','Last','Invoice','Date','Supplier','Money'}
WIDTHS {50,140,140,100,100,100,100}
ROWSOURCE "Test"
IMAGE { 'green.bmp', 'red.bmp' }
COLUMNFIELDS { 'status', 'firstname' , 'lastname' , 'invoiceno' , 'date' , 'supplier' , 'money' }
JUSTIFY { BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT, BROWSE_JTFY_CENTER, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT }
END GRID
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
RETURN
Feel free to ask if you want any more help
Best Regards
Vag
- Attachments
-
- Example.zip
- (1.27 MiB) Downloaded 379 times
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
-
- Posts: 682
- Joined: Tue Jun 04, 2013 6:33 pm
- Location: Argentina
Re: GRID with image help
Hi Vagblad:
I've download your example, and my surprise becomes when i execute your exe: no readable data of the table.- I attach the screen.-
Do you have the same result.-
Thanks for your answer.-
With regards. Eduardo
I've download your example, and my surprise becomes when i execute your exe: no readable data of the table.- I attach the screen.-
Do you have the same result.-
Thanks for your answer.-
With regards. Eduardo
- Attachments
-
- SCREEN_OF_EXAMPLE.jpg (87.98 KiB) Viewed 6161 times
- vagblad
- Posts: 160
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: GRID with image help
Hi Eduardo,EduardoLuis wrote:Hi Vagblad:
I've download your example, and my surprise becomes when i execute your exe: no readable data of the table.- I attach the screen.-
Do you have the same result.-
Very strange. Try putting the Example folder inside the hmg\samples folder and run the build.bat again.
Because the .exe works fine on me.
I tested mine at the following path: C:\hmg.3.3.0\SAMPLES\Example\build.bat
Please if you can try it and tell me if it works.
Best Regards
Vag
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
Re: GRID with image help
thanks vagblad.
undestand but i use status char(1) and array index is numeric
status = 'P' or ='A'
dinamcDysplay ?
best regards
good night
Marcos
undestand but i use status char(1) and array index is numeric
status = 'P' or ='A'
dinamcDysplay ?
best regards
good night
Marcos