返回
{***************************************************************}
{***               FVision Unit Version1.0                   ***}
{***                    蓝蚂蚁工作室                         ***}
{***************************************************************}
{***                   中文输入法单元                        ***}
{***************************************************************}
{$O+,F+,X+,I-}
Unit FCinput;
Interface
Uses
  Dos,Crt,Graph,FGraph,FTool,FMouse,FXmsDrv,
  FEvent,FView,FWrite,FMenu,FList;

Const
  ciBroad      = $0001;
  ciSaveBack   = $0002;

  moEnglish    = $01;            {英文}
  moQuanPin    = $02;            {全拼}
  moZNQuanPin  = $03;            {智能全拼}
  moWuBi       = $04;            {五笔}
  moQuWei      = $05;            {区位}

  JdMode:Boolean=True;           {角度模式}
  MaxIndexNow = 400;

Type
  PyType=record
    Str:string[6];
    Ind:Word;
  end;

  NowType=array [1..MaxIndexNow] of Integer;

  CDictHeader=record
   Sign:array[0..27] of Char;
   Name:string[10];
   MaxLength:Integer;
   Reserved:array[0..9] of Byte;
  end;

  PCInput=^TCInput;
  TCInput=object(TView)
   Name,Smin:string[20];
   NWin,InWin,HzWin,
   JdWin,SameWin,MesWin,Lp,Rp:TRect;
   Now:^NowType;
   InpMode:Byte;
   AbleClear:Boolean;
   Same,Page,IndexIn,MaxIn:Integer;
   Constructor Init(R:TRect;Mode:Byte;N:string);
   Destructor Done;virtual;
   Procedure MoveTo(X,Y:Integer);virtual;
   Procedure Paint;virtual;
   Procedure Draw;virtual;
   Procedure DrawSame;virtual;
   Function WordIsHz(W:Word):Boolean;
   Procedure ClearHz;
   Function InToCh(Ind:Integer):string;virtual;
   Function InToWo(Ind:Integer):Word;virtual;
   Procedure HandleEvent(var Event:TEvent);virtual;
  end;

  PPyInput=^TPyInput;
  TPyInput=object(TCInput)
   Constructor Init(R:TRect);
   Function FindSame(S:string):Boolean;
   Procedure HandleEvent(var Event:TEvent);virtual;
  end;

  PExtendInput=^TExtendInput;
  TExtendInput=object(TCInput)
   Fp:File;
   Result:Word;
   Head:CDictHeader;
   SPos,EPos:Longint;
   Constructor Init(R:TRect;Mode:Byte;FileName:PathStr);
   Destructor Done;virtual;
   Procedure Draw;virtual;
   Function FindSame(S:string):Boolean;
   Procedure HandleEvent(var Event:TEvent);virtual;
  end;

  PEInput=^TEInput;
  TEInput=object(TCInput)
   Constructor Init(R:TRect);
  end;

  PQWInput=^TQWInput;
  TQWInput=object(TCInput)
    Constructor Init(R:TRect);
    Procedure FindSame;
    Procedure HandleEvent(var Event:TEvent);virtual;
  end;

  PInputc=^TInputc;
  TInputc=object(TView)
   Style:Word;
   InXms:Word;
   InXmsSav:ImageSaveType;
   InImg:Pointer;
   InSize:Word;
   CInp:PCInput;
   List:PLister;
   ShowStatus,ShowMark:Boolean;
   Constructor Init(R:TRect;Sty:Word);
   Destructor Done;virtual;
   Procedure MoveTo(X,Y:Integer);virtual;
   Procedure ChangeBroad(X,Y:Integer);virtual;
   Procedure Paint;virtual;
   Procedure ShowBroad;
   Procedure HideBroad;
   Procedure SelectMode(var Event:TEvent);
   Procedure HandleEvent(var Event:TEvent);virtual;
  end;

var
  CInput:PInputC;

Implementation
Const
  MaxPy       = 395;
  JdName:array [False..True] of string[4]=('全角','半角');
  SignStr:string[28]='FVision Chinese Input Dict'#27#0;

var
  Py:array[1..MaxPy] of PyType;

{------------object tcinput------------------}
Constructor TCInput.Init;
var
  Temp:Integer;
begin
  Inherited Init;
  GrowMode:=gfGrowHiX+gfGrowLoY+gfGrowHiY;;
  InpMode:=Mode;
  Name:=N;
  Size.X:=R.B.X-R.A.X;
  Size.Y:=R.B.Y-R.A.Y;
  MoveTo(R.A.X,R.A.Y);
  GetMem(Now,SizeOf(NowType));
  FillChar(Now^,SizeOf(NowType),0);
  SMin:='';
  Same:=0;
  Page:=0;
  IndexIn:=0;
  AbleClear:=False;
end;

Destructor TCInput.Done;
begin
  FreeMem(Now,SizeOf(NowType));
  Inherited Done;
end;

Procedure TCInput.MoveTo;
var
  Temp:Integer;
begin
  Inherited MoveTo(X,Y);
  AssignRect(Broad,X,Y,X+Size.X,Y+Size.Y);
  Temp:=Broad.A.X+5;
  AssignRect(JdWin,Temp,Broad.A.Y+3,Temp+32,Broad.B.Y-3);
  Temp:=JdWin.B.X+5;
  AssignRect(NWin,Temp,Broad.A.Y+3,Temp+Length(Name)*8,Broad.B.Y-3);
  Temp:=NWin.B.X+6;
  AssignRect(InWin,Temp,Broad.A.Y+3,Temp+MaxIn*8,Broad.B.Y-3);
  Temp:=InWin.B.X+6;
  AssignRect(HzWin,Temp,Broad.A.Y+3,Temp+30*8+16,Broad.B.Y-3);
  Temp:=HzWin.B.X+6;
  AssignRect(SameWin,Temp,Broad.A.Y+3,Temp+32,Broad.B.Y-3);
  Temp:=SameWin.B.X+6;
  AssignRect(Lp,Temp,Broad.A.Y+3,Temp+8,Broad.B.Y-3);
  Temp:=Lp.B.X+5;
  AssignRect(Rp,Temp,Broad.A.Y+3,Temp+8,Broad.B.Y-3);
  Temp:=Rp.B.X+6;
  AssignRect(MesWin,Temp,Broad.A.Y+3,Broad.B.X-5,Broad.B.Y-3);
  if InpMode=moEnglish then
    AssignRect(MesWin,InWin.A.X,Broad.A.Y+3,Broad.B.X-5,Broad.B.Y-3);
