I have a read-only table that is loaded with information contained elsewhere. I would like to be able to double click on CERTAIN cells and have a dialog pop up that offers to change the information in that cell.
In order for this to work, I need to obtain the cell location of the double click - I can work out the rest of the details. I cannot see how to obtain the click location in a table that does not have rvtoEditing enabled.
Thanks,
Dick
Operate On Table NOT In rvtoEditing
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
procedure TForm1.RichViewEdit1RVMouseDown(Sender: TCustomRichView;
Button: TMouseButton; Shift: TShiftState; ItemNo, X, Y: Integer);
var LItemNo, LOffs, r, c: Integer;
LRVData: TCustomRVFormattedData;
pt: TPoint;
Table: TRVTableItemInfo;
begin
if (Button<>mbLeft) or not (ssDouble in Shift) then
exit;
pt := Sender.ClientToDocument(Point(X, Y));
if not Sender.GetItemAt(pt.X, pt.Y, LRVData, LItemNo, LOffs, False) then
exit;
LRVData := TCustomRVFormattedData(LRVData.GetSourceRVData);
if not (LRVData is TRVTableCellData) then
exit;
Table := TRVTableCellData(LRVData).GetTable;
Table.GetCellPosition(TRVTableCellData(LRVData), r, c);
Application.MessageBox(PChar(Format('Cell %d %d', [r,c])), 'Editing', 0);
end;
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact: