IDE 生成的虚线的默认长度

Default length of the IDE-generated dash line

在C++ Builder 10.1 Berlin中,我在哪里可以设置默认的宽度 IDE 在添加新的事件处理程序时生成 虚线(请参见下图中突出显示的部分)?

我将默认的右间距从 80 列更改为 100/120 列,如果此行长度与默认情况下一致,那就太好了。

您所指的分隔符不是动态生成的,所以您不能简单地配置它的宽度。它实际上存储在模板文件 ($(BCB)\Bin\bcb.bcf) 中,并按原样复制到代码中。如果模板不存在,默认使用虚线分割线,固定宽度..

因此,您必须编辑该模板文件才能创建您正在寻找的效果。

来自Customizing C++Builder(这是为旧的 IDE 编写的,但它的一些信息仍然适用):

File and Function Divider Line

If you don't like the standard line inserted at the top of each units cpp file or the function divider line that is used when an event handler or other function is added to your code by C++Builder then you can set your own. Using lines that stand out for you and which complement your other code comments can help to partition a unit in your head when browsing code.

Specifying a custom top line or function divider line involves editing the file $(BCB)\Bin\bcb.bcf, where $(BCB) is the folder in which C++Builder is installed. This is a text file in an INI format, so you can use Notepad, WordPad, or any other text editor. There will be no standard text editor associated with the .bcf file so you will need to select one when opening the file with Windows Explorer. Alternatively you can start your text editor and browse to the file.

To specify a custom top line in new unit cpp files add a definition for Divider Line Break within a new section named Code Formatting. To specify a custom function divider line add a definition for Divider Line. Set these definitions to the text to be used in the source code. The text should be formatted as a comment so as not to cause syntax errors in your code. The following example demonstrates these customizations.

[Code Formatting]
Divider Line Break=/* ===================== TOP LINE ===================== */
Divider Line=/* ===================== END FUNCION ===================== */

如果该文件尚不存在,只需创建它即可。如果 C++Builder 安装在 C:\Program FilesC:\Program Files (x86)(默认情况下)下,您将需要 运行 具有管理权限的文本编辑器来保存文件。