Possible bug with icon columns in ListView

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
Clyde
Posts: 180
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Possible bug with icon columns in ListView

Post by Clyde » Thu Jul 04, 2019 12:03 pm

There seems to be a visual bug when I use an icon column if that column is not the first column of the list view.

This is my code:

Code: Select all

@REQUIRE "RapaGUI"

xml$=[[<?xml version="1.0" encoding="iso-8859-1"?>
    <application id="app">
        <window>
            <vgroup>
		<listview id="listview1">
            	  <column title="Value 1"  />
            	  <column title="Value 2"/>
            	  <column title="Value 3"/>
            	  <column title="Value 4"/>
            	  <column title="Color" icon="True" />
        	</listview>
	   </vgroup>
        </window>
    </application>]]

moai.CreateApp(xml$)

Local brushID = 1
CreateBrush(brushID, 60, 20, #RED)

moai.DoMethod("listview1","insert","bottom", "a", "b", "c", "d", brushID, "e")

Repeat
   WaitEvent
Forever
The icon column is the last column. If you run this code you see that the content of the first column seems to be right aligned, while it should be left aligned like the other columns.
The problem is that the content is not really right aligned but it is moved 60 px to the right which is the width of my brush of the last column! So in this case you don't see that the first column has content until you resize the column. If you decrease the width of the icon brush (let's say to 20) you see the content of the first column but still moved 20 px to the right.

Here are screenshots of the problem:

Image
Image

Tested on Windows 10
Currently using: Hollywood 7.1 with Windows IDE

User avatar
airsoftsoftwair
Posts: 3121
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Possible bug with icon columns in ListView

Post by airsoftsoftwair » Thu Jul 04, 2019 12:24 pm

Does the problem also occur in dataview mode? i.e. create the listview like this:

Code: Select all

<listview id="listview1" forcemode="dataview">

User avatar
Clyde
Posts: 180
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Possible bug with icon columns in ListView

Post by Clyde » Thu Jul 04, 2019 10:50 pm

Nope, in dataview mode it works correctly! So thanks a lot for this nice workaround! But it should also work in normal mode, right?
Currently using: Hollywood 7.1 with Windows IDE

User avatar
airsoftsoftwair
Posts: 3121
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Possible bug with icon columns in ListView

Post by airsoftsoftwair » Sat Jul 06, 2019 11:55 am

Clyde wrote:
Thu Jul 04, 2019 10:50 pm
Nope, in dataview mode it works correctly! So thanks a lot for this nice workaround! But it should also work in normal mode, right?
Yes, it should. I'll see what's wrong there.

User avatar
Clyde
Posts: 180
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Possible bug with icon columns in ListView

Post by Clyde » Sat Jul 06, 2019 10:58 pm

Great, thank you!
Currently using: Hollywood 7.1 with Windows IDE

Post Reply