grid cell multiline

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
danca
Posts: 13
Joined: Wed Mar 16, 2016 7:09 pm

grid cell multiline

Post 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?
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: grid cell multiline

Post 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?
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
mol
Posts: 3722
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: grid cell multiline

Post by mol »

If you don't need to display huge tables, you can use my solution: viewtopic.php?f=5&t=4834&start=21
danca
Posts: 13
Joined: Wed Mar 16, 2016 7:09 pm

Re: grid cell multiline

Post 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
User avatar
mol
Posts: 3722
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: grid cell multiline

Post 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
Post Reply