Listview weight

Discuss GUI programming with the MUI Royale plugin here
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Listview weight

Post by GMKai »

Hello,

I have a listview with this defintion:

Code: Select all

<listview id="mainmatchforecast" autovisible="true" MultiSelect="None" input="false" frame="ReadList">
							    <column title="Week" weight="100"/>
							    <column title="Home" weight="1200"/>
							    <column title="Away" weight="1200"/>
</listview>
when filled,
it looks like this:
https://www.dropbox.com/s/b7o1i9ttshvzhw6/Grab.png?dl=0

When clicking "Größen zurücksetzen"(reset size) all is fine...how can this be achieved via code?
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Listview weight

Post by airsoftsoftwair »

I'm not sure I understand what you want to do here but to reset a listview column's weight to the default value, you can just set Listviewcolumn.Weight to 100 which is the default:

Code: Select all

mui.Set("col1", "weight", 100)
mui.Set("col2", "weight", 100)
mui.Set("col3", "weight", 100)
But you need to give your columns ids first:

Code: Select all

...
    <column id="col1" title="Week" weight="100"/>
    <column id="col2" title="Home" weight="1200"/>
    <column id="col3" title="Away" weight="1200"/>
...
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Re: Listview weight

Post by GMKai »

Problem is,
the contents of the columns Home/Away is much broader than shown in screenshot.
When resizing the listview via menu, all is fine.
How can I force a redraw/resize after the listview got filled?
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Listview weight

Post by airsoftsoftwair »

Problem is, the contents of the columns Home/Away is much broader than shown in screenshot.
Well, but that is what you're requesting when setting weight for "Home" and "Away" to 1200. This means that "Home" and "Away" should be TWELVE TIMES as wide as "Week" which only has a weight of 100. Is that really what you want?
How can I force a redraw/resize after the listview got filled?
That's normally not necessary because MUI will automatically adapt the column width to be large enough to show the longest text entry.
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Re: Listview weight

Post by GMKai »

airsoftsoftwair wrote:
That's normally not necessary because MUI will automatically adapt the column width to be large enough to show the longest text entry.
Here the automagic mechanism is off, I have to resize manually to make the text fully visible.
I now have made a nesting group with samesize="false" but this was only an idea.
Is there something else to look at, when the listview is not good as it could be?
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Listview weight

Post by airsoftsoftwair »

I still don't really understand what you're trying to achieve here... maybe you can post a short sample code that shows the problem?
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Re: Listview weight

Post by GMKai »

Problem is with the columns:
The text is cut off, e.g. it says "Frank" instead of "Frankfurter SV".
So for example for "Frankfurter SV" the first column is filled with "Frank" by default. The second column, which is defined exactly the same, the text only says "Fran".

The full text becomes visible when the window size is changed. Even minimizing the window is possible with my current state, but columns are not completly visible...
With shorter examples I only get working titles...
I even tried to close and reopen my window, but still no success...
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Listview weight

Post by airsoftsoftwair »

If you leave out the "weight" in your listview declaration, MUI should always adapt the column size automatically... this should solve the problem. Just remove the "weight" attribute from all your listview columns.
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Re: Listview weight

Post by GMKai »

leaving out "weight" does not change the behaviour...
and the columns "home" and "away" have different weight...
and resizing the window leads to a "good" layout...with columns fully visible...

before filling
calling mui.set("mainmatchforecast","Quiet",True)
or not calling,
does not change the result...
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Listview weight

Post by airsoftsoftwair »

Please provide a VERY SHORT demo script and XML that shows what the problem is. I've tested MUI's behaviour here and it always adapts the column width to the width of the largest entry so I don't really know why this isn't working for you...
Post Reply