[Gambas-user] GridView Cell Height with WordWrap

Bruce Steers bsteers4 at gmail.com
Thu Feb 25 16:04:49 CET 2021


gb-qt4-ext has
Dial
LCDNumber
TextEdit

end of list..
if you do not need any of them then you do not need qt4-ext

As for misisng wrap ,
only the gridview.cell has wrap
Ie.
GridView1[0,0].Wrap = True

cannot be use on GridView.Rows or .Columns just the single cells.

That should help.
BruceS

On Thu, 25 Feb 2021 at 07:43, Rolf-Werner Eilert <rwe-sse at osnanet.de> wrote:

> Am 24.02.21 um 15:09 schrieb Benoît Minisini:
> > Le 24/02/2021 à 13:53, Rolf-Werner Eilert a écrit :
> >> When I want to have the individual rows adapt to the correct height to
> >> show every line of word-wrapped text, how can I achieve that?
> >>
> >> This is what I tried. "lsMeine" is the GridView:
> >>
> >> Public Sub lsMeine_Data(Row As Integer, Column As Integer)
> >>
> >>    If Row Mod 2 = 0 Then
> >>      lsMeine.Data.Background = Color.Lighter(Color.LightGray)
> >>      lsMeine.Data.Text = nzEigene[Row]
> >>    Else
> >>      lsMeine.Data.WordWrap = True
> >>      lsMeine.Data.Text = nzEigene[Row]
> >>      lsMeine.Rows[Row].Height = lsMeine.Font.TextHeight(nzEigene[Row])
> >>    Endif
> >>
> >> I try to attach a screenshot.
> >>
> >> In line [1] of the list it doesn't work (because the text doesn't have
> >> a line break (LF) in it?). In line [3] it runs well, there are several
> >> line breaks.
> >>
> >> So, I have to find out the necessary height of the cell even when text
> >> has been word-wrapped only.
> >>
> >> Regards
> >> Rolf
> >>
> >
> > If you set the row height to -1, it should do the stuff for you.
> >
> > Regards,
> >
>
> You are right, guys, I tried just that. The reason for which it fails
> is, there is no WordWrap in the version I use. I saw this only now.
>
> This is Gambas 3.15.2 (isn't that the latest version?) running under
> Ubuntu Mate 18, and the project uses gb.qt4 + gb.qt4.ext. The reason
> might be that in the past I needed one or two of the special things that
> come with qt4.ext.
>
> So I wonder if I can easily switch to another component without loosing
> some feature somewhere else I do not remember. The project is rather old
> and rather big.
>
> Anyone with an idea?
>
> Regards
> Rolf
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210225/8d7b4448/attachment-0001.htm>


More information about the User mailing list