views:

85

answers:

1

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?

A: 

(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.

Tim Jarvis