haxeui / haxeui-hxwidgets

The hxWidgets backend of the HaxeUI framework -
http://haxeui.org
MIT License
23 stars 7 forks source link

Listview with multiple selections #53

Open Shallowmallow opened 9 months ago

Shallowmallow commented 9 months ago

image

Can set indices, get items etc

Just two question. What is the point of one-item-repeated ? Maybe I should also force one line section for this selection mode.

Plus code question, I did this in ListViewSelectedIndices. for (i in (_value:Array<Int>)) { view.ensureVisible(i); } If someone do selectedIndices = ["aa", bb"]. Feels it could it break. Wonder if there is a better way.

Needs https://github.com/haxeui/hxWidgets/pull/104

ianharrigan commented 9 months ago

Does ensureVisible even work on haxeui-hxwidgets? I think its the default behaviour tbh (at least on windows). And if its not, i guess it would just ensure the last item was visible?

Shallowmallow commented 9 months ago

EnsureVisible work. Like if you set the selectedIndices by code,it's better to use it.

i guess it would just ensure the last item was visible? I think you're right. I did this because I saw this in normal Listview, and I thought there was surely a good reason I didn't understand about to do this ( and maybe there is in core). But ensure last item is enough I think

Le mer. 31 janv. 2024 à 07:41, Ian Harrigan @.***> a écrit :

Does ensureVisible even work on haxeui-hxwidgets? I think its the default behaviour tbh (at least on windows). And if its not, i guess it would just ensure the last item was visible?

— Reply to this email directly, view it on GitHub https://github.com/haxeui/haxeui-hxwidgets/pull/53#issuecomment-1918481954, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBNBIUYDPJWTVVHPDW2YHDYRHRRPAVCNFSM6AAAAABCSB2432VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYGQ4DCOJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

ianharrigan commented 9 months ago

Where is the behaviour for ensureVisible on hxwidgets? I think its the default behaviour on wx, but pretty sure there is no code in haxeui-hxwidgets to expose that functionality (unless i just can see it)

Shallowmallow commented 9 months ago

It's in hx.widgets.ListCtrl.

Le mer. 31 janv. 2024 à 08:54, Ian Harrigan @.***> a écrit :

Where is the behaviour for ensureVisible on hxwidgets? I think its the default behaviour on wx, but pretty sure there is no code in haxeui-hxwidgets to expose that functionality (unless i just can see it)

— Reply to this email directly, view it on GitHub https://github.com/haxeui/haxeui-hxwidgets/pull/53#issuecomment-1918569479, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBNBIWIASCSO6PURDOKD7TYRH2B5AVCNFSM6AAAAABCSB2432VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYGU3DSNBXHE . You are receiving this because you authored the thread.Message ID: @.***>

ianharrigan commented 9 months ago

Sorry, ive been reading this wrong the whole time... this is adding the behaviour for mulitple selections to haxeui-hxwidgets... got it... for now, i would do anything with ensureVisible... wx is pretty good at handling it, unless we note otherwise