end;

Procedure TCInput.Paint;
var
  i:Integer;
begin
  HideMouse;
  Full(Broad.A.X+1,Broad.A.Y+1,Broad.B.X-1,Broad.B.Y-1,7);
  SignBroad(JdWin.A.X-1,JdWin.A.Y-1,JdWin.B.X+1,JdWin.B.Y+1,0);
  SignBroad(NWin.A.X-1,NWin.A.Y-1,NWin.B.X+1,NWin.B.Y+1,0);
  SignBroad(MesWin.A.X-1,MesWin.A.Y-1,MesWin.B.X+1,MesWin.B.Y+1,0);
  WriteShe(NWin.A.X,NWin.A.Y,Name,0,0);
  if InpMode=moEnglish then
  begin
    Writecstr(MesWin.A.X+1,MesWin.A.Y+1,'   永方汉字系统1.0~『蓝蚂蚁工作室』~出品',4,1);
    Writecstr(MesWin.A.X,MesWin.A.Y,'   永方汉字系统1.0~『蓝蚂蚁工作室』~出品',12,9);
  end else
  if InpMode in [moQuanPin,moZNQuanPin,moWuBi,moQuWei] then
  begin
    SignBroad(InWin.A.X-1,InWin.A.Y-1,InWin.B.X+1,InWin.B.Y+1,0);
    SignBroad(HzWin.A.X-1,HzWin.A.Y-1,HzWin.B.X+1,HzWin.B.Y+1,0);
    SignBroad(SameWin.A.X-1,SameWin.A.Y-1,SameWin.B.X+1,SameWin.B.Y+1,0);
    SignBroad(Lp.A.X-1,Lp.A.Y-1,Lp.B.X+1,Lp.B.Y+1,0);
    SignBroad(Rp.A.X-1,Rp.A.Y-1,Rp.B.X+1,Rp.B.Y+1,0);
    Writecs(Lp.A.X,Lp.A.Y,#17,0);
    Writecs(Rp.A.X+1,Rp.A.Y,#16,0);
    if InpMode in [moZNQuanPin,moWuBi] then
      WritecMap(MesWin.A.X,MesWin.A.Y,'蓝蚂蚁',1,9)
    else
      WritecMap(MesWin.A.X,MesWin.A.Y,'永方汉字系统',1,9);
    if not (InpMode in [moZNQuanPin,moWuBi]) then
    for i:=0 to 9 do
    Writecs(HzWin.A.X+i*25,HzWin.A.Y,IntStr((i+1) mod 10),4);
  end;
  Draw;
end;

Procedure TCInput.Draw;
var
  i:Integer;
begin
  HideMouse;
  Full(JdWin.A.X,JdWin.A.Y,JdWin.B.X,JdWin.B.Y,7);
  WriteShe(JdWin.A.X,JdWin.A.Y,JdName[JdMode],10,1);
  if InpMode in [moQuanPin,moQuWei] then
  begin
    Full(InWin.A.X,InWin.A.Y,InWin.B.X,InWin.B.Y,7);
    Writecs(InWin.A.X,InWin.A.Y,Smin,0);
    ClearHz;
    for i:=0 to 9 do
    if Same>=Page*10+i+1 then
      Writecs(HzWin.A.X+8+i*25,HzWin.A.Y,InToCh(Now^[Page*10+i+1]),0);
  end;
  ShowMouse;
end;

Procedure TCInput.DrawSame;
begin
  HideMouse;
  Full(SameWin.A.X,SameWin.A.Y,SameWin.B.X,SameWin.B.Y,7);
  if Same<>0 then Writecs(SameWin.A.X,SameWin.A.Y,IntStr(Same),0);
  ShowMouse;
end;

Function TCInput.WordIsHz;
begin
  WordIsHz:=False;
  if (Hi(W)>$A0)and(Hi(W)<$A0+88)and(Lo(W)>$A0)and(Lo(W)<$A0+95) then
    WordIsHz:=True;
end;

Procedure TCInput.ClearHz;
var
  M:Byte;
begin
  for M:=0 to 9 do
  Full(HzWin.a.x+8+M*25,HzWin.a.y,HzWin.a.x+8+15+M*25,HzWin.b.y,7);
end;

Function TCInput.InToCh;
begin
  InToCh:=Chr((Ind-1) div 94+16+$A0)+Chr((Ind-1) mod 94 +$A1);
end;

Function TCInput.InToWo;
begin
  InToWo:=(Word((Ind-1) div 94+16+$A0) shl 8+((Ind-1) mod 94 +$A1));
end;

Procedure TCInput.HandleEvent;
var
  Temp:Integer;
begin
  if InpMode in [moEnglish,moZNQuanPin,moWuBi] then Exit;
  case Event.What of
  evMouseDown,evMouseAuto:
              if IsIn(Event.Where,HzWin) then
              begin
                Temp:=(Event.Where.x-HzWin.a.x) div 25;
                if (Same>Page*10+Temp) then
                begin
                  Event.What:=evKeyDown;
                  Event.CMark:=True;
                  Event.KeyCode:=InToWo(Now^[Page*10+Temp+1]);
                  AbleClear:=True;
                  Exit;
                end;
              end else
              if InpMode=moQuWei then
                Exit
              else
              if IsIn(Event.Where,Lp) then
              begin
                if Page>0 then
                begin
                  Dec(Page);
                  Draw;
                end;
              end else
              if IsIn(Event.Where,Rp) then
              begin
                if (Page+1)*10<Same then
                begin
                  Inc(Page);
                  Draw;
                end;
              end else Exit;
  evKeyDown : case Event.KeyCode of
              kbSpace : if (not AbleClear)and(Same>Page*10) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+1]);
                          AbleClear:=True;
                          Exit;
                        end else Exit;
              kbAlt1..kbAlt9 : if AbleClear and
                           (Same>Page*10+(Event.KeyCode-kbAlt1) div $100) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+(Event.KeyCode-kbAlt1) div $100+1]);
                          Exit;
                        end;
              kbAlt0 :  if AbleClear and (Same>Page*10+9) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+10]);
                          Exit;
                        end;
              else
              if InpMode=moQuWei then Exit
              else case Event.CharCode of
                   '-' : if Page>0 then begin Dec(Page);Draw;end;
                   '=' : if (Page+1)*10<Same then begin Inc(Page);Draw;end;
                   else Exit;
                   end;
              end;
  else Exit;
  end;
  ClearEvent(Event);
