[Lazarus] Popup menu on a TStringGrid row

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Jun 8 16:19:12 CEST 2010


On 08/06/2010, Juha Manninen wrote:
> The problem is that mouse right-click didn't select the row (or cell
> actually)
> under the mouse pointer. The selected row can be somewhere far from the
> mouse pointer and thus deleting it is not what user expects.

I vaguely remember seeing some "follow focus" option in the stringgrid
which I think solves this problem.

Alternatively, in the OnClick or OnShowMenu (if there is such an
event) you should be able to query the row under the mouse cursor
position. Then set the focus row to that row, then wait to see what
the user selects in the popup menu.


> I remember I had to do something complicated with VirtualTreeView on Delphi

VirtualTree is over-engineering at its best! I don't like that component at all.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/




More information about the Lazarus mailing list