TAB to the next editable cell

General TRichView support forum. Please post your questions here
Post Reply
[email protected]
Posts: 9
Joined: Wed Sep 21, 2005 12:17 pm

TAB to the next editable cell

Post by [email protected] »

Hi,

I have a rve with a document where most of it is readonly. I have some fields wich is editable, how do I tab between the editable fields.
They all have the same style.
One problem is that the caret can be between two editable fields.

Best regards
Ove Halseth
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use OnKeyPress event.
There is a limitation, if the key is pressed when the caret is inside the table cell - you cannot move the caret out of this cell in this event (this will destroy the cell inplace editor, but it's not allowed in this event).
Use PostMessage to avoid this problem.
(examples of using PostMessage:
http://www.trichview.com/support/trichv ... tion_4.htm
http://www.trichview.com/support/trichv ... ream_4.htm
http://www.trichview.com/support/trichv ... brve_6.htm
Demos\Delphi\Assorted\Graphics\DragImg\
[email protected]
Posts: 9
Joined: Wed Sep 21, 2005 12:17 pm

Post by [email protected] »

Tanks a lot for your answers.

I found the OnKeyPress working(thought that KeyPress was for characters only and that it would not trigger on tab, enter ...)

But my problem is that the editfields is a cell, and to make it a bit more complicated it is often a table consisting of a single cell within another table. (Have posted an exaple rve doc to your mail-adr.)

Apart from using PostMessage, how do we locate the cell wich has focus?

Best regards
Ove Halseth
[email protected]
Posts: 9
Joined: Wed Sep 21, 2005 12:17 pm

Post by [email protected] »

One more question, when caret is inside a table cell the OnKeyPress event for the rve will not trigger on any character, so on what event do I put the PostMessage call?

Best regards
Ove Halseth
[email protected]
Posts: 9
Joined: Wed Sep 21, 2005 12:17 pm

Post by [email protected] »

Hi

I'm stuck here:-(

I can't find where to put the PostMessage.
- In rve's OnKeyPress=> It's not triggered when focus is inside a table
- I found this: http://www.trichview.com/support/files/ ... ncells.zip
but with OnCellEditing you can't tell if user used tab to move around or used mouse.

So now I'm looking for a way to set the inplace editor OnKeyPress event.

Do you have any examples/hints?

Best regards
Ove Halseth
Post Reply