trichview.com

trichview.support




GetItemAtEx


Return to index


Author

Message

Christian Kirchhoff

Posted: 09/27/2002 16:57:55


Hello,


some days ago I found some code that allows to move the caret pos while an

object ios dragged onto a TRichViewEdit component. Basically in the

OnDragOver event handler a WM_SETCARETPOS is triggered which eventually

calls a procedure similar to this:


procedure MoveCaretTo(X, Y: Integer);

var

  RVData: TCustomRVFormattedData;

  ItemNo, Offs: Integer;

begin

  inc(X, MyRichViewEdit.HScrollPos);

  inc(Y, MyRichViewEdit.VScrollPos*MyRichViewEdit.VSmallStep);

  MyRichViewEdit.RVData.GetItemAtEx(X,Y,RVData,ItemNo,Offs);

  if ItemNo<0 then

    exit;

  if RVData is TRVTableCellData then begin

    TRVTableCellData(RVData).Edit;

    RVData := TCustomRVFormattedData(RVData.GetRVData);

  end;

  RVData.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs);

  RVData.Invalidate;

end;


When I was testing this, I used an unregistered version of TRichView. After

installing the registered version (1.5.4), the procedure "GetItemAtEx"

cannot be found any more. Is there a workaround?


Regards,


Christian Kirchhoff





Powered by ABC Amber Outlook Express Converter