DELPHI的美化插件VCLskin

来源:互联网 发布:js如何获取访客ip 编辑:程序博客网 时间:2024/05/17 17:41
 

学习DELPHI时为了美化程序,

所以在网上找到了这个插件!

1. VCLSkin综述
 
VCLSkin是一个能让Delphi程序变得非常漂亮的控件包. 它允许允许软件开发人员不用修改程序代码便把软件界面变得非常漂亮。它的美化支持窗体和控件和菜单。VCLSkin同时也提供了大量高质量的skin(皮肤)让你应用于你的程序。

2. VCLSkin特点
 
VCLSkin是一个用于让用户的程序界面更加漂亮的扩展控件。 它允许软件开发人员不用修改源代码就能让他们的程序界面更加漂亮。一个标准的程序界面能在窗体放入VCLSkin控件后变得非常漂亮,而这公公需要几分钟的时间。
VCLSkin 能做些什么 ?
不像其它控件那样,你需要修改源代码才能构建一个漂亮的界面, VCLskin 能让Delphi的标准控件在一下子就变得非常漂亮,而这一切都不用修改源代码。
 
VCLSkin 支持以下的窗体:
  • Delphi Form
  • MDIform . (normal,Maximized, MInimized)
  • Common Windows dialogs (Open/Save,Font,Print,Color).
  • MsgBox.
  • Exception MsgBox.
VCLSkin 支持的标准控件:
  • The title bar of TForm
  • The title bar buttons
  • The borders of Tform
  • Tbutton,TBitbtn.
  • Tradiobutton and Tcheckbox
  • Tmainmenu and Tpopupmenu
  • Toolbar buttons
  • TTabcontrol and TPageControl
  • T Progressbar
  • TStatusbar
  • TCustomCombox,Tcombobox, TDbCombobox
  • TPanel and TGroupbox
  • TMemo, TListBox,TListView,TTreeview
  • TRadioGroup , TDBRadioGroup.
  • TCustomGrid,TStringgrid,TDrawgrid,Tdbgrid.
  • Third party component, Enlib, AdvGrid ..
同时也支持大量的第三方控件。


 
 

3.安装
 

你可以像安装其它控件一样安装这夽控件,其实就这几步:
  1. 解压缩 Vclskin2.zip 到任意目录
  2. 在 Delphi IDE 环境中选择菜单 "File. Open...", 然后找到连接库vclskindX.dpk, 按着点击Compile按钮。
  3. 在 Environment 添加VCLSkin控件所在的路径。
DX - Delphi X, X - version CBX - CBuilder X, X - version



1. TSkinData
 
TSkinData 主要用于美化你的程序, 只要把TSkinData控件放下去,它就能自动美化所有窗体。
属性
Active: 使用或取消对程序的美化。
DisableTag: 取消对某个特定的组件的美化; 把组件的Tag属性设为99就行了。
(control.tag mod 100=disabletag)
SkinControls:指定哪类组件能被美化.
SkinFile: skin(皮肤)文件的包含路径的文件名,在运行时加载。
SkinStore: 在设计模式时储备的skin文件.
SkinFormType:能使用多种美化方式.
方法
LoadFromStream(Stream: TStream);
LoadFromFile(value:string);
LoadFromCollection(astore:TSkinStore;aindex:integer);
在运行时装载skin文件.
UpdateSkinControl(fParent:Tform);
UpdateMenu(fParent:Tform);
在运行时组件创建时进行美化。
事件
OnFormSkin(Sender:TObject;aName:string;Var DoSkin:boolean);
OnFormSkin 事件的发生先于美化窗体, 如果 Doskin 为 true, Vclskin 就会美化这个窗体, 如果为false,Vclskin 就会跳过这个窗体. aName 是窗体的类名.
OnSkinChangned(Sender:TObject);
OnSkinChanged 发生在skin文件改变之后。
 
 
2. TSkinStore
 
TSkinStore 能让你在设计模式时储存多个skin文件。
TSkinData 能在运行时从 TSkinStore 装载skin文件:
TSkinData.LoadFromCollection(astore:TSkinStore;aindex:integer),
 
 
3. 怎么美化程序界面
 
