TCustomRichView.OnRVMouseUp

<< Click to display table of contents >>

TCustomRichView.OnRVMouseUp

Occurs when the user releases a mouse button that was pressed with the mouse pointer over the component.

type

  TRVMouseEvent = Procedure(Sender: TCustomRichView;

    Button: TMouseButton; Shift: TShiftState;

    ItemNo, X, Y: TRVCoordof object;

 

property OnRVMouseUp: TRVMouseEvent;

Similar to OnMouseUp, but you also have information about index of item under the mouse pointer.

ItemNo is an index of this item, or -1 if there is no item at the position of the mouse pointer.

The OnRVMouseUp event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the  Shift ,  Ctrl , and  Alt  keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.

 

When clicking on table, this event returns ItemNo of this table in the root document, even if user clicked on item inside this table.

Use the following procedure if you want to know the exact clicked item:

procedure TForm1.MyRichViewMouseUp(Sender: TCustomRichView;

  Button: TMouseButton; Shift: TShiftState;

  ItemNo, X, Y: TRVCoord);

var LRVData: TCustomRVFormattedData;

    LItemNo, LOffs: Integer;

    pt: TRVCoordPoint;

begin

  pt := MyRichView.ClientToDocument(Point(X,Y));

  if not MyRichView.GetItemAt(pt.X, pt.Y, LRVData, LItemNo, LOffs,

    True) then

    exit;

  // item is the LItemNo-th item in LRVData

  // example of using: LRVData.GetItemStyle (LItemNo)

  ..

end;

 

See also events:

OnRVMouseDown;

OnRVRightClick.