Jump to content
pquessev

Question about TPasswordEditButton inside TEdit field

Recommended Posts

I have set a TEdit field with Password=true, and I have added a TPasswordEditButton as an element to the TEdit field.

 

The TPasswordEditButton works as expected: when I click on the right side of the TEdit field the password is displayed in clear text. However, the TPasswordEditButton is not visible on the screen. Normally I should see a symbol on the right of the field. I have tried to set a text in the TPasswordEditButton, but it is not visible either.

 

I can achieve the desired result by using a TEditButton element instead of TPasswordEditButton, and handling the MouseDown and MouseUp events, but is there something special to do to get the TPasswordEditButton displayed inside the TEdit field?

 

I use Delphi 12 Update 1, and my test platform is Galaxy S24 running Android 14.

Share this post


Link to post

How does this construct work on Windows? As expected?

Share this post


Link to post

Yes, it works fine on Windows.

 

I hadn't paid attention but in the form editor the eye button is not displayed when  style is Android, and when changing style to windows it is displayed correctly.

Share this post


Link to post

Yes, I was also looking for this function too.

In the end, I desperately searched for "password" in the Delphi source code and demos.

After endless searching, I found this TPasswordEditButton, but nowhere could I find a description of how to use it.

I then found it in C:\Program Files (x86)\Embarcadero\Studio\23.0\source\data\rest\restdebugger\uMain_frm.pas and copied it from there (from the DFM/FMX), but somehow it wasn't there at all in my form (was not visible).

There, in the uMain_frm.pas, it still looks good, but not for me, i.e., not in the designer and not at runtime. It took a while until I associated it with the Android-Style.

 

And it was only through an image in a Google search that I finally figured out how to add these buttons "correctly."

https://www.gesource.jp/weblog/?p=5671

 

What's the point of this crap?

Not only are the TEdit buttons so perversely transparent and frameless on Android, but almost none of these edit buttons are visible on Android.

Yes, they work, at least this TPasswordEditButton does, but if no one sees it and therefore doesn't know that this function exists, then it's absolutely useless.

0033.jpg

 

 

https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3992

Edited by himitsu

Share this post


Link to post
5 hours ago, TDDung said:

My multi-os FMX app has the same problem on mobile devices and it was because of FMX style. You will find the solution here: https://www.youtube.com/watch?v=2SkaID7U6kQ

Because the shitty TEdit is transparent, the transparent icon is no longer visible. :classic_blink:

Edited by himitsu

Share this post


Link to post

The complete style "passwordeditbutton" is simply missing in AndroidLight.fsf

 

Edited by himitsu

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×