修改XPMenu让ToolButton在Down=True时正确显示
来源:互联网 发布:淘宝3d自动成像软件 编辑:程序博客网 时间:2024/06/11 12:54
XPMenu是一个不错的程序界面效果控件,但它也存在不少不足之处。我最近又对它作了一点修改。
原因是我在程序里有一个ToolButton,其Style=tbsButton,当Down=True时,XPMenu绘制的效果效果跟Down=False时一样,也就是说根本看不出它是按下的。当把Style改为tbsCheck后,却能显示效果,但是底色很深。
这个按钮来我是用来表示某个面板是否可以显示的,我希望它像OfficeXP的工具按钮那样,当工具条显示时,在按钮上画个边框即可,而不是以很深的底色显示。
XPMenu绘制工具栏按钮是由TXPMenu.ToolBarDrawButton函数完成,原型为如下:
if (cdsHot in State) then
begin
if (cdsChecked in State) or (Button.Down) or (cdsSelected in State) then
ACanvas.Brush.Color := FCheckedAreaSelectColor
else
ACanvas.brush.color := FBSelectColor;
HasBorder := true;
HasBkg := true;
end;
if ((cdsChecked in State) and not (cdsHot in State)) then
begin
ACanvas.Brush.Color := FCheckedAreaColor;
HasBorder := true;
HasBkg := true;
end;
if (cdsIndeterminate in State) and not (cdsHot in State) then
begin
ACanvas.Brush.Color := FBSelectColor;
HasBkg := true;
end;
if (cdsHot in State) then
begin
if (cdsChecked in State) or (Button.Down) or (cdsSelected in State) then
ACanvas.Brush.Color := FCheckedAreaSelectColor
else
ACanvas.brush.color := FBSelectColor;
HasBorder := true;
HasBkg := true;
end;
if ((cdsChecked in State) and not (cdsHot in State)) then
begin
ACanvas.Brush.Color := FCheckedAreaColor;
HasBorder := true;
HasBkg := true;
end;
{Modify: Conch 2005-3-10 在Down=true的按钮上画出边框}
if (Button.Down) and not (cdsHot in State) then
begin
HasBorder := true;
HasBkg := false;
end;
//Conch
if (cdsIndeterminate in State) and not (cdsHot in State) then
begin
ACanvas.Brush.Color := FBSelectColor;
HasBkg := true;
end;
- 修改XPMenu让ToolButton在Down=True时正确显示
- toolButton
- QT之在toolButton中添加图标和文字,使文字显示在图标下方
- 如何让你的网页在IE8下正确显示
- 让脸部显示在更正确的位置
- 在windowless=true的条件下让silverlight输入中文
- 如何让AutoSize为true的label在picturebox上面居中显示
- 让secureCRT正确显示中文
- 让secureCRT正确显示中文
- 让secureCRT正确显示中文
- 让secureCRT正确显示中文
- 让 HyperTerminal 正确显示中文
- 通过修改注册表来让回收站显示在计算机
- 在php中让用户自定义时区 正确显示当前时间
- 让收藏、点赞的即时状态的交互正确的显示在ListView上
- 如何让ExtJS 5在IE 11兼容模式中显示正确
- Django在admin模块中显示auto_now_add=True或auto_now=True的时间类型列
- 让英文操作系统正确显示中文
- 沈阳市振东中学团委2004——2005学年度下学期工作计划
- VC++中嵌入Media Player
- 送你一个春天的祝福
- 以前写的一个类,用OPENGL导入MD2模型,带关键桢动画
- windows录音机录制系统内的声音
- 修改XPMenu让ToolButton在Down=True时正确显示
- 解决IE不能打开新窗口的问题
- 開天辟地
- Windows下Apache+Tomcat+MySQL+jsp+php的服务器整合配置经验总结
- [译]关于“经典VB”的一些想法
- PHP多文件上传类
- JDK1.4安装与环境配置完全图解(windows)
- 第一个Eclipse程序完全图解
- Eclipse入门-- Eclipse的使用简介及插件开发