FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour No me funciona la clausula password en un get desde c贸digo
Posts: 188
Joined: Wed Feb 01, 2006 06:59 PM
No me funciona la clausula password en un get desde c贸digo
Posted: Thu Jun 23, 2011 01:28 AM
Lo que he hecho es coger la funci贸n MsgGet nativa de FiveWin xHarbour 907 y modificarla para que cuando mi variable lOculto sea .T. el get se muestre como un password, pero llevo intentando de todo y buscando todo tipo de informaci贸n y no consigo que funcione, nunca me aparecen los c铆rculos negros

Code (fw): Select all Collapse
FUNCTION MsgGet( cTitle, cText, uVar, cBmpFile, cResName, lOculto)
LOCAL oDlg, oGet, oBmp, uTemp:=uVar, lOk:=.F., oFnt
DEFAULT cTitle:="", cText:="", lOculto:=.F.
DEFINE FONT oFnt NAME "Tahoma" SIZE 0,-12
DEFINE DIALOG oDlg FROM 10, 20 TO 18, 59.5 TITLE cTitle FONT oFnt
聽 聽 IF ! Empty( cBmpFile ) .OR. ! Empty( cResName )
聽 聽 聽 聽 IF ! Empty( cBmpFile )
聽 聽 聽 聽 聽 聽 @ 1, 1 BITMAP oBmp FILENAME cBmpFile SIZE 20, 20 NO BORDER OF oDlg ADJUST TRANSPARENT
聽 聽 聽 聽 ENDIF
聽 聽 聽 聽 IF ! Empty( cResName )
聽 聽 聽 聽 聽 聽 @ 1, 1 BITMAP oBmp RESOURCE cResName SIZE 20, 20 NO BORDER OF oDlg ADJUST TRANSPARENT
聽 聽 聽 聽 ENDIF
聽 聽 聽 聽 @ 0.5, 6 SAY cText OF oDlg SIZE 250, 10
聽 聽 聽 聽 @ 1.6, 4 GET oGet VAR uTemp SIZE 80, 12 OF oDlg RIGHT PICTURE "99999999" PASSWORD
聽 聽 ELSE
聽 聽 聽 聽 @ 0.5, 3.3 SAY cText OF oDlg SIZE 250, 10
聽 聽 聽 聽 @ 1.6, 2.3 GET oGet VAR uTemp SIZE 80, 12 OF oDlg RIGHT PICTURE "99999999" PASSWORD
聽 聽 ENDIF
聽 聽 聽 聽 IF( lOculto, oGet:lPassword:=.T., oGet:lPassword:=.F.)
聽 聽 聽 聽 oGet:cTooltip:={ "Medite antes de ingresar cualquier valor","SicefWin "+cVersSW,1,CLR_WHITE,CLR_GREEN }
聽 聽 @ 2.25, 7.5 - If( oBmp==nil, 4, 2 ) BUTTON "&Aceptar" 聽OF oDlg SIZE 35, 12 ACTION ( oDlg:End(), lOk:=.T. ) DEFAULT
聽 聽 @ 2.25, 16.5 - If( oBmp==nil, 4, 2 ) BUTTON "&Cancelar" OF oDlg SIZE 35, 12 ACTION ( oDlg:End(), lOk:=.F. )
聽 聽 oDlg:lHelpIcon:= .F.
ACTIVATE DIALOG oDlg CENTERED ON INIT oDlg:SetIcon(oApp:cIcono)
If lOk
聽 聽 uVar:=uTemp
Endif
oFnt:End()
Return lOk


Dejo el ejemplo para ver si alguien me puede dar una mano, a ver que hago mal.

Saludos

Fernando Espinoza
Saludos



Fernando Espinoza
Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Thu Jun 23, 2011 01:45 AM

Hola, prueba asi:
IF( lOculto, oGet:lPassword:=.T., oGet:lPassword:=.F., oGet:Refresh()

Salu2)

Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Thu Jun 23, 2011 01:46 AM
Willi Quintana wrote:Hola, prueba asi:
IF( lOculto, oGet:lPassword:=.T., oGet:lPassword:=.F.)
oGet:Refresh()

Salu2)
Posts: 188
Joined: Wed Feb 01, 2006 06:59 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Thu Jun 23, 2011 02:46 AM

Willy

Gracias por la respuesta, pero no me funciona, sigue igual.

Saludos

Saludos



Fernando Espinoza
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Thu Jun 23, 2011 05:37 AM
Fernando,

Prueba a quitar la cla煤sula RIGHT. Aqui funciona bien asi:

Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function MsgGet( cTitle, cText, uVar, cBmpFile, cResName, lPassword )

   local oDlg, oBmp
   local uTemp := uVar
   local lOk   := .f.

   DEFAULT cText := "", lPassword := .F.

   DEFINE DIALOG oDlg FROM 10, 20 TO 18, 59.5 TITLE cTitle

   if ! Empty( cBmpFile ) .or. ! Empty( cResName )
      if ! Empty( cBmpFile )
         @ 1, 1 BITMAP oBmp FILENAME cBmpFile SIZE 20, 20 NO BORDER OF oDlg
      endif

      if ! Empty( cResName )
         @ 1, 1 BITMAP oBmp RESOURCE cResName SIZE 20, 20 NO BORDER OF oDlg
      endif

      @ 0.5, 6 SAY cText OF oDlg SIZE 250, 10
      
      if ! lPassword
         @ 1.6, 4 GET uTemp SIZE 120, 12 OF oDlg
      else   
         @ 1.6, 4 GET uTemp SIZE 120, 12 OF oDlg PASSWORD
      endif
   else   
      @ 0.5, 3.3 SAY cText OF oDlg SIZE 250, 10
      if ! lPassword
         @ 1.6, 2.3 GET uTemp SIZE 120, 12 OF oDlg
      else
         @ 1.6, 2.3 GET uTemp SIZE 120, 12 OF oDlg PASSWORD
      endif
   endif   

   @ 2.25, 7.5 - If( oBmp == nil, 2, 0 ) BUTTON "&Ok"  OF oDlg SIZE 35, 12 ;
      ACTION ( oDlg:End(), lOk := .t. ) DEFAULT

   @ 2.25, 16.5 - If( oBmp == nil, 2, 0 ) BUTTON "&Cancel" OF oDlg SIZE 35, 12 ;
      ACTION ( oDlg:End(), lOk := .f. )

   ACTIVATE DIALOG oDlg CENTERED

   if lOk
      uVar := uTemp
   endif

return lOk

//----------------------------------------------------------------------------//
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 188
Joined: Wed Feb 01, 2006 06:59 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Thu Jun 23, 2011 11:37 PM

Antonio

He probado el ejemplo suyo, pero tengo el mismo resultado, cuando lPassword es .t. o .f. no se muestra el get como un password, sino que muestra los n煤meros que se digita.

Saludos

Fernando Espinoza

Saludos



Fernando Espinoza
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Fri Jun 24, 2011 12:03 AM
Fernando

Verifica que no estes pasando digitos en la variable uVar, no son aceptados, intenta pasar un string...

Code (fw): Select all Collapse
MsgGet( "titulo prueba", "texto", "         ", NIL, NIL, .T. )


usa el codigo qu ete recomienda Antonio sino siempre estara activo el estilo PASSWORD
Posts: 188
Joined: Wed Feb 01, 2006 06:59 PM
Re: No me funciona la clausula password en un get desde c贸digo
Posted: Fri Jun 24, 2011 01:54 AM

Ese es el problema, porque lo uso para pasar un valor num茅rico, voy a ver como lo corrijo.

Gracias

Fernando Espinoza

Saludos



Fernando Espinoza

Continue the discussion