On Mac (in Dataview mode) & Windows, an entry that is not fully visible is not counted as visible. I would rate this behaviour as correct.
With Mac (in Listbox mode) & MUI, such an entry is counted as visible.
@Andreas: The RapaGUI 2.0 changelog doesn't mention this to be already fixed.
Here are some screenshots to demonstrate this:
Windows x64:
Mac x64:
AmigaOS 4.1 FEu2, MUI 5:
AmigaOS 3.9, MUI 3.9:
And here's the example script to test this out:
Test.hws:
Code: Select all
@REQUIRE "RapaGUI", {Link = True}
@APPTITLE "ListView-Test"
@FILE 1, "TestGUI.xml"
Function p_ListViewSetFirst(id$, pos)
Local count = moai.Get(id$, "entries")
Local countVisible = moai.Get(id$, "visible")
Local maxFirst = count - countVisible
Local currentFirst = moai.Get(id$, "first")
Local jumpToPos = pos
If jumpToPos > maxFirst
jumpToPos = "bottom"
ElseIf currentFirst < pos
jumpToPos = jumpToPos + countVisible - 1
EndIf
moai.DoMethod(id$, "jump", jumpToPos)
Return(moai.Get(id$, "first"))
EndFunction
Function p_EventFunc(msg)
Switch(msg.ID)
Case "btnSetFirst1":
Local first = p_ListViewSetFirst("listview1", ToNumber(moai.Get("ctrlSetFirst1", "text")))
moai.Set("ctrlTrulyFirst1", "text", first)
moai.Set("ctrlVisible1", "text", moai.Get("listview1", "visible"))
Case "btnSetFirst2":
Local first = p_ListViewSetFirst("listview2", ToNumber(moai.Get("ctrlSetFirst2", "text")))
moai.Set("ctrlTrulyFirst2", "text", first)
moai.Set("ctrlVisible2", "text", moai.Get("listview2", "visible"))
Case "btnSetFirst3":
Local first = p_ListViewSetFirst("listview3", ToNumber(moai.Get("ctrlSetFirst3", "text")))
moai.Set("ctrlTrulyFirst3", "text", first)
moai.Set("ctrlVisible3", "text", moai.Get("listview3", "visible"))
EndSwitch
EndFunction
moai.CreateApp(ReadString(1))
InstallEventHandler({RapaGUI = p_EventFunc})
For Local i = 0 To 100
moai.DoMethod("listview1", "insert", "bottom", "Item " .. i)
moai.DoMethod("listview2", "insert", "bottom", i, "Item " .. i)
moai.DoMethod("listview3", "insert", "bottom", i, "Item " .. i)
Next
Repeat
WaitEvent
Forever
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="mainWindow" title="ListView-Test">
<vgroup>
<hgroup frame="true" frametitle="Listbox">
<colgroup columns="2">
<button id="btnSetFirst1">Set first</button>
<textentry id="ctrlSetFirst1" accept="0123456789">51</textentry>
<label align="center">Truly first</label>
<textentry id="ctrlTrulyFirst1" disabled="true">0</textentry>
<label align="center">Visible entries</label>
<textentry id="ctrlVisible1" disabled="true" />
<rectangle/>
<rectangle/>
</colgroup>
<listview id="listview1">
<column/>
</listview>
</hgroup>
<hgroup frame="true" frametitle="Listview witout Headers">
<colgroup columns="2">
<button id="btnSetFirst2">Set first</button>
<textentry id="ctrlSetFirst2" accept="0123456789">51</textentry>
<label align="center">Truly first</label>
<textentry id="ctrlTrulyFirst2" disabled="true">0</textentry>
<label align="center">Visible entries</label>
<textentry id="ctrlVisible2" disabled="true" />
<rectangle/>
<rectangle/>
</colgroup>
<listview id="listview2">
<column />
<column />
</listview>
</hgroup>
<hgroup frame="true" frametitle="Listview with Headers">
<colgroup columns="2">
<button id="btnSetFirst3">Set first</button>
<textentry id="ctrlSetFirst3" accept="0123456789">51</textentry>
<label align="center">Truly first</label>
<textentry id="ctrlTrulyFirst3" disabled="true">0</textentry>
<label align="center">Visible entries</label>
<textentry id="ctrlVisible3" disabled="true" />
<rectangle/>
<rectangle/>
</colgroup>
<listview id="listview3">
<column title="ID" />
<column title="Text" />
</listview>
</hgroup>
</vgroup>
</window>
</application>