📄 tnt delphi unicode controls.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0061)http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls.htm -->
<HTML><HEAD><TITLE>Tnt Delphi Unicode Controls</TITLE>
<META content=en-us http-equiv=Content-Language>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId><LINK
href="Tnt Delphi Unicode Controls_files/tntmpd.css" rel=stylesheet
type=text/css>
<META content=none name="Microsoft Border"></HEAD>
<BODY>
<H1>Tnt Delphi Unicode Controls</H1>
<H1><IMG border=1 height=60
src="Tnt Delphi Unicode Controls_files/TntPalette.gif" width=686></H1>
<DIV align=center>
<CENTER>
<TABLE border=0 cellSpacing=0>
<TBODY>
<TR>
<TD width="100%"><IMG border=0 height=203
src="Tnt Delphi Unicode Controls_files/UnicodeWindows.gif"
width=324></TD></TR>
<CAPTION vAlign=bottom>
<P align=center>Actual screen shot on Windows 2000. <A
href="http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls.htm#ScreenShots">
(more screenshots)</A></P></CAPTION></TABLE></CENTER></DIV>
<HR>
<H2>Full Source available for download! </H2>
<H4><A
href="http://home.ccci.org/wolbrink/TntBin/TntUnicodeControls.zip">Download
now</A> </H4>
<UL>
<LI>
<P>Works with Delphi 5/6/7. (TTntDBGrid is *not* Unicode enabled for Delphi
5.)</P>
<LI>
<P>It comes with an updated Unicode.pas (from Mike Lischke's <A
href="http://www.delphi-unicode.net/">Delphi Unicode Center</A>).</P></LI></UL>
<UL>
<LI>It also works with JclUnicode.pas from <A
href="http://www.delphi-jedi.org/Jedi:CODELIBJCL">Jedi Component Library
(JCL)</A>. Just define "JCL" in your project options. </LI></UL>
<HR>
<H5>Stay Informed and Join the Discussion</H5>
<P><A
href="http://webboard.ccci.org:8080/~tnt">http://webboard.ccci.org:8080/~tnt</A>
- <B><A href="http://webboard.ccci.org:8080/~tnt">Signup to receive
announcements by email</A></B>, or start a discussion</P>
<H5> </H5>
<HR>
<H3>What's New? Check out the <A
href="http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls_log.htm">release
log</A>.</H3>
<HR>
<H3><A href="http://www.borland.com/"><IMG border=0 height=75
src="Tnt Delphi Unicode Controls_files/Logo_big.gif" width=154></A></H3>
<HR>
<H3>Components included</H3>
<TABLE border=1 width="100%">
<TBODY>
<TR>
<TD width="50%">
<P align=center><B>Standard</B>
<UL>
<LI>TTntForm
<LI>TTntMainMenu
<LI>TTntPopupMenu
<LI>TTntLabel
<LI>TTntEdit
<LI>TTntMemo
<LI>TTntButton
<LI>TTntCheckBox
<LI>TTntRadioButton
<LI>TTntListBox
<LI>TTntComboBox
<LI>TTntScrollBar
<LI>TTntGroupBox
<LI>TTntPanel
<LI>TTntActionList </LI></UL>
<P align=center><B>Additional</B></P>
<UL>
<LI>TTntBitBtn
<LI>TTntSpeedButton
<LI>TTntStringGrid
<LI>TTntDrawGrid
<LI>TTntImage
<LI>TTntShape
<LI>TTntBevel
<LI>TTntScrollBox
<LI>TTntCheckListBox
<LI>TTntStaticText
<LI>TTntControlBar </LI></UL>
<P align=center><B>Win32</B></P>
<UL>
<LI>TTntTabControl
<LI>TTntPageControl
<LI>TTntRichEdit
<LI>TTntTrackBar
<LI>TTntProgressBar
<LI>TTntUpDown
<LI>TTntDateTimePicker
<LI>TTntMonthCalendar
<LI>TTntListView
<LI>TTntPageScroller </LI></UL>
<P align=center><B>Data Controls</B>
<UL>
<LI>TTntDBGrid <FONT size=1>(requires Delphi 6 for full Unicode
support)</FONT>
<LI>TTntDBEdit
<LI>TTntDBComboBox
<LI>TTntDBCheckBox </LI></UL>
<P align=center><B>System</B></P>
<UL>
<LI>TTntPaintBox </LI></UL>
<P align=center><B>Others</B>
<UL>
<LI>TTntThemeManager (inherits from Mike Lischke's XP Theme
Manager)
<LI>TTntThemeManagerDB </LI></UL></TD></TR>
<TR>
<TD width="50%">
<P align=center
style="LINE-HEIGHT: 100%; MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><B>Delphi
IDE Enhancements</B>
<UL>
<LI>
<P
style="LINE-HEIGHT: 100%; MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px">TWideStringProperty
</P>
<LI>TWideStringListProperty </LI></UL></TD></TR></TBODY></TABLE>
<HR>
<H3>Background</H3>
<P>Designing software for an international audience, I've always wanted to write
a full Unicode application. My approach so far, has been to write Unicode
on the inside, and MBCS on the outside. This has always been frustrating,
because (even on Windows NT/2000 which provide native Unicode window controls)
the WideStrings inside my application and databases were always confined to an
ANSI VCL. And, since the VCL was designed to wrap the low-level Windows
details, why shouldn't the VCL hide the fact that sometimes native Unicode
controls are not possible on the given version of Windows. I believe the
VCL should be written with a Unicode interface, even if it must (at times) deal
with an ANSI operating system. For example, TEdit should expose Text as a
WideString, even if it has to convert the WideString to an AnsiString on the
Windows 9X platform.</P>
<P>In the past, the ANSI VCL may have made a little sense, considering that
there were many more users of Windows 9X, than Windows NT. There would
have been some performance penalty to use WideStrings on the Windows 9X
platform. But with the faster computers of today, and with more people
using platforms such as Windows 2000 and Windows XP, the ANSI VCL just doesn't
make sense anymore. In fact, having to use the the ANSI VCL on Windows
NT/2000/XP is slower because of the constant conversion to and from Unicode
inside Windows.</P>
<P>My coding signature is <B>Tnt</B>. I will use this to denote my classes
from others.</P>
<UL>
<LI>For <A href="http://home.ccci.org/wolbrink/index.htm">more information
about me</A>
<LI>Some of my software projects (all written in Delphi).
<LI> <A
href="http://home.ccci.org/wolbrink/tnt/index.htm">TntMPD</A> (contact manager
for missionaries)
<LI> <A
href="http://home.ccci.org/wolbrink/screensaver.htm">Jesus Film Screen
Saver</A>
<LI> <A
href="http://home.ccci.org/wolbrink/TntBin/ActiveXSCR.exe">ActiveX SCR
control</A> </LI></UL>
<H3>Design Goals</H3>
<P>I want the controls to work on Windows 95, 98, ME, NT, 2000, XP, etc. I
want a single EXE for all platforms. Of course, full Unicode support is
only truly available on NT/2000/XP. In other words, the controls should
automatically scale to take advantage of native Unicode support when
possible.</P>
<P>I want the controls to inherit from the Delphi VCL. I want to reuse as
much code as possible. For the most part this makes sense. The only
sticky part is where text messages get passed around. But I believe I've
gotten past this through strategic subclassing at various points in the message
flow chain. To give a rough comparison of why this is so important, check
out the following chart which compares the lines of code in the VCL for a given
control (4,397 in all), and the lines of code required in my descendent controls
(655 in all). Besides saving lines of code, I get the advantage of
automatically inheriting new features as new versions of Delphi come out.
One such example is the AlphaBlending feature in the Delphi 6 TForm. Even
though I use Delphi 5 now, I won't have to add any code to get this new
feature. </P>
<P><IMG border=0 height=282
src="Tnt Delphi Unicode Controls_files/LinesOfCodeTntVcl.gif" width=558></P>
<P>I found the TWideStrings and TWideStringList classes from Mike Lischke's <A
href="http://www.delphi-unicode.net/">Delphi Unicode Center</A> very
helpful. In fact, Mike's Unicode.pas file is required to compile my
code.</P>
<HR>
<H3>More Interesting Information...</H3><A
href="http://www.unicode.org/iuc/iuc17/a7/slides.ppt">Case Study: Porting an MFC
Application to Unicode</A>: It looks like the FrontPage 2002 team did the
roughly the same thing to MFC as what I'm doing to the VCL. They did this
with the same goal in mind: to support Unicode as much as possible depending on
the support offered by Windows. Another goal was "<SPAN
style="FONT-FAMILY: Tahoma; mso-ascii-font-family: Tahoma; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Don</SPAN><SPAN
style="FONT-FAMILY: 'Times New Roman'; mso-ascii-font-family: Tahoma; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -