CnPack Forum


 
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-7-4 10:06  Profile | Blog | P.M. 
[BUG]TCnEdit

TCnEdit.Alignment = taRightJustify時,處理不理想:
1.得到焦點時,在左邊顯示,此時輸入1個字符馬上就變到右邊顯示了
2.得到焦點時,在左邊顯示,但是失去焦點時,有時不會還原到右邊
Top
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-7-4 10:21  Profile | Blog | P.M. 
粗略解決一下:

DoExit
begin
  ...
  //jAmEs_, 04/07/2009, Begin
  Invalidate;
  //jAmEs_, 04/07/2009, End
end;

WMPaint
begin
  ...
        //画文字
        MArgins := GetTextMArgins;
        //jAmEs_, 04/07/2009, Begin
        if Focused then
          Left := MArgins.X
        else
          case FAlignment of
            taLeftJustify: Left := MArgins.X;
            tArightJustify: Left := ClientWidth - TextWidth(S) - MArgins.X - 1;
          else
            Left := (ClientWidth - TextWidth(S)) div 2;
          end;
        //jAmEs_, 04/07/2009, End
        TextRect(R, Left, MArgins.Y, S);

        if (FLinkStyle <> lsNone) then   //画按钮
  ...
end;
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 2009-7-4 23:41  Profile | Blog | P.M. 
感谢指出,已修正并提交至SVN。
Top
 




All times are GMT++8, the time now is 2024-11-22 06:59

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

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