Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Unicodefähiges TEdit (https://www.delphipraxis.net/96541-unicodefaehiges-tedit.html)

swiss_salsero 26. Jul 2007 10:27


Unicodefähiges TEdit
 
Hi all

Ich benötige ein Unicodefähiges TEdit. Leider bin ich in der Komponenten-Entwicklung ein absoluter Neuling und wäre daher froh, wenn mir jemand ein Beispiel geben könnte.
Ich stelle mir etwas ähnliches vor wie in folgendem Code-Beispiel mit einem TLabel gemacht wurde:

Delphi-Quellcode:
TUnicodeLabel = class(TLabel)
  private { Private declarations }
    WideText : WideString;  
    procedure SetCaption(Value: WideString);
  protected { Protected declarations }
    procedure DoDrawText(var Rect: TRect; Flags: Longint); override;
  public { Public declarations }
  published { Published declarations }
    property Caption : WideString read WideText write SetCaption;
  end;

implementation

procedure TUnicodeLabel.DoDrawText(var Rect: TRect; Flags: Longint);
begin
  Canvas.Font := Font;

  if not Enabled then
  begin
    Canvas.Font.Color := clBtnHighlight;
    ExtTextOutW(Canvas.Handle, 1,1, ETO_CLIPPED, @Rect,
                pWideChar(WideText), Length(WideText), nil);

    Canvas.Font.Color := clBtnShadow;
  end;

  ExtTextOutW(Canvas.Handle, 0,0, ETO_CLIPPED, @Rect,
              pWideChar(WideText), Length(WideText), nil);
end;

procedure TUnicodeLabel.SetCaption(Value: WideString);
begin
  WideText:=Value;
  Invalidate; // repaint
end;
Danke

Che

Bernhard Geyer 26. Jul 2007 10:31

Re: Unicodefähiges TEdit
 
ElPack
TMS-Software -> TMS Unicode Component Pack


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:19 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz