Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnVCL 组件包
» TCnButtonEdit 组件的 ButtonVisible 与 Alignment 属性的配合BUG
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: TCnButtonEdit 组件的 ButtonVisible 与 Alignment 属性的配合BUG
gaoyanan
(高亚男)
普通灌水员
UID 39457
Digest Posts 0
Credits 62
Posts 22
点点分 62
Reading Access 10
Registered 2008-4-1
Status Offline
#1
Post at 2010-10-25 17:07
Profile
|
Blog
|
P.M.
|
TCnButtonEdit 组件的 ButtonVisible 与 Alignment 属性的配合BUG
前几天发了一贴,一直没有被审核,我不知道是不是因为我丢了个网页链接的原因,因为我另一个回复贴也被一直审核中。
网络很烂,可能会发不出来,所以我简明说一下问题:
1.当ButtonVisible 为true的时候,Alignment 不会有任何问题,当ButtonVisible 为False时,修改Alignment 为taRightJustify,这个时候,会发现文字的右边会缺少几个字符,他们跑到右侧边界外面了,宽度大概就是按钮宽度,原因在UpdateFormatRect函数中,如下屏蔽代码,问题解决。
原因应该是ClientRect代表的就是整个对象的绘图区。小弟对windows消息不是很纯熟,猜的。
procedure TCnButtonEdit.UpdateFormatRect;
var
Rect: TRect;
begin
Rect := ClientRect;
if FButtonVisible then
Dec(Rect.Right, FButton.Height)
{
else
Inc(Rect.Right, FButton.Height)}
;
SendMessage(Handle, EM_SETRECTNP, 0, Longint(@Rect));
end;
2.解决上一个问题后,依旧设置ButtonVisible 为False,在设计期间修改Alignment属性,按钮会莫名其妙出现,如下增加一段判断代码,问题解决。
procedure TCnButtonEdit.WMSize(var Msg: TWMSize);
begin
inherited;
if FButtonVisible then
FButton.Width := FButton.Height
;
UpdateFormatRect;
end;
注:没有严格检查其他问题。
[
本帖最后由 gaoyanan 于 2010-10-25 17:09 编辑
]
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#2
Post at 2010-10-25 20:57
Profile
|
Blog
|
P.M.
感谢报告,我们检查一下争取合并进去。
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-24 10:20
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.019438 second(s), 8 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats