Active item issue in a listview after sorting

Discuss GUI programming with the MUI Royale plugin here
Post Reply
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Active item issue in a listview after sorting

Post by jPV »

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:

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) 
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Active item issue in a listview after sorting

Post by jPV »

And apparently that work-around with selection doesn't work with newer OS4 MUI versions... it works with the MUI version which comes with OS4.1FE, but my betatester reported that it doesn't work with some MUI version from this year. Selected item isn't kept when sorted...
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Active item issue in a listview after sorting

Post by airsoftsoftwair »

This sounds like a MUI bug to me since MUI Royale doesn't intefere with sorting. PM tboeckel or open a ticket over on http://muidev.de ...
User avatar
tboeckel
Posts: 38
Joined: Fri Jun 06, 2014 6:17 am
Location: Germany

Re: Active item issue in a listview after sorting

Post by tboeckel »

As Andreas already pointed out, please open a ticket in MUI's bugtracker. Although I receive a notification mail for you PM it tends to get overseen after a few days. Tickets in the bugtracker remain visible.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Active item issue in a listview after sorting

Post by jPV »

The active item issue got fixed and will be released in the next MUI update.
User avatar
tboeckel
Posts: 38
Joined: Fri Jun 06, 2014 6:17 am
Location: Germany

Re: Active item issue in a listview after sorting

Post by tboeckel »

@jPV
You mentioned some problems selecting items from code. If that is really an issue then please open a new ticket with appropriate information. Basically selecting items from code does work. See the example list object in MUI prefs on the List page. It has some selected items which get selected by invoking the MUIM_List_Select method accordingly.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Active item issue in a listview after sorting

Post by jPV »

Yeah, I'll try to investigate it a bit better first. I'll have to write couple test programs and get my betatester to test them... and try to check his MUI settings etc. Or I should install newer MUI to my OS4 setup, which I OTOH would want to keep as plain as possible (standard OS4.1FE and its MUI) for testing purposes.

If I don't have time today, then I'll do it at the end of the next week.

Basically it seemed that for example these kinds of lines didn't select anything when added to the previous example with his 5.0-2017R4 setup:
mui.DoMethod("lv","select",2,"on")
or
mui.DoMethod("lv","select","active","on")

While they do on my plain FE setup with no MUI updates...

Could some multiselect mode affect? Is there something in user MUI settings that could affect? Is it just some weird configuration that selection doesn't show up? I guess I'll have to check these kinds of things before writing a ticket :)
Post Reply