end;

{---------------object english input----------}
Constructor TEInput.Init;
begin
  MaxIn:=1;
  Inherited Init(R,moEnglish,'英文');
end;

{-----------object tpyinput-----------------}
Constructor TPyInput.Init;
begin
  MaxIn:=8;
  Inherited Init(R,moQuanPin,'全拼');
end;

Function TPyInput.FindSame;
var
  M,N:Integer;
begin
  FindSame:=True;
  if Byte(S[0])=0 then
  begin
    Same:=0;
    DrawSame;
    Exit;
  end;
  for N:=1 to MaxPy-1 do
  begin
   if (Py[N].Str=S) then
   begin
     Same:=Py[N+1].Ind-Py[N].Ind;
     for M:=1 to Same do
      Now^[M]:=Py[N].Ind+M-1;
     DrawSame;
     Exit;
   end;
   if (Py[N].Str<S) and (Py[N+1].Str>S) then
   begin
     if (Pos(S,Py[N+1].Str)<>1) then
       FindSame:=False
     else
       Same:=0;
     DrawSame;
     Exit;
   end;
  end;
end;

Procedure TPyInput.HandleEvent;
begin
  Inherited HandleEvent(Event);
  case Event.What of
  evKeyDown :case Event.KeyCode of
             kbBack  : if (IndexIn>0)and(not AbleClear) then
                       begin
                         Dec(IndexIn);
                         Dec(Smin[0]);
                         FindSame(Smin);
                         Page:=0;
                         Draw;
                       end else Exit;
             else case Event.CharCode of
                   '1'..'9':if (not AbleClear)and
                            (Same>Page*10+Ord(Event.CharCode)-Ord('1')) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+Ord(Event.CharCode)-Ord('1')+1]);
                          AbleClear:=True;
                          Exit;
                        end else Exit;
                   '0': if (not AbleClear)and(Same>Page*10+9) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+10]);
                          AbleClear:=True;
                          Exit;
                        end else Exit;
                  'a'..'z': if AbleClear then
                            begin
                              if FindSame(Event.CharCode) then
                              begin
                                Smin:=Event.CharCode;
                                AbleClear:=False;
                                IndexIn:=1;
                                Page:=0;
                                Draw;
                              end;
                            end else
                            begin
                              if FindSame(Smin+Event.CharCode) then
                              begin
                                Smin:=Smin+Event.CharCode;
                                Inc(IndexIn);
                                Page:=0;
                                Draw;
                              end;
                            end;
                   else Exit;
                   end;
            end;
   else Exit;
   end;
   ClearEvent(Event);
end;

{-----------Object TSmartPyInput-----------------}
Constructor TExtendInput.Init;
begin
  Assign(Fp,FileName);
  Reset(Fp,1);
  IsValid:=IOResult=0;
  if IsValid then
  begin
    BlockRead(Fp,Head,Sizeof(CDictHeader),Result);
    SPos:=Sizeof(CDictHeader);
    EPos:=FileSize(Fp);
  end;
  MaxIn:=Head.MaxLength;
  Inherited Init(R,Mode,Head.Name);
end;

Destructor TExtendInput.Done;
begin
  Close(Fp);
  Inherited Done;
end;

Procedure TExtendInput.Draw;
var
  i:Integer;
begin
  HideMouse;
  Full(JdWin.a.x,JdWin.a.y,JdWin.b.x,JdWin.b.y,7);
  WriteShe(JdWin.a.x,JdWin.a.y,JdName[JdMode],10,1);
  Full(InWin.a.x,InWin.a.y,InWin.b.x,InWin.b.y,7);
  Writecs(InWin.a.x,InWin.a.y,Smin,0);
  for i:=0 to 9 do
  if Same>=Page*10+i+1 then
    Writecs(HzWin.a.x+8+i*25,HzWin.a.y,InToCh(Now^[Page*10+i+1]),0);
  ShowMouse;
end;

Function TExtendInput.FindSame;
var
  M,N:Integer;
begin
  FindSame:=True;
  if Byte(S[0])=0 then
  begin
    Same:=0;
    DrawSame;
    Exit;
  end;
  for N:=1 to MaxPy-1 do
  begin
   if (Py[N].Str=S) then
   begin
     Same:=Py[N+1].Ind-Py[N].Ind;
     for M:=1 to Same do
      Now^[M]:=Py[N].Ind+M-1;
     DrawSame;
     Exit;
   end;
   if (Py[N].Str<S) and (Py[N+1].Str>S) then
   begin
     if (Pos(S,Py[N+1].Str)<>1) then
       FindSame:=False
     else
       Same:=0;
     DrawSame;
     Exit;
   end;
  end;
end;

Procedure TExtendInput.HandleEvent;
begin
  Inherited HandleEvent(Event);
  if not IsValid then Exit;
  case Event.What of
  evKeyDown :case Event.KeyCode of
             kbBack  : if (IndexIn>0)and(not AbleClear) then
                       begin
                         Dec(IndexIn);
                         Dec(Smin[0]);
                         FindSame(Smin);
                         Page:=0;
                         Draw;
                       end else Exit;
             else case Event.CharCode of
                   '1'..'9':if (not AbleClear)and
                            (Same>Page*10+Ord(Event.CharCode)-Ord('1')) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+Ord(Event.CharCode)-Ord('1')+1]);
                          AbleClear:=True;
                          Exit;
                        end else Exit;
                   '0': if (not AbleClear)and(Same>Page*10+9) then
                        begin
                          Event.CMark:=True;
                          Event.KeyCode:=InToWo(Now^[Page*10+10]);
                          AbleClear:=True;
                          Exit;
                        end else Exit;
                  'a'..'z': if AbleClear then
                            begin
                              if FindSame(Event.CharCode) then
                              begin
                                Smin:=Event.CharCode;
                                AbleClear:=False;
                                IndexIn:=1;
                                Page:=0;
                                Draw;
                              end;
                            end else
                            begin
                              if FindSame(Smin+Event.CharCode) then
                              begin
                                Smin:=Smin+Event.CharCode;
                                Inc(IndexIn);
                                Page:=0;
                                Draw;
                              end;
                            end;
                   else Exit;
                   end;
            end;
   else Exit;
   end;
   ClearEvent(Event);
