chemtxt.txt

来自「用来表示化学分子式的Delphi控件。可以适用于D5-D2006.」· 文本 代码 · 共 50 行

TXT
50
字号
CHEMTEXT

This is a  useful collection of components and procedures to display chemical formulas and equations with automatically placed subscripts and superscripts. The procedure ChemTextOut draws the chemical text onto any Canvas object (useful for writing event handlers for user drawn Lists and Grids). This procedure is used by the components TChemLabel and TDBChemText to display chemical formulas on the forms.

The code included is original work of the author.

Files:

ChemReg.pas
ChemReg.dcr

  Instalable components for Win32 (Delphi 2 and 3).

Chem1Reg.pas
Chem1Ref.dcr

  Instalable components for Delphi 1.

ChemTxt.pas

  A unit containing

  procedure ChemTextOut(Canvas:TCanvas; const aRect:TRect; 
                        X,Y:integer; text:String);

  This can be used in an event handler, for example in   
  OnDrawDataCell of DBGrid1:

    procedure TForm1.DBGrid1DrawDataCell(Sender: TObject;
              const Rect: TRect; Field: TField; State: 
              TGridDrawState);
    begin
      if Assigned(Field) then
         ChemTextOut((Sender as TDBGrid).Canvas, Rect, Rect.Left, 
                     Rect.Top, Field.DisplayText);
    end;





Prague 1998,   Patrik Spanel.



mailto:Patrik.Spanel@jh-inst.cas.cz
http://www.jh-inst.cas.cz/~spanel


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?