Page 1 of 1

Password protected field with 'eye'button

Posted: Thu Jan 12, 2023 11:08 am
by skiman
Hi,

To create a password protected field with an 'eye' button to show the content, I thought to use the following:

Code: Select all

POPUP {|a,b| b:password:=!b:password,DC_GetRefresh(GetList),b:get:buffer } POPCAPTION "N" POPFONT "14.Webdings"
It is working, except that with the mouseover the 'eye' changes to the letter 'N'.

Any suggestions?

Re: Password protected field with 'eye'button

Posted: Thu Jan 12, 2023 11:40 am
by Tom
No character shown at mouseover:

Code: Select all

cPassWord := Space(20)
@ 0,0 DCGET cPassWord PASSWORD POPUP {|c|MsgBox(c)} POPSTYLE DCGUI_POPUPSTYLE_IMBEDDED POPCAPTION Chr(78) POPFONT "20.Webdings" 
DCREAD GUI FIT ADDBUTTONS

Re: Password protected field with 'eye'button

Posted: Thu Jan 12, 2023 12:23 pm
by rdonnay
This sample works fine for me:

Code: Select all

#INCLUDE "dcdialog.CH"

LOCAL GetList[0], cPassword, oConfig

oConfig := DC_XbpPushButtonXPConfig():new()

DC_PopupButtonStyle( oConfig )

cPassWord := Space(20)

@ 0,0 DCGET cPassWord PASSWORD ;
   POPUP {|a,b| b:password:=!b:password,DC_GetRefresh(GetList),b:get:buffer } POPCAPTION "N" POPFONT "14.Webdings"

DCREAD GUI FIT ADDBUTTONS

RETURN nil

PROC appsys ; return

Re: Password protected field with 'eye'button

Posted: Fri Jan 13, 2023 9:20 am
by skiman
Hi Tom, Roger,

Seems as I have to check the mouseover in my modified buttonclass.