FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Consulta de TImage (Solucionado)
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Consulta de TImage (Solucionado)
Posted: Mon May 22, 2017 04:12 AM
Amigos del foro ;

Si alguien pudiera ayudarme

Esto es parte de mi codigo

Code (fw): Select all Collapse
cFoto    := (cAliasPer)->numemp + ".JPG"
   if(!file(cFoto), (cFoto := oApp:xDatos + "Fotos\" + "nohayfoto.JPG"),)

   DEFINE WINDOW oWChild mdichild of oApp:oWnd title "Control de Personal" ;
      from 00,00 TO 00,00 nomaximize

   DEFINE FONT  fBusca  NAME "Tahoma" SIZE 0,-12 bold     OF oDlg

   DEFINE DIALOG oDlg RESOURCE "DLG_PERSONAL" OF oWChild TRANSPARENT

      oBrw := TXBrowse():New( oDlg )
      oBrw :CreateFromResource(500)
      oBrw :cAlias := (cAliasPer)

      oBrw :nMarqueeStyle       := MARQSTYLE_HIGHLROW
      oBrw :nColDividerStyle    := LINESTYLE_LIGHTGRAY
      oBrw :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
      oBrw :lColDividerComplete := .t.
      oBrw :bClrStd    := { || If( oBrw:KeyNo() % 2 == 0, ;
                                   { CLR_BLACK, RGB( 224, 236, 255 ) }, ;
                                 { CLR_BLACK, RGB( 189, 211, 253 ) } ) }
      oBrw :bClrSel       := {|| { nRGB(  0,  0,255), aGradBarSel } }  // para barra de linea selecc cuando el control no tiene el foco
      oBrw :bClrSelFocus := { || { CLR_BLACK, aGradBarSelFocus } }     // para barra de linea selecc cuando el control tiene el foco

      oBrw :nFreeze             := 1
      oBrw :nFooterLines        := 1

      oCol := oBrw:AddCol()
      oCol:bStrData  := { || (cAliasPer)->numemp }
      oCol:cHeader   := "Empleado"
      oCol:nWidth        := 70
      oCol:nDataStrAlign := AL_LEFT
      oCol:bLClickHeader := { || CambiaIndice( cAliasPer, 1, oBrw, @cSayInd, oDlg ), oBrw:gotop() }

      oCol := oBrw:AddCol()
      oCol:bStrData := { || (cAliasPer)->nomcom}
      oCol:cHeader  := "Nombre"
      oCol:nWidth        := 300
      oCol:nDataStrAlign := AL_LEFT
      oCol:bLClickHeader := { || CambiaIndice( cAliasPer, 2, oBrw, @cSayInd, oDlg ), oBrw:gotop() }

      oBrw:bKeyChar := {|nKey| IIF(nKey=13,f_Empleados(2),) }

      oBrw:bChange := {|nKey| (cSay1 := iif(EMPTY((cAliasPer)->fecbaj), "Activo", "Baja"), ;
                               cSay2 := ALLTRIM((cAliasPer)->puesto), ;
                               cSay3 := (cAliasPer)->numemp, ;
                               cSay4 := ALLTRIM((cAliasPer)->regfed), ;
                               cSay5 := ALLTRIM((cAliasPer)->regims), ;
                               cSay6 := PoneFecha( @cSay6, oDlg), ;
                               cSay7 := DToC((cAliasPer)->fecbaj), ;
                               cFoto := oApp:xDatos + "Fotos\" + (cAliasPer)->numemp + ".JPG", ;
                               iif(!file(cFoto), (cFoto := oApp:xDatos + "Fotos\" + "nohayfoto.JPG"),), ;
                               PonFoto(oImage,cFoto,oDlg), ;
                               oDlg:Update() ) }

      oBrw:bLDblClick:= { || f_Empleados(2) }             //si hacemos doble click sobre una PERSONA la seleccinamos y cargamos sus datos en las viables que necesitamos

      oBrw:bSeek := { |c| (cAliasPer)->(DbSeek( Upper(c) )) }

   REDEFINE IMAGE oImage VAR cFoto       ID 601 OF oDlg UPDATE ;
      ADJUST

   ACTIVATE DIALOG oDlg Valid oWChild:End() nowait on init (oninit( oDlg ), PonFoto(oImage,cFoto,oDlg), oImage:LoadImage( ,  cFoto), oBrw:refresh(), oDlg:Update()); oDlg:move(0,0)
      oWChild:bgotfocus:={||oDlg:setfocus()}

   ACTIVATE WINDOW oWChild ON INIT (oWChild:setsize(oDlg:nwidth,oDlg:nheight), oWChild:Move(20,20)) ;
      VALID (DbCerrar( oWChild, cMen, 2 ))

RETURN NIL

STATIC FUNCTION PonFoto(oImage,cFoto,oDlg)
   /*IF !FILE(cFoto)
      cFoto := oApp:xDatos + "Fotos\" + "NOHAYFOTO.JPG"
   ENDIF*/
   oImage:LoadImage(,cFoto)
   //oImage:Refresh()
   //oDlg:Refresh()

RETURN NI


imagen
<a href="http://www.freeimagehosting.net/commercial-photography/"><img src="http://i.imgur.com/hJ8utwY.jpg" alt="commercial photography locations"></a>

No se muestra la imagen al entrar a la opcion, solo hasta que me muevo de registro

De antemano muchas gracias
Juan Arroyo
México
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Consulta de TImage
Posted: Mon May 22, 2017 01:36 PM

\samples\SILVIO.PRG

Saluod.s

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Re: Consulta de TImage (Solucionado)
Posted: Mon May 22, 2017 02:09 PM

Karinha

Muchas gracias

Fijate que quedo solucionado cambiando esta linea

ACTIVATE DIALOG oDlg Valid oWChild:End() nowait on init (oninit( oDlg ), PonFoto(oImage,cFoto,oDlg), oImage:LoadImage( , cFoto), oBrw:refresh(), oDlg:Update()); oDlg:move(0,0)

Por esta
ACTIVATE DIALOG oDlg Valid oWChild:End() nowait on init (oninit( oDlg ), PonFoto(oImage,cFoto,odlg), oBrw:gotop()); oDlg:move(0,0)

Juan Arroyo
México
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com

Continue the discussion