为Delphi应用程序设置帮助 [英] Setting up help for a Delphi app

查看:165
本文介绍了为Delphi应用程序设置帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置帮助的最佳方式是什么(具体来说, HTML帮助)的Delphi应用程序?我可以看到几个选项,所有这些都有缺点。具体来说:

What's the best way to set up help (specifically HTML Help) for a Delphi application? I can see several options, all of which has disadvantages. Specifically:


  1. 我可以在适当的情况下在表单设计器中设置HelpContext,但是我不得不跟踪数字而不是符号常量。

  2. 我可以用编程方式设置HelpContext。然后我可以使用符号常量,但是我会有更多的代码跟上,我不能轻易地查看文本DFM,看看哪些表单仍然需要帮助。

  3. 我可以设置HelpKeyword,但由于它执行关键字查找(如Application.HelpKeyword)而不是主题跳转(如Application.HelpJump),我必须确保我的每个帮助页面都有一个唯一的,不变的顶部级关键词这似乎是额外的工作。 (还有一些HelpKeyword相关的VCL错误,如这个。)

  4. 我可以设置HelpKeyword,设置一个Application.OnHelp处理程序来将HelpKeyword请求转换为HelpJump请求,以便我可以通过主题ID而不是关键字查找来分配帮助,并添加诸如我自己的帮助查看器(基于 HelpScribble的代码),它修复了VCL错误,并让HelpJump使用anchor。在这一点上,我觉得我正在反对VCL,而不是使用它。

  1. I could set HelpContext in the forms designer wherever appropriate, but then I'm stuck having to track numbers instead of symbolic constants.
  2. I could set HelpContext programmatically. Then I can use symbolic constants, but I'd have more code to keep up with, and I couldn't easily check the text DFMs to see which forms still need help.
  3. I could set HelpKeyword, but since that does a keyword lookup (like Application.HelpKeyword) rather than a topic jump (like Application.HelpJump), I'd have to make sure that each of my help pages has a unique, non-changing, top-level keyword; this seems like extra work. (And there are HelpKeyword-related VCL bugs like this and this.)
  4. I could set HelpKeyword, set an Application.OnHelp handler to convert HelpKeyword requests to HelpJump requests so that I can assign help by topic ID instead of keyword lookup, and add code such as my own help viewer (based on HelpScribble's code) that fixes the VCL bugs and lets HelpJump work with anchors. By this point, though, I feel like I'm working against the VCL rather than with it.

你选择你的应用程序?

推荐答案

我创建了帮助文件,获取帮助主题ID,然后围绕表单,并将他们的HelpContext值设置为他们。由于所需的维护水平非常低 - 除非发生重大事件,否则表单不太可能改变帮助文件上下文 - 这很好。

I create the help file, which gets the help topic ID, and then go around the forms and set their HelpContext values to them. Since the level of maintenance needed is very low - the form is unlikely to change help file context unless something major happens - this works just fine.

这篇关于为Delphi应用程序设置帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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