VCL样式来自哪里? [英] Where do VCL styles come from?

查看:156
本文介绍了VCL样式来自哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的编程团队中,我们所有人都使用Delphi XE2 Professional.我们只是发现在不同的计算机上可以使用不同数量的VCL样式.

In my programming team we all use Delphi XE2 Professional. We just figured out that on different computers different numbers of VCL styles are available.

VCL样式来自哪里?我需要注意将样式从一个Delphi安装转移到另一个吗?

Where do VCL styles come from? Do I have to take care to move styles from one Delphi installation to another?

推荐答案

问:VCL样式来自哪里?

A: Vcl样式文件是Delphi XE2和XE3版本的一部分,并安装在两个位置C:\Users\Public\Public Documents\RAD Studio\<n.n>\StylesC:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\Redist\styles\vcl文件夹中.

A : The Vcl Styles files are part of the Delphi XE2 and XE3 versions, and are installed in two locations C:\Users\Public\Public Documents\RAD Studio\<n.n>\Styles and C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\Redist\styles\vcl folders.

您还可以从头开始创建Vcl样式或对其进行自定义,因此某些机器可能包含自定义Vcl样式,并解释了不同数量的vsf文件.

Also you the Vcl Styles files can be created from the scratch or customized, so maybe some of the machines contains custom Vcl Styles and that explain the different numbers of vsf files.

问:我需要注意将样式从一种Delphi安装转移到另一种安装吗?

这取决于如何将Vcl样式添加到Delphi项目中.基本上,存在将Vcl样式添加到项目中的3种方法.

That's depends of how the Vcl Styles are added to the Delphi project. Basically exist 3 ways of add the Vcl styles to your project.

  1. 使用Projects->Options->Application->Appearance菜单选项.在这种情况下,每种样式的新条目都会随样式的路径添加到.dproj(Delphi项目文件)中.编译后,将.dproj文件引用的样式作为资源嵌入.

  1. Using the Projects->Options->Application->Appearance Menu option. In this case a new entry by each style is added to the .dproj (Delphi project file) with the path to the style. After when you compile you project the styles referenced by the .dproj file are embedded as a resource.

使用 TStyleManager 类.

直接编辑.dproj文件,并在<PropertyGroup Condition="'$(Base)'!=''">键中添加一个名为VCL_Custom_Styles的新条目.

Editing directly the .dproj file and adding a new entry called VCL_Custom_Styles in the <PropertyGroup Condition="'$(Base)'!=''"> Key.

因此,如果您的Delphi项目使用方法1或3引用了Vcl样式,则需要在计算机之间复制Vcl样式,以避免在缺少Vcl样式时出现编译问题.

So if you Delphi project is referencing the Vcl styles using the method 1 or 3, you will need copy the Vcl Styles between machines to avoid compilations problems if a Vcl style is missing.

注意:作为建议,您可以在Delphi项目位置创建一个 style 文件夹(并将该文件夹添加为源代码管理方案的一部分),然后在此处复制您的应用程序使用的vcl样式,并然后修改您的代码以使用方法2加载样式.

Note : As recommendation you can create a style folder (and add that folder as part of you source control scheme) in your Delphi project location and here copy the vcl styles used by you Application, and then modify your code to load the styles using the method 2.

这篇关于VCL样式来自哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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