[Gambas-user] GridView_Column.Expand = True also needs AutoResize = True to work; expected behavior?

Benoît Minisini g4mba5 at gmail.com
Mon Feb 4 21:34:00 CET 2019


Le 04/02/2019 à 21:31, T Lee Davidson a écrit :
> On 2/4/19 2:58 PM, Benoît Minisini wrote:
>> Why don't you read the source code? It's the 
>> _GridView_Columns._Layout() method.
>>
>> If The AutoResize property is not set, then the Expand has no effect, 
>> as no automatic resize occurs. Only explicit resize.
>>
>> If AutoResize is set, then :
>>
>> - If no visible column has the Expand property set, then the last 
>> column is expanded as if it has the Expand property set.
>>
>> - Otherwise, the difference between the visible width and the width of 
>> static columns (with Expand not set) is shared between the expanded columns. 
>>
>>
>> - If a column with Expand set has an explicit width, this explicit 
>> width becomes its minimum width and is taken into account during the 
>> previous share of remaining space.
>>
>> Is the algorithm clear now?
>>
>> -- 
>> Benoît Minisini
> 
> I tried reading the source code, Benoît. I had difficulty even finding 
> the GridView class since it is not in either gb.qt4 or gb.qt5 as one 
> might expect given where the GridView documentation is located on the 
> Wiki. I had to look through 100+ of 234 search results for "gridview" 
> before I found that it was in gb.gui.base in the "comp" directory along 
> with the other "enhanced" components. 

Why didn't you ask "where is the source code of GridView"? I would have 
told you.

-- 
Benoît Minisini


More information about the User mailing list