[Gambas-user] GridView_Column.Expand = True also needs AutoResize = True to work; expected behavior?
T Lee Davidson
t.lee.davidson at gmail.com
Mon Feb 4 21:31:11 CET 2019
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. And, then, I could not find where the AutoResize and Expand properties were actually used. I apologize for being so
ignorant.
Yes, it's clear now. Thanks.
___
Lee
More information about the User
mailing list