• Listview LVS_ICON, LVS_AUTOARRANGE item ordering problem.

    From R.Wieser@21:1/5 to All on Fri Nov 5 11:45:10 2021
    Hello all,

    Using XPsp3 I've got a SysListView32 element which I have given the LVS_ICON and LVS_AUTOARRANGE settings. The thing is that even though I can see that LVM_ADDITEM increments the items indices as expected what gets displayed is rather random in its ordering.

    I've tried to google the problem/cause/solution, but can't seem to find anything (other than MS saying "Icons are automatically kept arranged in
    icon and small icon view.")

    Although I've found a "solution" by only enabeling the LVS_AUTOARRANGE
    setting *after* I've loaded the items, I'm not at all sure if this willstick for as long as the program stays open.

    In other words : I've got no idea when the autoarrange will again activate
    (on insertion ? Deletion ? Doesn't seem to on resizing, but it might ?)
    and again make a mess of the items order.

    Does anyone have some information on how/when autoarrange does its job and
    get it to behave so the items stay in order as provided (thru LM_ADDITEM / LVM_INSERITEM / others? )

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to R.Wieser on Sat Nov 6 19:57:49 2021
    On Fri, 5 Nov 2021 11:45:10 +0100, R.Wieser wrote:

    Hello all,

    Using XPsp3 I've got a SysListView32 element which I have given the LVS_ICON and LVS_AUTOARRANGE settings. The thing is that even though I can see that LVM_ADDITEM increments the items indices as expected what gets displayed is rather random in its ordering.

    I've tried to google the problem/cause/solution, but can't seem to find anything (other than MS saying "Icons are automatically kept arranged in
    icon and small icon view.")

    Although I've found a "solution" by only enabeling the LVS_AUTOARRANGE setting *after* I've loaded the items, I'm not at all sure if this willstick for as long as the program stays open.

    In other words : I've got no idea when the autoarrange will again activate (on insertion ? Deletion ? Doesn't seem to on resizing, but it might ?)
    and again make a mess of the items order.

    Does anyone have some information on how/when autoarrange does its job and get it to behave so the items stay in order as provided (thru LM_ADDITEM / LVM_INSERITEM / others? )

    Regards,
    Rudy Wieser

    It's just like the desktop's Auto Arrange. Meaning that, icons are always
    (left side) arranged. LVS_AUTOARRANGE is not same as desktop's Align To
    Grid.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Sat Nov 6 20:00:00 2021
    JJ,

    It's just like the desktop's Auto Arrange. Meaning that, icons are always (left side) arranged.

    Not quite. The default is "top side" (horizontal first) ordered, but you
    can add the LVS_ALIGNLEFT flag to have it arrange "left side" (vertical
    first).

    LVS_AUTOARRANGE is not same as desktop's Align To Grid.

    Yes, I'm aware of that.

    Alas, neither has anything to do with the ListView problem I described.

    Mind you, it sometimes seems to work allright and all items are in the order
    in which they where added to the ListView. I've got one program which (currently!) seems to have no problem, and another which (now) every time throws the items outof order.

    The thing is that when I wait with setting the LVS_AUTOARRANGE until /after/ I've addded the items to the ListView the autoarranging (when I resize the dialog and by it the ListView in it) seem to work flawlessly.

    IOW, it looks like LVS_AUTOARRANGE doesn't like LVM_INSERTITEM (and perhaps others too) very much.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)