Hi,
I'm filling some cells of a table with text and other cells with TEdits.
I just want to avoid that the user sets the focus on the text cells.
Search on RVItem unit I found this:
TRVItemBoolPropertyEx = (rvbpPrintToBMP, rvbpJump,
rvbpAllowsFocus,rvbpHotColdJump,
rvbpXORFocus, rvbpHotCold, rvbpActualPrintSize)
But I could not know if I can use this with table cells.
How to prevent a table cell to get focus?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This property has different meaning (this "focus" is a dotted rectangle that TRichView (not TRichViewEdit) can draw around some items, such as hyperlinks).
You can use table.OnCellEditing event to move caret to another cell.
For example, this code does not allow to put caret in cells of the first column:
Table events are not saved in RVF files (and are lost on copy-pasting). To prevent this problem, this event should be assigned in OnItemAction event:
You can use table.OnCellEditing event to move caret to another cell.
For example, this code does not allow to put caret in cells of the first column:
Code: Select all
procedure TForm3.CellEditing(Sender: TRVTableItemInfo; Row, Col: Integer;
Automatic: Boolean; var AllowEdit: Boolean);
begin
AllowEdit := Col>0;
end;
Code: Select all
procedure TForm3.RichViewEdit1ItemAction(Sender: TCustomRichView;
ItemAction: TRVItemAction; Item: TCustomRVItemInfo; var Text: String;
RVData: TCustomRVData);
begin
if (ItemAction=rviaInserting) and (Item.StyleNo=rvsTable) then
TRVTableItemInfo(Item).OnCellEditing := CellEditing;
end;