Recent

Author Topic: [Solved] StringGrid with popup multi-line editor  (Read 3444 times)

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
[Solved] StringGrid with popup multi-line editor
« on: July 02, 2015, 12:24:55 pm »
Currently I have a standard StringGrid that allows inline editing of cell text. The one column is a "Comments" column, and the grid cell is too small to enter a long comment. So I want the grid to show a [...] button, and when clicked, bring up a dialog containing a Memo, OK and Cancel button. That way they can easily enter larger multi-line comments. On clicking OK, the popup dialog disappears and the grid cell now contains the changed text (it doesn't matter that the text will not fit).

How do I create such a [...] button inside a StringGrid cell? The idea is something like what the Object Inspector does for the Anchor property. See attached screenshot.

The button must not cover the whole grid cell, only the right edge of the sell, just like can be seen in the attached screenshot. Any help would be much appreciated.

« Last Edit: July 02, 2015, 01:27:17 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

wp

  • Hero Member
  • *****
  • Posts: 12799

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: StringGrid with popup multi-line editor
« Reply #2 on: July 02, 2015, 12:45:55 pm »
Also look at
...\lazarus\examples\gridexamples\columeditors\stringgrideditor.lpi

The sixth column in the example has exactly the ellipsis button executing a modal dialog that you are after.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: StringGrid with popup multi-line editor
« Reply #3 on: July 02, 2015, 12:46:54 pm »
Thank you so much for the fast response. I didn't no the terminology used, so kept searching for the wrong things. That wiki pages seems exactly the info I need. :)
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018