Hi Maximo
This wont work since BOutlineListView is a tree, so the full list index
(eg. 22) doesnt map to a branch BListView subindex with a smaller number of
elements. This was the first thing I tried and immediate got an out of
bounds access error.
BListView Select(idx) wont work for trees. I’m only limited to
BOutlineListView::FullListItemAt(idx) pointers, but that wont allow me to
set the private fLastSelected which is used to remove highlight when the
mouse selects another item.
Hence my request for FullListSelectItem(idx) which can access the correct
internal BListView select(subindex) method.
On Sat, 6 Apr 2024 at 13:23, Máximo Castañeda <dmarc-noreply@xxxxxxxxxxxxx>
wrote:
En viernes, 5 de abril de 2024, 19:35:22 CEST, Zenja Solaja <
solaja@xxxxxxxxx> escribió:
I have a BOutlineListView, where on program start I want toselect/highlight an item.
private fLastSelected. This is used to turn off highlight on subsequent
The BListView base class has a Select(index) method, which also sets
invocation.
BOutlineListView(). The index parameter is mapped differently for a tree
Sadly, there is no FullListSelectItem(index) for the derived class
structure, so I cannot call the appropriate Select(actual index) function.
doesn’t exist for BOutlineListView.
[...]
Long story short, FullListSelectItem(index) would solve this, but it
If I understand you correctly, you are asking for a fullIndex -> showIndex
translation.
BListItem* itemToSelect = list.FullListItemAt(fullIndex);
int32 showIndex = list.IndexOf(itemToSelect);
list.Select(showIndex);
You may want to check return values, and maybe call list.Expand(item)
before getting its index.