// images
REDEFINE IMAGE oImage ID 701 FILENAME NIL of oUsers ;
PIXEL ADJUST BORDER
oImage:bPainted := { |hDC| DRAW_IMG( oImage, hDC, cImage, cPicFileName ) }
REDEFINE GET oGET var cImage ID 706 of oUsers PICTURE "@!" READONLY // displays the filename only
REDEFINE BTNBMP oButt4 ID 702 of oUsers ;
RESOURCE "ADD16","DADD16","DADD16" ;
PROMPT "Import " LEFT 2007;
ACTION ( GetImage( @oImage,oRsPet,oUsers,@cImage,oGet,@cPicFileName ),;
_ChkButtons( cMode,oRsPet,oButt4,oButt5,oButt6,oButt7))
REDEFINE BTNBMP oButt5 ID 703 of oUsers ;
RESOURCE "EDIT16","DEDIT16","DEDIT16" ;
PROMPT "Export " LEFT 2007;
ACTION ( ExportImage( oRsPet,0 ) )
REDEFINE BTNBMP oButt6 ID 704 of oUsers ;
RESOURCE "DELETE16","DDELETE16", "DDELETE16" ;
PROMPT "Delete " LEFT 2007;
ACTION ( DelImage(@oImage,oRsPet,oUsers,oGet,@cImage,@cPicFileName ),;
_ChkButtons( cMode,oRsPet,oButt4,oButt5,oButt6,oButt7))
REDEFINE BTNBMP oButt7 ID 705 of oUsers ;
RESOURCE "VIEW16","DVIEW16","DVIEW16" ;
PROMPT "Print " LEFT 2007;
ACTION ( PrintImage( oRsPet,0 ) )
// end images
//------------- Image-Brush from Uwe ----------
Static FUNC Draw_Img( oImage, hDC, cImage, cPicFileName )
LOCAL oBrush,cDefa
LOCAL aRect := GETCLIENTRECT( oImage:hWnd )
cDefa := set(7)
If cPicFileName = " " // ad mode because blank .. cImage passed as is
Else
cImage := cDefa+"\Pictures\"+alltrim( cImage )
Endif
// added for on paint
SysReFresh()
IF FILE( cImage )
DEFINE IMAGE oBrush FILENAME cImage
PalBmpDraw( hDC, 0, 0, oBrush:hBitmap, , aRect[4], aRect[3] )
oBrush:End()
ENDIF
RETURN( NIL )
//----------------------------------------------------------------------------//
Static Func DelImage( oImage,oRsPet,oDlg,oGet,cImage,cPicFileName )
LOCAL Saying,cFILE,cDefa
cDefa := set(7)
cFile := oRsPet:Fields("PicFileName"):Value
If cFile = " " .or. empty( cFile )
Saying := "Sorry .. there is no Image to Delete"
MsgInfo( Saying )
Return(.f.)
Endif
Saying := "Are you SURE you want to Delete this Image ?"+chr(10)
Saying += cFile
If MsgNoYes( Saying )
Ferase(cDefa+"\Pictures\"+alltrim(cFile))
cImage := " "
oGet:Refresh()
oImage:Refresh()
oDlg:ReFresh()
SysReFresh()
cPicFileName := space(50)
oRsPet:Fields("PicFileName"):Value := cPicFileName
oRsPet:Update()
SysReFresh()
Endif
Return(nil)