CnPack Forum


 
Subject: 抄CnPack的,ASCII速查
flamingo
新警察
Rank: 1



UID 179
Digest Posts 0
Credits 39
Posts 39
点点分 39
Reading Access 10
Registered 2003-10-12
Status Offline
Post at 2005-11-9 05:06  Profile | Blog | P.M. 
抄CnPack的,ASCII速查

由于我自己的原因,无法使用完整的CnPack,只好抄抄原代码,把ASCII速查表改成了EXE,作为独立的工具来用。有象我这样情况的,不妨用用。


Attachment: CnAscII.rar (2005-11-9 05:06, 201.27 K)
Download count 446
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2005-11-10 15:42  Profile | Blog | P.M. 
移植得不错。尤其是将不可打印字符所在的格子的背景色改成淡黄,实在是一个体贴用户的地方。
我们也考虑这样改改。^_^
Top
flamingo
新警察
Rank: 1



UID 179
Digest Posts 0
Credits 39
Posts 39
点点分 39
Reading Access 10
Registered 2003-10-12
Status Offline
Post at 2005-11-17 23:27  Profile | Blog | P.M. 
哦,这段代码按原作改编如下:

const
   SCnNonVisualCode:array[1..4,1..8] of string=
   (('NUL','SOH','STX','EXT','EQT','ENQ','ACK','BEL'),
    ('BS','TAB','LF','VT','FF','CR','SO','SI'),
    ('DLE','DC1','DC2','DC3','DC4','NAK','SYN','ETB'),
    ('CAN','EM','SUB','ESC','FS','GS','RS','US'));

procedure TAscIIForm.GridDrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  OutStr:String;
  act:integer;
begin
  with Sender as TStringGrid do
  begin
    OutStr := Cells[ACol, ARow];
    act:=integer((ARow>0)and(ACol>0)and(ARow<=4));
    if (gdSelected in State)then // OLD-X->and not (gdFixed in State) then
      Canvas.Brush.Color := $91B8FF //OLD-X->$00D2BDB6
    else
      if (FPage<act)then Canvas.Brush.Color:=clCream;
    if FPage<act then OutStr:=SCnNonVisualCode[ARow][ACol];
    Canvas.FillRect(Rect);   
    SetBkMode(Canvas.Handle,TRANSPARENT);
    Canvas.TextOut(Rect.Left + ((Rect.Right - Rect.Left -
      Canvas.TextWidth(OutStr)) shr 1), Rect.Top + ((Rect.Bottom - Rect.top
      - Canvas.TextHeight(OutStr)) shr 1), OutStr);
  end;
end;
Top
 




All times are GMT++8, the time now is 2024-11-25 11:44

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.008800 second(s), 10 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP