Opened 3 months ago

Closed 2 months ago

#386 closed bug (fixed)

Selected items aren't shown in MUI 5.0-2017R4

Reported by: jPV Owned by: Thore Böckelmann
Priority: undecided Milestone: 5.0-2018R2
Component: List.mui Version: 5.0-2017R4
Severity: minor Keywords:
Cc: OS Platform: undefined
Blocked By: Blocking:
Release Notes:

Description

Summary

I got a report that my Hollywood program doesn't show the selected items in a listview. Items don't get highlighted if I select them programmatically, although they are in the selected state if I check them by the GetSelection method.

My OS4.1FE default MUI version does show them as expected, but the problem seems to be with newer MUI versions, 5.0-2017R4 in this case.

Steps to reproduce

  1. Try this example program: http://jpv.wmhost.com/testi/select/selectiontest (and have this in the same dir: http://jpv.wmhost.com/testi/select/muiroyale.hwp)

Expected results

You see two selected items in the list

Actual results

None of the items seem to get selected visibly

Attachments (2)

DragnDrop.lha (17.9 KB) - added by Thore Böckelmann 3 months ago.
modified DragnDrop demo for AmigaOS3
DragnDrop.c (11.2 KB) - added by Thore Böckelmann 3 months ago.
source code of modified DragnDrop demo

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 months ago by Thore Böckelmann

I run the demo like this

hollywood selectiontest

But all I get is an error requester telling me about a general syntax error in line 1.

But to demonstrate that selecting items from code is definitely working I modified the DragnDrop demo a bit. Find the AmigaOS3 binary plus the source attached here.

Changed 3 months ago by Thore Böckelmann

Attachment: DragnDrop.lha added

modified DragnDrop demo for AmigaOS3

Changed 3 months ago by Thore Böckelmann

Attachment: DragnDrop.c added

source code of modified DragnDrop demo

comment:2 in reply to:  1 Changed 2 months ago by jPV

Replying to Thore Böckelmann:

I run the demo like this

hollywood selectiontest

But all I get is an error requester telling me about a general syntax error in line 1.

"selectiontest" is a compiled executable (OS4 binary), not an applet. So don't run it with Hollywood, just launch it like any other program.

Last edited 2 months ago by jPV (previous) (diff)

comment:3 Changed 2 months ago by Thore Böckelmann

Milestone: future release5.0-2018R2
Owner: set to Thore Böckelmann
Status: newassigned

Hm, strange. The modified DragnDrop demo definitely selects the desired entries visibly, while your demo does not. Although both demos produce the same debug output during the artificial selection for me.

I'll have to investigate a bit further.

comment:4 Changed 2 months ago by Thore Böckelmann

Ok. Is it possible you are trying to do multiselection on a list which does not have multiselection enabled? That is the only explanation.

MUI's list item background selection works like this:
multiselection enable & selected item → selected background
active item → active background
otherwise → normal background

Since you do a selection on a non-multiselection list the first two tests will always fails and only the last resort "normal background" will be applied.

I must admit that List class is very inconsistent here. A non-multiselection list must not have more than one single selected entry, but the current implementation allows this, although it is not documented.

I will change List class' behaviour accordingly to act consistently for non-multiselection lists.

comment:5 Changed 2 months ago by Thore Böckelmann

Resolution: fixed
Status: assignedclosed

In 6304:

  • List.c: calling MUIM_List_Select on a non-multiselection list will keep only the last selected entry in selected state to be consistent with the MUIA_List_MultiSelect attribute. This closes #386.
Note: See TracTickets for help on using tickets.