你可以在几分钟内构建一个漂亮的程序.
1 把 TSkindata 控件放在主窗体上。
2设置Skindata.skinstore属性 , 把skin文件储存在你的程序中。
3 设置Skindata.active = true
4 编译运行你的程序。
 
 
4.  VCLSkin   FAQ
 
 
 
1 如果我的工程中有14个窗体,用不用每个窗体都放一个skin控件?
不用,你只需要放置一个Tskindata在你的主窗体,Vclskin就能自动美化每个窗体。
2 怎样美化一个内嵌的窗体 ?
Vclskin 不能自动美化内嵌窗体,你要手动控制它。压缩包中有一个"NestedForm"的例子,讲的是在运行状态美化内嵌窗体、框架的。
3 怎样美化动态控件 ?
你需要手动控制它。代码如下:
control:=Tmycontrol.create(form1);
skindata1.UpdateSkincontrol(form1); // add this line to skin dynamic control.
4 怎样美化依靠窗体 ?
Vclskin 支持停靠窗体. 例程代码如下:
procedureTDockableForm.FormShow(Sender: TObject);
begin

if MainForm.skindata1.active then MainForm.skindata1.skinform(handle);

end;
5 怎么美化动态的右键菜单 ?
例程代码如下:
popup:=Tpopupmenu.create(form1);
..... add menuite
skindata1.UpdateMenu(form1); //add this line
popup.popup(x,y);
6 怎样美化动态窗体 ?
Vclskin 可以美化动态窗体 , 但不能自动美化内嵌窗体.点击这儿查看如何美化内嵌窗体.
7 找不到文件 'c:\program files\borland\delphi7\SM\winskindata.pas'
Delphi7 试用版Delphi7正式版的Dcu文件格式是不一样的。
如果你使用的是正式版,你可以安装一个演示包。vclskin2.zip.
如果你使用的是试用版,你可以安装一个演示包。D7trial.zip.
8 使用 FastReport 时,出现了“无效操作,控件没有父窗体的的错误提示 ?
设置TSkindata.skincontrols.xcFastReport = true就可以解决这个问题。
9 使用 ReportBuilder 出现了“无效操作,控件没有父窗体的错误提示?
你可以在TSkindata.OnformSkin事件中取消美化这个控件。 代码如下 :
procedureTform1.SkinData1FormSkin(Sender: TObject;
aName: String; var DoSkin: Boolean);
begin

//'TppPrintPreview' 就是要取消美化的窗体名称。
if aName='TppPrintPreview' then doskin:=false;

end;
10 如何存取skin文件的颜色?
你可以借助Tskindata.colors[]属性来存取颜色。
比如说 , 窗体的背景色是 :skindata.Colors[csButtonFace].
TShemeColor=(csText,csTitleTextActive,csTitleTextNoActive,
csButtonFace,csButtonText,
csButtonHilight,csButtonlight,csButtonShadow,csButtonDkshadow,
csSelectText,csSelectBg,csHilightText,csHilight,
csMenuBar,csMenuBarText,csMenuText,csMenubg,
csScrollbar,csTextDisable);
TShemeColors=array[csText..csTextDisable] of Tcolor;
Skindata.Colors: TShemeColors;
11 用户能自定义那些可视化控件的外观吗?
你可以使用skin builder自定义细节.
12 怎样取消美化某个窗体或控件?
设置form.tag=99 取消美化这个窗体。
13 如何在美化一个工程的窗体标题栏和菜单的风格?
设置TSkindata.skincontrols.xcMainmenu = false.

 

//==========

通用控件安装方法:
----------
基本安装
1、对于单个控件,Componet-->install component..-->PAS或DCU文件-->install;
2、对于带*.dpk文件的控件包,File-->Open(下拉列表框中选*.dpk)-->install即可;
3、对于带*.bpl文件的控件包,Install Packages-->Add-->bpl文件名即可;
4、如果以上Install按钮为失效的话,试试Compile按钮;
5、是run time lib则在option下的packages下的runtimepackes加之。
    如果编译时提示文件找不到的话,一般是控件的安装目录不在Delphi的Lib目录中,有两种方法可以解决:
