有没有一种简单的方法可以在 Delphi 窗体上的非 VCL 和 VCL 控件之间进行制表符切换?

发布于 2024-08-16 03:46:06 字数 394 浏览 6 评论 0原文

我有一个 Delphi 窗体,其中包含一堆 VCL 控件,例如 TButton 和 TCheckBox,以及 Scintilla 的实例文本编辑器。我希望能够使用 Tab 键进入和退出文本编辑器,但看起来选项卡是由 VCL 库而不是 Windows 处理的。

我单步查看了代码,看起来选项卡是由 TWinControl 类的 SelectNext 和 FindNextControl 方法处理的。这些方法适用于 TWinControl 对象,但文本编辑器不像 TButton 和 TCheckbox 那样源自 TWinControl。

有没有一种简单的方法可以在非 VCL 和 VCL 控件之间进行制表符切换?

I have a Delphi form with a bunch of VCL controls, like TButton and TCheckBox, and an instance of the Scintilla text editor. I want to be able to tab into and out of the text editor but it looks like tabs are handled by the VCL library not Windows.

I stepped though the code and it looks like tabs are handled by the SelectNext and FindNextControl methods of the TWinControl class. These methods work on TWinControl objects but the text editor does not descend from TWinControl like TButton and TCheckbox.

Is there a simple way to allow tabbing between non-VCL and VCL controls?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦幻之岛 2024-08-23 03:46:06

(将此作为 wiki 答案,因为 Rob 在上面的评论中非常正确,这只是反刍它)

特殊字符/键的键盘处理由 VCL 以相当特殊的方式处理,并通过 Win API 直接绕过/扩展它当然是可行的,但并不简单。

从长远来看,如果您围绕控件创建一个自定义 VCL 组件包装器(使用 VCL 源代码作为指导),那么从长远来看,这将同样简单且坦率地更加灵活,它实际上并不那么困难(可能有点乏味),但付费- off 在可维护性和重用性方面将是巨大的。

编辑:

当然,您可以简单地使用这个 免费的 Delphi Wrapper 作为 Scintilla 编辑器。

(made this a wiki answer, because Rob is quite correct in his comments above, this just regurgitates it)

Keyboard handling for special characters / keys is handled in a fairly special way by the VCL, and bypassing / extending this directly via the Win API is certainly do-able but non-trivial.

It would be just as easy and frankly more flexible in the long run if you create a Custom VCL component wrapper around the controls (use the VCL source as a guide) it's really not all that hard (maybe a little tedious) but the pay-off will be tremendous in terms of maintainability and re-use.

Edit:

And of course you could simply use this free Delphi Wrapper for the Scintilla editor.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文