Page 1 of 2
Listview Column Hide
Posted: Fri Sep 06, 2024 8:38 am
by GMKai
https://forums.hollywood-mal.com/viewtopic.php?t=2207
But here is a new report:
I have a listview defined like this:
Code: Select all
<vgroup frame="true" id="ListTankstellen" title="Tankstellenliste" weight="900">
<listview id="lvTankstellen" notify="doubleclick">
<column title="ID" hide="true">
</column>
<column title="Marke">
</column>
<column title="offen" checkbox="true">
</column>
<column title="Adresse">
</column>
<column title="Preis" sortable="true">
</column>
<column title="Entfernung" sortable="true">
</column>
<column title="lat" hide="true">
</column>
<column title="long" hide="true">
</column>
</listview>
</vgroup>
That looks good for me, when running under MorphOS.
A user reported the first column to be visible for him.
He is using AmigaOS 3.
Is that a limitation of MUI, or anything I have to set in the script?
Re: Listview Column Hide
Posted: Tue Sep 10, 2024 7:28 pm
by airsoftsoftwair
GMKai wrote: ↑Fri Sep 06, 2024 8:38 am
He is using AmigaOS 3. Is that a limitation of MUI, or anything I have to set in the script?
No, that should definitely work on OS3 as well. What exact MUI version is he using on OS3?
Re: Listview Column Hide
Posted: Tue Sep 10, 2024 8:23 pm
by jPV
I think hide doesn't work on MUI 3.8 and earlier. At least I had to skip that with MUIRoyale.. I check MUI version with
mui.IsVersion4() and modify the XML definition according to that.
Re: Listview Column Hide
Posted: Thu Sep 12, 2024 8:18 am
by GMKai
airsoftsoftwair wrote: ↑Tue Sep 10, 2024 7:28 pm
No, that should definitely work on OS3 as well. What exact MUI version is he using on OS3?
He is using MUI 3.8
I will check if I can skip IDs for all plattforms
Re: Listview Column Hide
Posted: Tue Oct 01, 2024 4:34 pm
by GMKai
I try to circumvent with a hidden shadowcopy of the listview.
Defined like this:
Code: Select all
<vgroup frame="true" id="ListTankstellen" title="Tankstellenliste" weight="900">
<listview id="lvTankstellen" notify="doubleclick;ClickColumn;TitleClick;SortColumn" alternate="true">
<column title="Marke"/>
<column title="offen" checkbox="true"/>
<column title="Adresse"/>
<column title="Preis" sortable="true" notify="sortorder" id="lvTankstellenPreis"/>
<column title="Entfernung" sortable="true" notify="sortorder" id="lvTankstellenEntf"/>
</listview>
</vgroup>
<vgroup frame="true" id="ListTankstellenHidden" weight="900">
<listview id="lvTankstellenHidden">
<column title="Marke"/>
<column title="offen" checkbox="true"/>
<column title="Adresse"/>
<column title="Preis" sortable="true" id="lvTankstellenHiddenPreis"/>
<column title="Entfernung" sortable="true" id="lvTankstellenHiddenEntf"/>
<column title="lat" />
<column title="long" />
</listview>
</vgroup>
For now I can Set the group to be hidden:
Code: Select all
moai.Set("ListTankstellenHidden","Hide",True)
During runtime I try to keep up with changes in sorted entries, which currently runs out of stack:
Code: Select all
function p_HandleListview(msg)
DebugPrint("p_HandleListview()")
DebugPrint("****")
ForEach(msg, DebugPrint)
DebugPrint("****")
If(HaveItem(msg,"attribute"))
If(msg.attribute = "TitleClick")
DebugPrint("Column: ", moai.get("lvTankstellen","SortColumn"))
DebugPrint("Triggervalue: ", msg.triggervalue)
If(msg.triggervalue = 3)
moai.set("lvTankstellen","SortColumn",3)
moai.set("lvTankstellenHidden","SortColumn",3)
ElseIf(msg.triggervalue = 4)
moai.set("lvTankstellen","SortColumn",4)
moai.set("lvTankstellenHidden","SortColumn",4)
EndIf()
DebugPrint("Column1: ",moai.get("lvTankstellen","SortColumn"))
DebugPrint("ColumnH: ",moai.get("lvTankstellenHidden","SortColumn"))
DebugPrint("Order: ",moai.get("lvTankstellenPreis","SortOrder"))
DebugPrint("Order: ",moai.get("lvTankstellenHiddenPreis","SortOrder"))
DebugPrint("OrderE: ",moai.get("lvTankstellenEntf","SortOrder"))
DebugPrint("OrderE: ",moai.get("lvTankstellenHiddenEntf","SortOrder"))
moai.DoMethod("lvTankstellen", "Sort")
moai.DoMethod("lvTankstellenHidden", "Sort")
ElseIf(msg.attribute = "DoubleClick")
p_ViewGasStationDetails()
ElseIf(msg.attribute = "SortColumn")
If(msg.triggervalue = 3)
moai.set("lvTankstellen","SortColumn",3)
moai.set("lvTankstellenHidden","SortColumn",3)
ElseIf(msg.triggervalue = 4)
moai.set("lvTankstellen","SortColumn",4)
moai.set("lvTankstellenHidden","SortColumn",4)
EndIf()
Else()
DebugPrint("!!!")
EndIf()
EndIf()
DebugPrint("************")
EndFunction
Any hints on that?
Re: Listview Column Hide
Posted: Thu Oct 03, 2024 10:01 pm
by airsoftsoftwair
Running out of stack is very likely caused by some recursion problems. You have to prepare an
MCVE so that the cause can be checked.
Re: Listview Column Hide
Posted: Fri Oct 04, 2024 12:09 pm
by GMKai
Code: Select all
@REQUIRE "RapaGUI"
moai.CreateApp([[<?xml version="1.0" encoding="utf-8"?>
<application id="app">
<window title="ListviewStack" height="Screen:60" width="Screen:60">
<vgroup>
<vgroup frame="true" id="ListTankstellen" title="Tankstellenliste" weight="900">
<listview id="lvTankstellen" notify="doubleclick;ClickColumn;TitleClick;SortColumn" alternate="true">
<column title="Marke"/>
<column title="offen" checkbox="true"/>
<column title="Adresse"/>
<column title="Preis" sortable="true" notify="sortorder" id="lvTankstellenPreis"/>
<column title="Entfernung" sortable="true" notify="sortorder" id="lvTankstellenEntf"/>
</listview>
</vgroup>
<vgroup frame="true" id="ListTankstellenHidden" weight="900">
<listview id="lvTankstellenHidden">
<column title="Marke"/>
<column title="offen" checkbox="true"/>
<column title="Adresse"/>
<column title="Preis" sortable="true" id="lvTankstellenHiddenPreis"/>
<column title="Entfernung" sortable="true" id="lvTankstellenHiddenEntf"/>
<column title="lat" />
<column title="long" />
</listview>
</vgroup>
</vgroup>
</window>
</application>
]])
Function p_EventFunc(msg)
Switch msg.action
Case "RapaGUI":
Switch msg.id
Case "lvTankstellen":
p_HandleListview(msg)
EndSwitch
EndSwitch
EndFunction
Function p_PrepareData()
moai.DoMethod("lvTankstellen", "Clear")
moai.DoMethod("lvTankstellenHidden", "Clear")
moai.Set("ListTankstellen","Hide",False)
For Local i = 0 To 3
moai.DoMethod("lvTankstellen", "Insert",i,i,i,i, i, i)
moai.DoMethod("lvTankstellenHidden", "Insert",i,i,i,i, i, i,i,i)
Next
moai.DoMethod("lvTankstellen", "Sort")
moai.DoMethod("lvTankstellenHidden", "Sort")
EndFunction
function p_HandleListview(msg)
DebugPrint("p_HandleListview()")
DebugPrint("****")
ForEach(msg, DebugPrint)
DebugPrint("****")
If(HaveItem(msg,"attribute"))
If(msg.attribute = "TitleClick")
DebugPrint("Column: ", moai.get("lvTankstellen","SortColumn"))
DebugPrint("Triggervalue: ", msg.triggervalue)
If(msg.triggervalue = 3)
moai.set("lvTankstellen","SortColumn",3)
moai.set("lvTankstellenHidden","SortColumn",3)
ElseIf(msg.triggervalue = 4)
moai.set("lvTankstellen","SortColumn",4)
moai.set("lvTankstellenHidden","SortColumn",4)
EndIf()
DebugPrint("Column1: ",moai.get("lvTankstellen","SortColumn"))
DebugPrint("ColumnH: ",moai.get("lvTankstellenHidden","SortColumn"))
DebugPrint("Order: ",moai.get("lvTankstellenPreis","SortOrder"))
DebugPrint("Order: ",moai.get("lvTankstellenHiddenPreis","SortOrder"))
DebugPrint("OrderE: ",moai.get("lvTankstellenEntf","SortOrder"))
DebugPrint("OrderE: ",moai.get("lvTankstellenHiddenEntf","SortOrder"))
moai.DoMethod("lvTankstellen", "Sort")
moai.DoMethod("lvTankstellenHidden", "Sort")
ElseIf(msg.attribute = "DoubleClick")
p_ViewGasStationDetails()
ElseIf(msg.attribute = "SortColumn")
If(msg.triggervalue = 3)
moai.set("lvTankstellen","SortColumn",3)
moai.set("lvTankstellenHidden","SortColumn",3)
ElseIf(msg.triggervalue = 4)
moai.set("lvTankstellen","SortColumn",4)
moai.set("lvTankstellenHidden","SortColumn",4)
EndIf()
Else()
DebugPrint("!!!")
EndIf()
EndIf()
DebugPrint("************")
EndFunction
InstallEventHandler({RapaGUI = p_EventFunc})
p_PrepareData()
Repeat
WaitEvent
Forever
Clicking the sortable columns make the application run out of stack
Re: Listview Column Hide
Posted: Wed Oct 09, 2024 6:39 pm
by airsoftsoftwair
Works here on AmigaOS 3 with the latest MUI. What platform are you on and which MUI version?
Re: Listview Column Hide
Posted: Thu Oct 10, 2024 8:14 am
by GMKai
this was tested with Morphos 3.8
bugfixrelease of rapagui is also installed.
will give it another shot under Windows...
Re: Listview Column Hide
Posted: Thu Oct 10, 2024 8:21 am
by GMKai
works with windows too
will see if i can get it to work in the intended way and check if that changes behaviour under MorphOS