end;

{------------object TQWInput-------------}
Constructor TQWInput.Init;
begin
  MaxIn:=4;
  Inherited Init(Broad,moQuWei,'区位');
end;

Procedure TQWInput.FindSame;
var
  Temp,i:Integer;
begin
  Page:=0;
  Temp:=StrsInt(Smin);
  for i:=1 to 4-Length(Smin) do
  Temp:=Temp*10;
  Same:=10;
  for i:=1 to Same do
  Now^[i]:=Temp+i-1;
end;

Procedure TQWInput.HandleEvent;
begin
  Inherited HandleEvent(Event);
  case Event.What of
  evKeyDown :case Event.KeyCode of
             kbBack  : if (IndexIn>0)and(not AbleClear) then
                       begin
                         Dec(IndexIn);
                         Dec(Smin[0]);
                         FindSame;
                         Draw;
                       end else Exit;
             else case Event.CharCode of
                   '1'..'9','0':if AbleClear then
                            begin
                               Smin:=Event.CharCode;
                               AbleClear:=False;
                               IndexIn:=1;
                               FindSame;
                               Draw;
                            end else
                            if IndexIn<3 then
                            begin
                               Smin:=Smin+Event.CharCode;
                               Inc(IndexIn);
                               FindSame;
                               Draw;
                            end else
                            if IndexIn=3 then
                            begin
                               Event.CMark:=True;
                               Event.KeyCode:=InToWo(Now^[Page*10+Ord(Event.CharCode)-Ord('1')+1]);
                               AbleClear:=True;
                               Draw;
                               Exit;
                            end;
                   '-' : if StrsInt(Smin)>0 then
                         begin
                           Smin:=IntStr(StrsInt(Smin)-1);
                           FindSame;
                           Draw;
                           IndexIn:=Length(Smin);
                         end;
                   '=' : if StrsInt(Smin)<999 then
                         begin
                           Smin:=IntStr(StrsInt(Smin)+1);
                           FindSame;
                           Draw;
                           IndexIn:=Length(Smin);
                         end;
                  else Exit;
                  end;
             end;
  else Exit;
  end;
  ClearEvent(Event);
end;



{------------object TInputc--------------}
Constructor TInputc.Init;
begin
  Inherited Init;
  Option:=Option or opFirstPros or opCantSelect;
  GrowMode:=gfGrowHiX+gfGrowLoY+gfGrowHiY;
  Style:=Sty;
  CInp:=New(PEInput,Init(R));
  Size.X:=R.B.X-R.A.X;
  Size.Y:=R.B.Y-R.A.Y;
  MoveTo(R.A.X,R.A.Y);
  ShowStatus:=True;
  ShowMark:=False;
  InXms:=0;
  InImg:=nil;
  List:=nil;
end;

Destructor TInputc.Done;
begin
  HideBroad;
  Dispose(CInp,Done);
  Inherited Done;
end;

Procedure TInputc.MoveTo;
begin
  Inherited MoveTo(X,Y);
  CInp^.MoveTo(X,Y);
end;

Procedure TInputc.ChangeBroad;
begin
  Inherited ChangeBroad(X,Y);
  CInp^.ChangeBroad(X,Y);
end;

Procedure TInputc.Paint;
begin
  if ShowStatus then ShowBroad;
end;

Procedure TInputc.ShowBroad;
begin
  HideMouse;
  if InXms<>0 then FreeXms(InXms);
  if InImg<>nil then FreeMem(InImg,InSize);
  if (Style and ciSaveBack)<>0 then
  begin
    if XmsCanUse and (GetXmsSize>100) then
      InXms:=SaveImageXms(Broad.A.X,Broad.A.Y,Broad.B.X,Broad.B.Y,InXmsSav)
    else
      InImg:=SaveImage(Broad.A.X,Broad.A.Y,Broad.B.X,Broad.B.Y,InSize);
  end;
  if (Style and ciBroad)<>0 then
    SignBroad(Broad.A.X,Broad.A.Y,Broad.B.X,Broad.B.Y,1);
  CInp^.Paint;
  ShowStatus:=True;
end;

Procedure TInputc.HideBroad;
begin
  HideMouse;
  if InXms<>0 then
  begin
    PutImageXms(Origin.X,Origin.Y,InXms,InXmsSav);
    FreeXms(InXms);
    InXms:=0;
  end else if InImg<>nil then
  begin
    PutImage(Origin.X,Origin.Y,InImg^,CopyPut);
    FreeMem(InImg,InSize);
    InImg:=nil;
  end;
  ShowMouse;
  ShowStatus:=False;
end;

Procedure TInputc.SelectMode;
begin
  if List<>nil then Exit;
  List:=New(PLister,Init((CInp^.NWin.a.x div 8)*8,CInp^.NWin.a.y-67,15,4,8,stVScroll+stSaveBack));
  List^.Owner:=@Self;
  List^.Insert('英文     Alt+F6');
  List^.Insert('全拼     Alt+F2');
  List^.Insert('智能全拼 Alt+F4');
  List^.Insert('五笔     Alt+F5');
  List^.Insert('区位     Alt+F7');
  List^.Run(Event);
  if (Event.What=evCommand)and(Event.Command=cmOk) then
  begin
    Dispose(CInp,Done);
    case Event.InfoInt of
    moEnglish:CInp:=New(PEInput,Init(Broad));
    moQuanPin:CInp:=New(PPyInput,Init(Broad));
    moZNQuanPin:CInp:=New(PExtendInput,Init(Broad,moZNQuanPin,ExePath+'PY.FVI'));
    moWuBi:CInp:=New(PExtendInput,Init(Broad,moWuBi,ExePath+'WB.FVI'));
    moQuWei:CInp:=New(PQWInput,Init(Broad));
    else CInp:=New(PEInput,Init(Broad));
    end;
    CInp^.Paint;
  end;
  Dispose(List,Done);
  List:=nil;
end;

Procedure TInputc.HandleEvent;
var
  StateShift:Word;
