Jump to content


Photo

Popup menu question


  • Please log in to reply
1 reply to this topic

#1 array81

array81

    Senior Member

  • Members
  • PipPip
  • 290 posts
  • Gender:Male

Posted 21 April 2014 - 04:28 PM

I need show a popup menu only if the user use right click on a row. I don't want see the popup menu if the user click on other points (header, footer, black grid, ...).
Can I limit the popup usage?

I need it because with popup menu the user can edit or delete the seleced row.

Thanks

#2 nosx

nosx
  • Members
  • 11 posts

Posted 18 August 2014 - 06:34 AM

Just posting this for others so they may benefit from it as well.

procedure TMainForm.NextGrid1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Var
P : TPoint;
begin
P := NextGrid1.GetCellAtPos(Point(X,Y));
If (Button = mbRight) and (P.Y <> -1) Then
begin
Popup1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
end;





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users