TabBar其样式可以基于JvTabBar动态更改 [英] TabBar whose style can be changed dynamically based on JvTabBar

查看:249
本文介绍了TabBar其样式可以基于JvTabBar动态更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过许多不同的图书馆,但没有来。
如果不在Painter中引入自己的样式,就不能指定它们。
我需要能够快速和动态地更改样式标签。



作为回应,我展示了我的发展。


$

解决方案

我决定升级它们中最简单的:JVCL的TJvTabBar(最新版本:13415)



以下是结果。



默认)





之后







样式源(从带有透明度的png文件导入的所有图形)



轻松将任何个人风格应用于任何JvTabBar

  var tmp:TStrings; 
begin
tmp:= TStringList.Create;
tmp.Values ['TOP_background']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_background.png';
tmp.Values ['TOP_active_left_side']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_left_side.png';
tmp.Values ['TOP_active_right_side']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_right_side.png';
tmp.Values ['TOP_active_center']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_center.png';

tmp.Values ['BOTTOM_background']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_background.png';
tmp.Values ['BOTTOM_active_left_side']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_left_side.png';
tmp.Values ['BOTTOM_active_right_side']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_right_side.pside';
tmp.Values ['BOTTOM_active_center']:= ExtractFileDir(Application.ExeName)+'\skins \default\tabs-BOTTOM_active_center.png';

tmp.Values ['CLOSEBUTTON_normal']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_normal.png';
tmp.Values ['CLOSEBUTTON_selected']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_selected.png';
tmp.Values ['CLOSEBUTTON_disabled']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_disabled.png';
tmp.Values ['CLOSEBUTTON_closing']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_closing.png';
tmp.Values ['CLOSEBUTTON_modified']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_modified.png';
tmp.Values ['CLOSEBUTTON_closing_modified']:= ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_closing_modified.png';

JvTabBar1.StyleImages:= tmp;

tmp.Values ['BOTTOM_background']:= ExtractFileDir(Application.ExeName)+'\skins\default\MYMOD_tabs-BOTTOM_background.png';

JvTabBar2.StyleImages:= tmp;

主要更改




  • 添加了指定自己风格的能力(JvTabBar1.StyleImages)

  • 添加了将关闭按钮移动到右边的功能(JvTabBar1.CloseButtonRight: true或false)

  • 许多修正文字/图示/按钮的大小和位置/卷动



我的JvTabBar.pas mod您可以在此下载 http://pastebin.com/JmbufHy0



和示例源样式+ JvTabBar.pas http://www.sendspace.com/file/shhuzr


I have tried many different libraries, but none came. None of them can not be specified without introducing his own style in Painter. I need to be able to quickly and dynamically change the style tab.

In response, I showed my developments.

If someone has similar developments - write them in response.

解决方案

I decided to upgrade the simplest of them: TJvTabBar of JVCL (latest revision: 13415)

Here is the result.

Before (default)

After

Style sources (All graphics imported from png files with transparency)

Easy apply any personal style to any JvTabBar

var tmp:TStrings;
begin    
  tmp:=TStringList.Create;
  tmp.Values['TOP_background']:=                ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_background.png';
  tmp.Values['TOP_active_left_side']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_left_side.png';
  tmp.Values['TOP_active_right_side']:=         ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_right_side.png';
  tmp.Values['TOP_active_center']:=             ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_center.png';

  tmp.Values['BOTTOM_background']:=             ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_background.png';
  tmp.Values['BOTTOM_active_left_side']:=       ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_left_side.png';
  tmp.Values['BOTTOM_active_right_side']:=      ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_right_side.png';
  tmp.Values['BOTTOM_active_center']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_center.png';

  tmp.Values['CLOSEBUTTON_normal']:=            ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_normal.png';
  tmp.Values['CLOSEBUTTON_selected']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_selected.png';
  tmp.Values['CLOSEBUTTON_disabled']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_disabled.png';
  tmp.Values['CLOSEBUTTON_closing']:=           ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_closing.png';
  tmp.Values['CLOSEBUTTON_modified']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_modified.png';
  tmp.Values['CLOSEBUTTON_closing_modified']:=  ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_closing_modified.png';

  JvTabBar1.StyleImages:=tmp;

  tmp.Values['BOTTOM_background']:=             ExtractFileDir(Application.ExeName)+'\skins\default\MYMOD_tabs-BOTTOM_background.png';

  JvTabBar2.StyleImages:=tmp;

Main changes

  • Added ability to specify their own style ( JvTabBar1.StyleImages )
  • Added the ability to move the close button to the right ( JvTabBar1.CloseButtonRight: = true or false )
  • Many fixes to the size and position of text / icons / buttons / scroll

My JvTabBar.pas mod You can download it here http://pastebin.com/JmbufHy0

And example source style + JvTabBar.pas http://www.sendspace.com/file/shhuzr

这篇关于TabBar其样式可以基于JvTabBar动态更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