Hi Martin,
Hm, on my system 158 results in a "z" with some tilde or accent.
Same here.
Show quoted text 10 lines
But that is probably the correct behaviour.
For some reason the PassWordchar field accepts an ansi char, rather than a
utf8 char. So what you will see depends on the codepage of the system on
which your app is run. Even if it displays fine on your PC, if you ship the
app, other people will see other chars.
How or why it becomes an * I do not know...
I found why, but I can't explain the reason behind the code. In lcl/interfaces/gtk2/gtk2wsstdctrls :
class procedure TGtk2WSCustomEdit.SetPasswordChar(
const ACustomEdit: TCustomEdit; NewChar: char);
var
PWChar: Integer;
Entry: PGtkEntry;
begin
if not WSCheckHandleAllocated(ACustomEdit, 'SetPasswordChar') then
Exit;
Entry := PGtkEntry(ACustomEdit.Handle);
if ACustomEdit.EchoMode=emNone then
PWChar:=0
else begin
PWChar:=ord(ACustomEdit.PasswordChar);
if (PWChar<192) or (PWChar=ord('*')) then
PWChar:=9679;
end;
gtk_entry_set_invisible_char(Entry,PWChar);
end;
Commenting the following lines
if (PWChar<192) or (PWChar=ord('*')) then
PWChar:=9679;
allows to display any char. But there must be a reason for this check and whoever wrote didn't bother writing a comment.
Regards,
Gerard.
Show quoted text 8 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110810/8014bbb9/attachment.html>