begin
  if StatusLineActive then Exit;
  StateShift:=Word(GetShiftState);
  if (StateShift and (kbLeftShift+kbCtrlShift)=(kbLeftShift+kbCtrlShift)) then
  begin
    if KeyPressed then ShowMark:=False else ShowMark:=True;
  end else
  if (StateShift and (kbLeftShift+kbCtrlShift)=0) and ShowMark then
  begin
    if ShowStatus then HideBroad else ShowBroad;
    ShowMark:=False;
  end;
  if not ShowStatus then Exit;
  CInp^.HandleEvent(Event);
  if (Event.What=evKeyDown)and(not Event.CMark)and(not JdMode)
     and(Event.CharCode in [#32..#127]) then
  begin
    Event.CMark:=True;
    Event.KeyCode:=Word($A300+Ord(Event.CharCode)+$A0-32);
    Exit;
  end else
  case Event.What of
  evMouseDown:if IsIn(Event.Where,CInp^.JdWin) and Event.Double and
                (Event.What=evMouseDown) and (Event.Buttons=mbLeftButton) then
              begin
                JdMode:=not JdMode;
                CInp^.Draw;
              end else
              if IsIn(Event.Where,CInp^.NWin) and (Event.Buttons=mbRightButton) then
                SelectMode(Event)
              else Exit;
  evKeyDown:case Event.KeyCode of
            kbCtrlF10:begin JdMode:=not JdMode;CInp^.Draw;end;
            kbCtrlF6:SelectMode(Event);
            kbAltF2:begin
                      Dispose(CInp,Done);
                      CInp:=New(PPyInput,Init(Broad));
                      CInp^.Paint;
                    end;
            kbAltF4:begin
                      Dispose(CInp,Done);
                      CInp:=New(PExtendInput,Init(Broad,moZNQuanPin,ExePath+'PY.FVI'));
                      CInp^.Paint;
                    end;
            kbAltF5:begin
                      Dispose(CInp,Done);
                      CInp:=New(PExtendInput,Init(Broad,moWuBi,ExePath+'WB.FVI'));
                      CInp^.Paint;
                    end;
            kbAltF7:begin
                      Dispose(CInp,Done);
                      CInp:=New(PQWInput,Init(Broad));
                      CInp^.Paint;
                    end;
            kbAltF6:begin
                      Dispose(CInp,Done);
                      CInp:=New(PEInput,Init(Broad));
                      CInp^.Paint;
                    end;
            else Exit;
            end;
  else Exit;
  end;
  ClearEvent(Event);
end;



{----------------------------------------}
Procedure InitPyChart;
var
  i:Integer;
begin
 py[1].ind:=1601; py[1].str:='a';
 py[2].ind:=1603; py[2].str:='ai';
 py[3].ind:=1616; py[3].str:='an';
 py[4].ind:=1625; py[4].str:='ang';
 py[5].ind:=1628; py[5].str:='ao';
 py[6].ind:=1637; py[6].str:='ba';
 py[7].ind:=1655; py[7].str:='bai';
 py[8].ind:=1663; py[8].str:='ban';
 py[9].ind:=1678; py[9].str:='bang';
 py[10].ind:=1690; py[10].str:='bao';
 py[11].ind:=1713; py[11].str:='bei';
 py[12].ind:=1728; py[12].str:='ben';
 py[13].ind:=1732; py[13].str:='beng';
 py[14].ind:=1738; py[14].str:='bi';
 py[15].ind:=1762; py[15].str:='bian';
 py[16].ind:=1774; py[16].str:='biao';
 py[17].ind:=1778; py[17].str:='bie';
 py[18].ind:=1782; py[18].str:='bin';
 py[19].ind:=1788; py[19].str:='bing';
 py[20].ind:=1803; py[20].str:='bo';
 py[21].ind:=1822; py[21].str:='bu';
 py[22].ind:=1833; py[22].str:='ca';
 py[23].ind:=1834; py[23].str:='cai';
 py[24].ind:=1845; py[24].str:='can';
 py[25].ind:=1852; py[25].str:='cang';
 py[26].ind:=1857; py[26].str:='cao';
 py[27].ind:=1862; py[27].str:='ce';
 py[28].ind:=1867; py[28].str:='ceng';
 py[29].ind:=1869; py[29].str:='cha';
 py[30].ind:=1880; py[30].str:='chai';
 py[31].ind:=1883; py[31].str:='chan';
 py[32].ind:=1893; py[32].str:='chang';
 py[33].ind:=1912; py[33].str:='chao';
 py[34].ind:=1921; py[34].str:='che';
 py[35].ind:=1927; py[35].str:='chen';
 py[36].ind:=1937; py[36].str:='cheng';
 py[37].ind:=1952; py[37].str:='chi';
 py[38].ind:=1968; py[38].str:='chong';
 py[39].ind:=1973; py[39].str:='chou';
 py[40].ind:=1985; py[40].str:='chu';
 py[41].ind:=2007; py[41].str:='chuai';
 py[42].ind:=2008; py[42].str:='chuan';
 py[43].ind:=2015; py[43].str:='chuang';
 py[44].ind:=2021; py[44].str:='chui';
 py[45].ind:=2026; py[45].str:='chun';
 py[46].ind:=2033; py[46].str:='chuo';
 py[47].ind:=2035; py[47].str:='ci';
 py[48].ind:=2047; py[48].str:='cong';
 py[49].ind:=2053; py[49].str:='cou';
 py[50].ind:=2054; py[50].str:='cu';
 py[51].ind:=2058; py[51].str:='cuan';
 py[52].ind:=2061; py[52].str:='cui';
 py[53].ind:=2069; py[53].str:='cun';
 py[54].ind:=2072; py[54].str:='cuo';
 py[55].ind:=2078; py[55].str:='da';
 py[56].ind:=2084; py[56].str:='dai';
 py[57].ind:=2102; py[57].str:='dan';
 py[58].ind:=2117; py[58].str:='dang';
 py[59].ind:=2122; py[59].str:='dao';
 py[60].ind:=2134; py[60].str:='de';
 py[61].ind:=2137; py[61].str:='deng';
 py[62].ind:=2144; py[62].str:='di';
 py[63].ind:=2163; py[63].str:='dian';
 py[64].ind:=2179; py[64].str:='diao';
 py[65].ind:=2188; py[65].str:='die';
 py[66].ind:=2201; py[66].str:='ding';
 py[67].ind:=2210; py[67].str:='diu';
 py[68].ind:=2211; py[68].str:='dong';
 py[69].ind:=2221; py[69].str:='dou';
 py[70].ind:=2228; py[70].str:='du';
 py[71].ind:=2243; py[71].str:='duan';
 py[72].ind:=2249; py[72].str:='dui';
 py[73].ind:=2253; py[73].str:='dun';
 py[74].ind:=2262; py[74].str:='duo';
 py[75].ind:=2274; py[75].str:='e';
 py[76].ind:=2287; py[76].str:='en';
 py[77].ind:=2288; py[77].str:='er';
 py[78].ind:=2302; py[78].str:='fa';
 py[79].ind:=2310; py[79].str:='fan';
 py[80].ind:=2327; py[80].str:='fang';
 py[81].ind:=2338; py[81].str:='fei';
 py[82].ind:=2350; py[82].str:='fen';
 py[83].ind:=2365; py[83].str:='feng';
 py[84].ind:=2380; py[84].str:='fo';
 py[85].ind:=2381; py[85].str:='fou';
 py[86].ind:=2382; py[86].str:='fu';
 py[87].ind:=2433; py[87].str:='ga';
 py[88].ind:=2435; py[88].str:='gai';
 py[89].ind:=2441; py[89].str:='gan';
 py[90].ind:=2452; py[90].str:='gang';
 py[91].ind:=2461; py[91].str:='gao';
 py[92].ind:=2471; py[92].str:='ge';
 py[93].ind:=2488; py[93].str:='gei';
 py[94].ind:=2489; py[94].str:='gen';
 py[95].ind:=2491; py[95].str:='geng';
 py[96].ind:=2504; py[96].str:='gong';
 py[97].ind:=2519; py[97].str:='gou';
 py[98].ind:=2528; py[98].str:='gu';
 py[99].ind:=2546; py[99].str:='gua';
 py[100].ind:=2552; py[100].str:='guai';
 py[101].ind:=2555; py[101].str:='guan';
 py[102].ind:=2566; py[102].str:='guang';
 py[103].ind:=2569; py[103].str:='gui';
 py[104].ind:=2585; py[104].str:='gun';
 py[105].ind:=2588; py[105].str:='guo';
 py[106].ind:=2594; py[106].str:='ha';
 py[107].ind:=2601; py[107].str:='hai';
 py[108].ind:=2608; py[108].str:='han';
 py[109].ind:=2627; py[109].str:='hang';
 py[110].ind:=2630; py[110].str:='hao';
 py[111].ind:=2639; py[111].str:='he';
 py[112].ind:=2657; py[112].str:='hei';
 py[113].ind:=2659; py[113].str:='hen';
 py[114].ind:=2663; py[114].str:='heng';
 py[115].ind:=2668; py[115].str:='hong';
 py[116].ind:=2677; py[116].str:='hou';
 py[117].ind:=2684; py[117].str:='hu';
 py[118].ind:=2708; py[118].str:='hua';
 py[119].ind:=2717; py[119].str:='huai';
 py[120].ind:=2722; py[120].str:='huan';
 py[121].ind:=2736; py[121].str:='huang';
 py[122].ind:=2750; py[122].str:='hui';
 py[123].ind:=2771; py[123].str:='hun';
 py[124].ind:=2777; py[124].str:='huo';
 py[125].ind:=2787; py[125].str:='ji';
 py[126].ind:=2846; py[126].str:='jia';
 py[127].ind:=2863; py[127].str:='jian';
 py[128].ind:=2909; py[128].str:='jiang';
 py[129].ind:=2922; py[129].str:='jiao';
 py[130].ind:=2950; py[130].str:='jie';
 py[131].ind:=2977; py[131].str:='jin';
 py[132].ind:=3003; py[132].str:='jing';
 py[133].ind:=3028; py[133].str:='jiong';
 py[134].ind:=3030; py[134].str:='jiu';
 py[135].ind:=3047; py[135].str:='ju';
 py[136].ind:=3072; py[136].str:='juan';
 py[137].ind:=3079; py[137].str:='jue';
 py[138].ind:=3089; py[138].str:='jun';
 py[139].ind:=3106; py[139].str:='ka';
 py[140].ind:=3110; py[140].str:='kai';
 py[141].ind:=3115; py[141].str:='kan';
 py[142].ind:=3121; py[142].str:='kang';
 py[143].ind:=3128; py[143].str:='kao';
 py[144].ind:=3132; py[144].str:='ke';
 py[145].ind:=3147; py[145].str:='ken';
 py[146].ind:=3151; py[146].str:='keng';
 py[147].ind:=3153; py[147].str:='kong';
 py[148].ind:=3157; py[148].str:='kou';
 py[149].ind:=3161; py[149].str:='ku';
 py[150].ind:=3168; py[150].str:='kua';
 py[151].ind:=3173; py[151].str:='kuai';
 py[152].ind:=3177; py[152].str:='kuan';
 py[153].ind:=3179; py[153].str:='kuang';
 py[154].ind:=3187; py[154].str:='kui';
 py[155].ind:=3204; py[155].str:='kun';
 py[156].ind:=3208; py[156].str:='kuo';
 py[157].ind:=3212; py[157].str:='la';
 py[158].ind:=3219; py[158].str:='lai';
 py[159].ind:=3222; py[159].str:='lan';
 py[160].ind:=3237; py[160].str:='lang';
 py[161].ind:=3244; py[161].str:='lao';
 py[162].ind:=3253; py[162].str:='le';
 py[163].ind:=3255; py[163].str:='lei';
 py[164].ind:=3266; py[164].str:='leng';
 py[165].ind:=3269; py[165].str:='li';
 py[166].ind:=3309; py[166].str:='lia';
 py[167].ind:=3310; py[167].str:='lian';
 py[168].ind:=3324; py[168].str:='liang';
 py[169].ind:=3335; py[169].str:='liao';
 py[170].ind:=3348; py[170].str:='lie';
 py[171].ind:=3353; py[171].str:='lin';
 py[172].ind:=3364; py[172].str:='ling';
 py[173].ind:=3379; py[173].str:='liu';
 py[174].ind:=3390; py[174].str:='long';
 py[175].ind:=3405; py[175].str:='lou';
 py[176].ind:=3411; py[176].str:='lu';
 py[177].ind:=3445; py[177].str:='luan';
 py[178].ind:=3451; py[178].str:='lue';
 py[179].ind:=3453; py[179].str:='lun';
 py[180].ind:=3460; py[180].str:='luo';
 py[181].ind:=3472; py[181].str:='ma';
 py[182].ind:=3481; py[182].str:='mai';
 py[183].ind:=3487; py[183].str:='man';
 py[184].ind:=3502; py[184].str:='mang';
 py[185].ind:=3508; py[185].str:='mao';
 py[186].ind:=3521; py[186].str:='mei';
 py[187].ind:=3537; py[187].str:='men';
 py[188].ind:=3540; py[188].str:='meng';
 py[189].ind:=3548; py[189].str:='mi';
 py[190].ind:=3562; py[190].str:='mian';
 py[191].ind:=3571; py[191].str:='miao';
 py[192].ind:=3579; py[192].str:='mie';
 py[193].ind:=3581; py[193].str:='min';
 py[194].ind:=3587; py[194].str:='ming';
 py[195].ind:=3593; py[195].str:='miu';
 py[196].ind:=3594; py[196].str:='mo';
 py[197].ind:=3617; py[197].str:='mou';
 py[198].ind:=3620; py[198].str:='mu';
 py[199].ind:=3635; py[199].str:='na';
 py[200].ind:=3642; py[200].str:='nai';
 py[201].ind:=3647; py[201].str:='nan';
 py[202].ind:=3650; py[202].str:='nang';
 py[203].ind:=3651; py[203].str:='nao';
 py[204].ind:=3656; py[204].str:='ne';
 py[205].ind:=3657; py[205].str:='nei';
 py[206].ind:=3659; py[206].str:='nen';
 py[207].ind:=3660; py[207].str:='neng';
 py[208].ind:=3661; py[208].str:='ni';
 py[209].ind:=3672; py[209].str:='nian';
 py[210].ind:=3679; py[210].str:='niang';
 py[211].ind:=3681; py[211].str:='niao';
 py[212].ind:=3683; py[212].str:='nie';
 py[213].ind:=3690; py[213].str:='nin';
 py[214].ind:=3691; py[214].str:='ning';
 py[215].ind:=3703; py[215].str:='niu';
 py[216].ind:=3707; py[216].str:='nong';
 py[217].ind:=3711; py[217].str:='nu';
 py[218].ind:=3715; py[218].str:='nuan';
 py[219].ind:=3716; py[219].str:='nue';
 py[220].ind:=3718; py[220].str:='nuo';
 py[221].ind:=3722; py[221].str:='o';
 py[222].ind:=3723; py[222].str:='ou';
 py[223].ind:=3730; py[223].str:='pa';
 py[224].ind:=3736; py[224].str:='pai';
 py[225].ind:=3742; py[225].str:='pan';
 py[226].ind:=3750; py[226].str:='pang';
 py[227].ind:=3755; py[227].str:='pao';
 py[228].ind:=3762; py[228].str:='pei';
 py[229].ind:=3771; py[229].str:='pen';
 py[230].ind:=3773; py[230].str:='peng';
 py[231].ind:=3787; py[231].str:='pi';
 py[232].ind:=3810; py[232].str:='pian';
 py[233].ind:=3814; py[233].str:='piao';
 py[234].ind:=3818; py[234].str:='pie';
 py[235].ind:=3820; py[235].str:='pin';
 py[236].ind:=3825; py[236].str:='ping';
 py[237].ind:=3834; py[237].str:='po';
 py[238].ind:=3842; py[238].str:='pou';
 py[239].ind:=3843; py[239].str:='pu';
 py[240].ind:=3858; py[240].str:='qi';
 py[241].ind:=3894; py[241].str:='qia';
 py[242].ind:=3903; py[242].str:='qian';
 py[243].ind:=3925; py[243].str:='qiang';
 py[244].ind:=3933; py[244].str:='qiao';
 py[245].ind:=3948; py[245].str:='qie';
 py[246].ind:=3953; py[246].str:='qin';
 py[247].ind:=3964; py[247].str:='qing';
 py[248].ind:=3977; py[248].str:='qiong';
 py[249].ind:=3979; py[249].str:='qiu';
 py[250].ind:=3987; py[250].str:='qu';
 py[251].ind:=4006; py[251].str:='quan';
 py[252].ind:=4017; py[252].str:='que';
 py[253].ind:=4025; py[253].str:='qun';
 py[254].ind:=4027; py[254].str:='ran';
 py[255].ind:=4031; py[255].str:='rang';
 py[256].ind:=4036; py[256].str:='rao';
 py[257].ind:=4039; py[257].str:='re';
 py[258].ind:=4041; py[258].str:='ren';
 py[259].ind:=4051; py[259].str:='reng';
 py[260].ind:=4053; py[260].str:='ri';
 py[261].ind:=4054; py[261].str:='rong';
 py[262].ind:=4064; py[262].str:='rou';
 py[263].ind:=4067; py[263].str:='ru';
 py[264].ind:=4077; py[264].str:='ruan';
 py[265].ind:=4079; py[265].str:='rui';
 py[266].ind:=4082; py[266].str:='run';
 py[267].ind:=4084; py[267].str:='ruo';
 py[268].ind:=4086; py[268].str:='sa';
 py[269].ind:=4089; py[269].str:='sai';
 py[270].ind:=4093; py[270].str:='san';
 py[271].ind:=4103; py[271].str:='sang';
 py[272].ind:=4106; py[272].str:='sao';
 py[273].ind:=4110; py[273].str:='se';
 py[274].ind:=4113; py[274].str:='sen';
 py[275].ind:=4114; py[275].str:='seng';
 py[276].ind:=4115; py[276].str:='sha';
 py[277].ind:=4124; py[277].str:='shai';
 py[278].ind:=4126; py[278].str:='shan';
 py[279].ind:=4142; py[279].str:='shang';
 py[280].ind:=4150; py[280].str:='shao';
 py[281].ind:=4161; py[281].str:='she';
 py[282].ind:=4173; py[282].str:='shen';
 py[283].ind:=4189; py[283].str:='sheng';
 py[284].ind:=4206; py[284].str:='shi';
 py[285].ind:=4253; py[285].str:='shou';
 py[286].ind:=4263; py[286].str:='shu';
 py[287].ind:=4302; py[287].str:='shua';
 py[288].ind:=4304; py[288].str:='shuai';
 py[289].ind:=4308; py[289].str:='shuan';
 py[290].ind:=4310; py[290].str:='shuang';
 py[291].ind:=4313; py[291].str:='shui';
 py[292].ind:=4317; py[292].str:='shun';
 py[293].ind:=4321; py[293].str:='shuo';
 py[294].ind:=4325; py[294].str:='si';
 py[295].ind:=4341; py[295].str:='song';
 py[296].ind:=4349; py[296].str:='sou';
 py[297].ind:=4353; py[297].str:='su';
 py[298].ind:=4365; py[298].str:='suan';
 py[299].ind:=4368; py[299].str:='sui';
 py[300].ind:=4379; py[300].str:='sun';
 py[301].ind:=4382; py[301].str:='suo';
 py[302].ind:=4390; py[302].str:='ta';
 py[303].ind:=4405; py[303].str:='tai';
 py[304].ind:=4414; py[304].str:='tan';
 py[305].ind:=4432; py[305].str:='tang';
 py[306].ind:=4445; py[306].str:='tao';
 py[307].ind:=4456; py[307].str:='te';
 py[308].ind:=4457; py[308].str:='teng';
 py[309].ind:=4461; py[309].str:='ti';
 py[310].ind:=4476; py[310].str:='tian';
 py[311].ind:=4484; py[311].str:='tiao';
 py[312].ind:=4489; py[312].str:='tie';
 py[313].ind:=4492; py[313].str:='ting';
 py[314].ind:=4508; py[314].str:='tong';
 py[315].ind:=4521; py[315].str:='tou';
 py[316].ind:=4525; py[316].str:='tu';
 py[317].ind:=4536; py[317].str:='tuan';
 py[318].ind:=4538; py[318].str:='tui';
 py[319].ind:=4544; py[319].str:='tun';
 py[320].ind:=4547; py[320].str:='tuo';
 py[321].ind:=4558; py[321].str:='wa';
 py[322].ind:=4565; py[322].str:='wai';
 py[323].ind:=4567; py[323].str:='wan';
 py[324].ind:=4584; py[324].str:='wang';
 py[325].ind:=4594; py[325].str:='wei';
 py[326].ind:=4633; py[326].str:='wen';
 py[327].ind:=4643; py[327].str:='weng';
 py[328].ind:=4646; py[328].str:='wo';
 py[329].ind:=4654; py[329].str:='wu';
 py[330].ind:=4684; py[330].str:='xi';
 py[331].ind:=4725; py[331].str:='xia';
 py[332].ind:=4738; py[332].str:='xian';
 py[333].ind:=4764; py[333].str:='xiang';
 py[334].ind:=4784; py[334].str:='xiao';
 py[335].ind:=4808; py[335].str:='xie';
 py[336].ind:=4829; py[336].str:='xin';
 py[337].ind:=4839; py[337].str:='xing';
 py[338].ind:=4854; py[338].str:='xiong';
 py[339].ind:=4861; py[339].str:='xiu';
 py[340].ind:=4870; py[340].str:='xu';
 py[341].ind:=4889; py[341].str:='xuan';
 py[342].ind:=4905; py[342].str:='xue';
 py[343].ind:=4911; py[343].str:='xun';
 py[344].ind:=4925; py[344].str:='ya';
 py[345].ind:=4941; py[345].str:='yan';
 py[346].ind:=4974; py[346].str:='yang';
 py[347].ind:=4991; py[347].str:='yao';
 py[348].ind:=5012; py[348].str:='ye';
 py[349].ind:=5027; py[349].str:='yi';
 py[350].ind:=5080; py[350].str:='yin';
 py[351].ind:=5102; py[351].str:='ying';
 py[352].ind:=5120; py[352].str:='yo';
 py[353].ind:=5121; py[353].str:='yong';
 py[354].ind:=5136; py[354].str:='you';
 py[355].ind:=5156; py[355].str:='yu';
 py[356].ind:=5207; py[356].str:='yuan';
 py[357].ind:=5227; py[357].str:='yue';
 py[358].ind:=5237; py[358].str:='yun';
 py[359].ind:=5249; py[359].str:='za';
 py[360].ind:=5252; py[360].str:='zai';
 py[361].ind:=5259; py[361].str:='zan';
 py[362].ind:=5263; py[362].str:='zang';
 py[363].ind:=5266; py[363].str:='zao';
 py[364].ind:=5280; py[364].str:='ze';
 py[365].ind:=5284; py[365].str:='zei';
 py[366].ind:=5285; py[366].str:='zen';
 py[367].ind:=5286; py[367].str:='zeng';
 py[368].ind:=5290; py[368].str:='zha';
 py[369].ind:=5310; py[369].str:='zhai';
 py[370].ind:=5316; py[370].str:='zhan';
 py[371].ind:=5333; py[371].str:='zhang';
 py[372].ind:=5348; py[372].str:='zhao';
 py[373].ind:=5358; py[373].str:='zhe';
 py[374].ind:=5368; py[374].str:='zhen';
 py[375].ind:=5384; py[375].str:='zheng';
 py[376].ind:=5405; py[376].str:='zhi';
 py[377].ind:=5448; py[377].str:='zhong';
 py[378].ind:=5459; py[378].str:='zhou';
 py[379].ind:=5473; py[379].str:='zhu';
 py[380].ind:=5505; py[380].str:='zhua';
 py[381].ind:=5507; py[381].str:='zhuai';
 py[382].ind:=5508; py[382].str:='zhuan';
 py[383].ind:=5514; py[383].str:='zhuang';
 py[384].ind:=5521; py[384].str:='zhui';
 py[385].ind:=5527; py[385].str:='zhun';
 py[386].ind:=5529; py[386].str:='zhuo';
 py[387].ind:=5540; py[387].str:='zi';
 py[388].ind:=5555; py[388].str:='zong';
 py[389].ind:=5562; py[389].str:='zou';
 py[390].ind:=5566; py[390].str:='zu';
 py[391].ind:=5574; py[391].str:='zuan';
 py[392].ind:=5576; py[392].str:='zui';
 py[393].ind:=5580; py[393].str:='zun';
 py[394].ind:=5582; py[394].str:='zuo';
 py[MaxPy].ind:=5601; py[MaxPy].str:='z'+chr(ord('z')+1);
 for i:=1 to MaxPy do
 Py[i].Ind:=(Py[i].Ind div 100 -16)*94+Py[i].Ind mod 100;
end;

begin
  InitPyChart;
end.