Page 1 of 1

TAB to the next editable cell

Posted: Tue May 23, 2006 11:05 am
by ove@wis.no
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

Posted: Tue May 23, 2006 12:06 pm
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\

Posted: Tue May 23, 2006 1:49 pm
by ove@wis.no
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

Posted: Wed May 24, 2006 10:41 am
by ove@wis.no
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

Posted: Fri May 26, 2006 11:32 am
by ove@wis.no
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