I made this test :
- Code: Select all Expand view
#include "FiveWin.ch"
#include "constant.ch"
#include "Report.ch"
#include "Image.ch"
Function test()
LOcal oDlg,oFld
Local aGet[20]
Local cClPassPort:=space(40)
Local nBottom := 32
Local nRight := 62
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
Local oFont := TFont():New( "Lucida Console", 0, 12,, )
DEFINE DIALOG oDlg ;
TITLE "test PopUp Image" ;
SIZE nWidth, nHeight TRANSPARENT PIXEL
@ 40, 3 FOLDEREX oFld Items "&Luogo di spesa abituale",;
"&Internet",;
"&Documenti",;
"&Osservazioni";
SIZE 240, 160 PIXEL;
OF oDlg// COLOR 0, 14215660
@ 10, 15 SAY "PassaPorto" OF oFld:aDialogs[ 3 ] SIZE 65, 8 PIXEL
@ 10, 100 SAY "Carta d'Identità" OF oFld:aDialogs[ 3 ] SIZE 65, 8 PIXEL
@ 10, 160 SAY "Tessera Sanitaria" OF oFld:aDialogs[ 3 ] SIZE 65, 8 PIXEL
aGet[14] := TImage():New( 2, 2, 60, 60, , If(!empty(cClPassPort),cClPassPort,".\bitmaps\immagine.bmp"), .t.,;
oFld:aDialogs[ 3 ], , , , , ,;
, .t., , , , )
aGet[14]:bRClicked := {|nRow,nCol| PopImage(nRow,nCol,aGet[14],cClPassPort) }
ACTIVATE DIALOG oDlg
retu nil
Function PopImage(nRow,nCol,oControl,cImage)
local oMenu
local cFile
MENU oMenu POPUP 2007
MENUITEM "&Carica un immagine" ;
ACTION (cImage:=PruebaFoto())
MENUITEM "&Mostra l'immagine" ;
ACTION msginfo()
ENDMENU
ACTIVATE POPUP oMenu OF oControl AT nRow, nCol
RETURN cImage
FUNCTION PruebaFoto()
local cFoto
If MsgNoYes( "Desea buscar una fotografia...","Confirme por favor..." )
cFoto := __BuscaFoto( )
? cFoto
End
Return cFoto
FUNCTION __BuscaFoto( )
local cFile
cFile := cGetFile( "BITMAP (*.bmp)| *.bmp|" + ;
"JPG (*.jpg)| *.jpg|" ;
,"Por Favor Seleccione un Archivo de Imágen" )
if ! Empty( cFile ) .and. File( cFile )
Return cFile
End
return ""