[Gambas-user] Gambas 3 Grid/Table question

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Nov 16 11:03:53 CET 2010


Am 15.11.2010 08:58, schrieb Rolf-Werner Eilert:
> Am 13.11.2010 02:01, schrieb Benoît Minisini:
>>> Sorry, I was kinda tired this morning :-)
>>>
>>> There is a linewrap in the Gridview even with Gambas 2, but it is a
>>> default (at least I have not yet found a way to deactivate it) and it
>>> does not by itself adjust the line height appropriately.
>>>
>>> So the question would have to be: Is there a more specific way to define
>>> this in Gambas 3? For instance:
>>>
>>> Tableview1.Columns[3].WordWrap = TRUE
>>> Tableview1.Columns[3].Width = 125
>>> Tableview1.AdjustRowHeight = TRUE
>>>
>>> would activate wordwrap for column 3, define a width of 125 px for this
>>> column and start automatic row height adjusting for the whole table...
>>> Maybe this would make sense for single rows? Then
>>>
>>> Tableview1.Rows[2].AdjustRowHeight = TRUE
>>>
>>> would be good, but I can't imagine a case where this might be good.
>>>
>>> Regards
>>>
>>> Rolf
>>>
>>
>> In Gambas 3, WordWrap is a property attached to the cell. And to adjust the
>> width of a row or a column, you must set its height (or width) to "-1". But,
>> if I remember well, it is not implemented in gb.gtk yet.
>>
>> Maybe a WordWrap property at the column level may be useful then?
>>
>
> Definitely yes! I think, this is where it makes most sense. But it is
> not very useful without RowHeight adjusting automatically, too. If you
> cannot add something like an AdjustRowHeight property, there should at
> least be an event and a property that can be read telling me how many
> lines the fullest cell has on this line (to enable me to adjust the
> RowHeight by my own code).
>
> What I meant above was, I don't know if an AdjustRowHeight property
> makes sense on Row level.
>
> Regards
>
> Rolf
>

Let me add couple of things that came to my head... :-)

If we try to pimp the GridView, we should have in mind that there are 
different ways of showing a cell or column in a grid. All of them are 
good for certain situations.

You can just make the column wider and wider, but this is not very 
professional. Yet there might be situations for which this is ok.

The standard way is to cut the rest if it doesn't fit, usually shown by 
"..." at the end (or a fade-out, I saw this somewhere, looks nice!) You 
will then want some way to feed the ToolTip for the mouse showing the 
complete contents when the user hovers over the cell.

Then you can make a word wrap, either the way it is now or with an 
automatic adaptation of the row height. The latter looks more 
professional, but it might be confusing in some cases, so better it can 
be switched on or off.

The real problem arises when it comes to TabelView, i. e. when you want 
to edit the cell. Would you implement a multi-line edit? What if the row 
height hasn't been adapted? Lots of questions...

Anyway, it should be avoided to produce an "eggs laying wool-milk sow" 
as we put it in German ;-) or a feature dinosaur with so many properties 
and events that nobody knows how to control it (as it is in vb.net - and 
with literally no documentation worth mentioning).

Regards

Rolf




More information about the User mailing list