Page 1 of 1

grid cell multiline

Posted: Tue Jul 24, 2018 11:54 pm
by danca
Hi all, I am going crazy trying to have multiline cells in a grid. Or multiline listbox. Or whatever. I need to display a list of items, and they can be long sentences. Grid and listbox truncate the sentence and I am not able to get the horizontal scrollbar (not ideal but better than nothing). A tooltip showing the entire sentence would be also a possible workaround but I am not able to get it working. Any idea?

Re: grid cell multiline

Posted: Wed Jul 25, 2018 1:11 am
by andyglezl
Porqué no posteas el prg con el que estas probando para
estar todos en sintonía de lo que quieres ?
----------------------------------------------------------------------
Why do not you post the prg with the one you're testing for?
be all in tune with what you want?

Re: grid cell multiline

Posted: Wed Jul 25, 2018 5:54 am
by mol
If you don't need to display huge tables, you can use my solution: viewtopic.php?f=5&t=4834&start=21

Re: grid cell multiline

Posted: Wed Jul 25, 2018 9:11 am
by danca
Thank you mol, I ended up using LABEL controls, then found your minigrid example (that is by the way nice and much more complete than my "quick and dirty" solution). I saw that LABEL controls are used in your solution too. :)
My simple code: (aDescr is an array with elements like:{"blah","blah, blah, blah..."})
...
define window PickWin...
...
local posv:=0,j
FOR J:=1 TO LEN(aDescr)
ebn="edboxa"+padl(j,2,"0")
DEFINE LABEL &EBN
WIDTH 300
HEIGHT 100
VALUE aDescr[j,1]
ROW posv
COL 0
MULTILINE .T.
ONCLICK {||EdWin.fEdit.value:=this.Value,PickWin.release}
END LABEL
ebn="edboxb"+padl(j,2,"0")
DEFINE LABEL &EBN
WIDTH 400
HEIGHT 100
VALUE aDescr[j,2]
ROW posv
COL 301
MULTILINE .T.
ONCLICK {||EdWin.fEdit.value:=this.Value,PickWin.release}
END LABEL
posv+=101
next j

when I click on the label, the caption text fills another control (fEdit, in window EdWin)
Now I have 2 problems left:
1) the window does not scroll upon the mouse wheel rotation (must use ONSCROLLUP/DOWN?)
2) I would add small tiny borders to LABELs but don't know how.

Dan

Re: grid cell multiline

Posted: Wed Jul 25, 2018 2:44 pm
by mol
I'm on vacation now, I have no possibility to help you.
You can attach mouse scroll event to scroll window, but, you have to search the forum how to do it