Article View: borland.public.cppbuilder.internationalization
Article #755Re: Unicode? Help!
From: Petr Sulla
Date: Tue, 05 Mar 2002 21:27
Date: Tue, 05 Mar 2002 21:27
27 lines
2319 bytes
2319 bytes
On Thu, 28 Feb 2002 09:56:15 +0100, Adib Taraben <Taraben.aA@wige-data.de> wrote: >can you provide some code (sample/source) to the community? I'd like to, but the code is owned by my employer, so I can't. But it's quite easy. Just experiment a bit with ExtDrawTextW and then reimplement DrawTextW using ExtDrawTextW. This is quite straighforward, although you will be reinventing the wheel ;) Then take some simple VCL component (like TCustomLabel), derive from it and reimplement what TLabel does, while replacing DrawText with your own implementation of DrawTextW. For labels you could do it even with ExtDrawTextW directly. For storing the unicode string you can use the AnsiString Caption property, when you convert UTF16 to UTF8 for storing and back again for displaying. Or just make your own WideString WCaption property. The same goes for the other components. For example the listbox - just make it ownerdrawn, make your own list with unicode strings and add corresponding count of Items with value "". You can also find some inspiration in UniRed (http://www.esperanto.mv.ru/UniRed/ENG/), which uses it's own unicode VCL components and it's source is publicly available. Regards Petr Sulla
Technical Details
Message-ID:
<3c853846.2837097@111.111.111.1>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!sienna.impulse.net!nntp-relay.ihug.net!ihug.co.nz!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mailReferences:
<3c4836ec_2@dnews> <3c7b97a5.24577113@111.111.111.1> <3C7DF0AF.5070202@wige-data.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10297d,aa344d221d51009e X-Google-Attributes: gid10297d,public X-Google-ArrivalTime: 2002-03-05 13:31:09 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!sienna.impulse.net!nntp-relay.ihug.net!ihug.co.nz!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: nospam@ite-web.de (Petr Sulla) Newsgroups: borland.public.cppbuilder.internationalization Subject: Re: Unicode? Help! Date: Tue, 05 Mar 2002 21:27:44 GMT Organization: T-Online Lines: 27 Message-ID: <3c853846.2837097@111.111.111.1> References: <3c4836ec_2@dnews> <3c7b97a5.24577113@111.111.111.1> <3C7DF0AF.5070202@wige-data.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1015363778 00 19815 22+uTnNESRazqo 020305 21:29:38 X-Complaints-To: abuse@t-online.com X-Sender: 320087314325-0001@t-dialin.net X-Newsreader: Forte Free Agent 1.21/32.243