It would be very very nice if column widths in a ListView could be defined as percentage of the ListView's width. Imho, this would fit the overall philosophy of RapaGUI's resizeability most perfectly.
Cheers,
Michael
Feature request: ListView column widths as percentage
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Feature request: ListView column widths as percentage
Using proportions allows this to be done without changing the plugin at all. The width of the listview can be obtained from the getter visibility of the area parent class width and then setting the listview column widths proportionately. Doing it manually is better in some cases because a floating point multiply is a single operation on most platforms nowadays. Even if integer math is used, fixed point based on a power of 2 is almost always faster than decimal arithmetic dividing by 100.
I'm on registered MorphOS using FlowStudio.
Re: Feature request: ListView column widths as percentage
Thank you for your answer. A view more questions though (sorry if they seem silly, I'm still a bit of a newbie):
- What do you mean by "proportions"? That's not some column property to set, is it?
- How can I detect a change of the Listview's width (if the window is horizontally resized, for example)?
- To set the width of the colums correctly, I would need to know if the Listview shows a vertical scrollbar or not, to substract its width from the Listview's total width. How can I check if there's a v scrollbar and how do I get its width (which will most likely differ on every platform)?
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Feature request: ListView column widths as percentage
Instead of writing it as 33% multiply the gadget width by .33 for example, and set the column width using
Code: Select all
moai.Set(id, "Width", gadwid*.33)
This one's a little trickier but there is a gadget refresh notification for the Hollywood gadget so a single-pixel high transparent Hollywood gadget in the Listview's VGroup with the Area.FixWidth attribute set to false will give you the information you need.
This one is not possible with current versions of RapaGUI. The closest I can figure is to make one of the columns a little wider than needed and leave its pixel-width unset so it will "absorb" the width from the slider.mrupp wrote: ↑Fri Feb 19, 2021 8:17 pm
- To set the width of the colums correctly, I would need to know if the Listview shows a vertical scrollbar or not, to substract its width from the Listview's total width. How can I check if there's a v scrollbar and how do I get its width (which will most likely differ on every platform)?
I'd prefer the column weight since it defaults to 100 anyway but can use powers of two if needed.
I'm on registered MorphOS using FlowStudio.
Re: Feature request: ListView column widths as percentage
@Andreas: What do you think of having "weight" on listview columns (or "width" in percentage)? Imho, this would allow much nicer looking and adapting grids.
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Feature request: ListView column widths as percentage
Sorry, not very likely to come. The listview widget has 8 (!) different backends and this would have to be implemented for all of them. wxWidgets doesn't support it so I'd first have to extend wxWidgets to support it and it's not an easy task because of the many different backends involved. That's just not worth the effort. Maybe file a feature request with the wxWidgets team, then I could add support for it