Active item issue in a listview after sorting
Posted: Mon Jun 18, 2018 6:30 pm
I noticed that MorphOS and OS4 behave in a different way when you are sorting a listview with an active item. On MorphOS activtion moves to a new position with the actual item when you sort a listview, but on OS4 activation stays literally on it's position no matter where the originally activated item did move. So, on MorphOS you still have the same item activated that you had before sorting, but on OS4 you have a different item activated (whatever is now at the position your originally activated item was).
I guess this is a difference in MUI implementations and not Hollywood's fault, but is it so for sure or could there be some issue in MUIRoyale? For me the MorphOS way seems to be the correct way and it could be a bug in OS4 MUI.
If I want to keep the same item activated after a sort on OS4, I have to hack this with "select an active item" -> "sort" -> "get selected item" -> "activate the selected item" -> "clear the selection"... or does anyone figure out any simplier solution?
Here's an example to demonstrate the issue:
I guess this is a difference in MUI implementations and not Hollywood's fault, but is it so for sure or could there be some issue in MUIRoyale? For me the MorphOS way seems to be the correct way and it could be a bug in OS4 MUI.
If I want to keep the same item activated after a sort on OS4, I have to hack this with "select an active item" -> "sort" -> "get selected item" -> "activate the selected item" -> "clear the selection"... or does anyone figure out any simplier solution?
Here's an example to demonstrate the issue:
Code: Select all
@DISPLAY {Hidden = True}
@REQUIRE "muiroyale"
mui.CreateGUI([[
<application base="LISTTEST">
<window title="test" muiid="MAIN">
<vgroup>
<listview id="lv">
<column>
<item>3</item>
<item>2</item>
<item>1</item>
</column>
</listview>
</vgroup>
</window>
</application>]])
Wait(100)
mui.Set("lv","active","bottom") ; Let's activate the last item in the list ("1")
Wait(100)
mui.DoMethod("lv","sort",0) ; After sorting, the active item is now "3" (new bottom) on OS4, but on MorphOS it's still the originally activated "1"
Wait(200)