Re: Those little dots
From: Jens Gruschel (nospam_at_pegtop.net)
Date: 10/28/03
- Next message: Jose J. Sanchez Rico: "Thread Syncronization methods"
- Previous message: Rudy Velthuis (TeamB): "Re: Remove main menu of a running process;"
- In reply to: eshipman: "Re: Those little dots"
- Next in thread: eshipman: "Re: Those little dots"
- Reply: eshipman: "Re: Those little dots"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 28 Oct 2003 19:52:21 +0100
> > What char should I use in order to simulate the dots which have replaced
the
> > '*' in XP?
>
> Marlett font char 'n' is thte one Windows uses.
Sure? I thought it was unicode character $2022 of font Tahoma. If you create
a TEdit, set NO password char, set Font to 'Tahoma' and Style to
ES_PASSWORD, Windows XP displays the dot. Try following TCustomEdit
descendent...
unit PasswordEdit;
interface
uses
Windows, Classes, Controls, StdCtrls;
type
TPasswordEdit = class(TCustomEdit)
protected
procedure CreateParams(var Params: TCreateParams); override;
public
constructor Create(AOwner: TComponent); override;
published
property AutoSelect;
property AutoSize;
property BiDiMode;
property BorderStyle;
property CharCase;
property Color;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property HideSelection;
property ImeMode;
property ImeName;
property MaxLength;
property OEMConvert;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
property Anchors;
property Constraints;
end;
procedure Register;
implementation
uses
Forms;
procedure Register;
begin
RegisterComponents('XP', [TPasswordEdit]);
end;
constructor TPasswordEdit.Create(AOwner: TComponent);
const
FavouredFonts: array[0..2] of String = ('Tahoma', 'Arial', 'MS Sans
Serif');
var
I: Integer;
begin
inherited;
I := Low(FavouredFonts);
while (I <= High(FavouredFonts))
and (Screen.Fonts.IndexOf(FavouredFonts[I]) < 0) do Inc(I);
if I <= High(FavouredFonts) then Font.Name := FavouredFonts[I];
end;
procedure TPasswordEdit.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.Style := Params.Style or ES_PASSWORD;
end;
end.
The result should be a password edit that works for Windows 9x, NT, 2K (with
*) and XP (with dot). I forgot Me, but that's only because I don't want to
remember... :-)
Jens
- Next message: Jose J. Sanchez Rico: "Thread Syncronization methods"
- Previous message: Rudy Velthuis (TeamB): "Re: Remove main menu of a running process;"
- In reply to: eshipman: "Re: Those little dots"
- Next in thread: eshipman: "Re: Those little dots"
- Reply: eshipman: "Re: Those little dots"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|