1、反安装的源文件拷入到Delphi的Lib目录下;
2、或者Tools-->Environment Options中把控件源代码路径加入到Delphi的Lib目录中即可。
注意:所安装的控件是否与你所用的Delphi版本相适应。
----------
控件删除
在Component/Install Packages中删除。
选Component/configure Palette…
有pages和components两个区域
双击components区域,选中要删除得控件,下面有得Delete按钮
但系统提供的控件只能Hide,不能delete。
打开控件所在的包文件(*.dpk),从中删除控件那个文件,再重新编译该包即可。

如果是整个控件包都要删除的话,project->Option->Packages,删掉那个packages,收工。

VCLSkin5.60:点击下载

VCLSkin皮肤(233种):点击下载

VCLSkin皮肤制作工具:我的网盘

VCLSkin皮肤制作方法



1.Convert Msstyle file1.Convert Msstyle文件

1. 1。Click "Import" button in toolbar.点击“导入”工具栏按钮。
2. 2。Select color theme in list.选择列表中的颜色主题。

2.2。 Skin Fundamentals皮肤基础

The first step in learning skin is to understand how it works.在学习皮肤的第一步是要了解它是如何工作。Unlike some apps where you create a mostly static skin, Vclskin must work with the dynamic environment of Windows.不像有些应用程序在创建一个大多是静态的皮肤,Vclskin必须与Windows的动态环境。The various windows and buttons change shape and size with each program, so Skin must adapt your graphics to each item.各种Windows和按钮改变形状和大小各方案,使皮肤必须适应你的图形的每个项目。It is important to keep this in mind when creating your design.重要的是要记住这一点在创建你的设计。With the code, you are able to set how many pixels of the image around the border, are to be left alone.使用代码,您可以设置如何周围的边界图像的像素,是被单独留在家中。The rest of the image is then stretched or tiled (as you specify) in order to enlarge or compact the image as needed.图像的其余部分,然后拉伸或平铺(如你指定),以图像放大或压缩需要。

3.3。 Image图片

  • Image margins : margin of image that should not be stretched/tiled.图像边距 :图像边缘不应被拉伸/平铺。
  • Stretch and Tile : image is tiled or stretched.拉伸和平铺 :形象是平铺或拉伸。
  • Transparency : draw the image transparently, Transparent Color is clFuchsia,RGB: 255,000,255, $00FF00FF.透明度 :绘制图像透明的,透明颜色是clFuchsia,的RGB:255000255,$ 00FF00FF。
  • Frame : Image state number.框架 :图像的状态数。

4.4。 Windows Border and MainMenu窗口边框和主菜单

There are also two other possible image states: inactive and active window.还有其他两个可能的图像状态:不积极,活跃的窗口。The active window is the window that is currently being used, while the inactive window is any window(s) that is in the background.活动窗口是当前正在使用的窗口,而任何非活动窗口的窗口(县),在背景中。

5.5。 Title buttons标题按钮

6.Button6.Button

There are five different states for the buttons image, each displayed at a different time.有五种不同的国家的按钮图像,在不同的时间显示的每个。

  • Normal: The normal state is what you see when the button is just there, undisturbed.正常:正常状态是什么,你看时,按钮就在那里,不受干扰。
  • Pressed: The pressed state is what you see when the button has been clicked and/or the mouse button is being held down with the cursor over the button.按:按下状态时看到的就是你的按钮被点击和/或鼠标按钮被关押按钮与光标了。
  • Disabled: This state is visible when the function of the button is not available.禁用:这种状态是可见的按钮时,该功能不可用。 For example, when you open a new Internet Explorer window, the back button is not available because you have no webpage to go back to at that time.例如,当你打开一个新的Internet Explorer窗口,后面的按钮是不可用,因为你没有网页,回到那个时候。Therefore, the back button will be displayed with the disabled state.因此,背部按钮将显示为禁用状态。
  • Focus: The focus state is displayed when the mouse cursor passes over the button.焦点:焦点状态时显示鼠标光标按钮越过了。
  • Default: The default state is displayed.默认:默认状态显示。

7.Menuitem7.Menuitem

8.Color8.Color

Pick color and capture color挑选颜色和捕捉色彩

原创粉丝点击