Re: Those little dots

From: Jens Gruschel (nospam_at_pegtop.net)
Date: 10/28/03


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



Relevant Pages

  • Re: Language
    ... That sounds like a font problem. ... right character in the right position, the right glyph will be displayed. ... which isn't too compatible with a little Windows CE device). ... > me to use some char and show in the place of the right char, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Language
    ... I have try with all the font of windows without successfull, ... nel messaggio news:eGnEatTWEHA.3476@tk2msftngp13.phx.gbl... ... >> me to use some char and show in the place of the right char, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Stumped, baffled, and perplexed.......
    ... programmer stunt that gives MS Windows a bad name. ... Yahoo Widgets lists 326 clock apps. ... TrueType, OpenType, PostScript, etc. font on the system. ... Surely the slow running network to which you refer is your personal ...
    (rec.video.production)
  • Re: Font for a menu?
    ... It wouldn't be so bad if the Windows key were somewhere else on the keyboard, ... That's the one - the main problem is that Microsoft don't distribute a font ... I think the Unicode set has been ... flags exist in the set - but only flags for upward stems. ...
    (microsoft.public.vc.mfc)
  • Re: Windows wont boot if any partition extends past 120 GB on 250 GB drive
    ... Neither would be able to change anything on the partition. ... "Creation of bootable restore media to restore to drives that can't be restored to from witin Windows" ... will dot pittenger1 at gmail dot com (use this address for large ...
    (microsoft.public.windowsxp.general)