Re: wxTreeCtrl::EnsureVisible expands only one item

Dan Korn <[email protected]> Thu, 12 Jun 2025 16:51:50 -0700 (PDT)
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Hello Vadim,

Thank you for the reply.

I do indeed see a difference in behavior between wxWidgets 3.1 and 3.2, on 
the same Windows machine.  Specifically, between versions 3.1.2 and 3.2.4.  
I'm on Windows 10 Pro, but the same issue occurs on Windows 11 with 
wxWidgets 3.2.

I also see the call to TreeView_EnsureVisible (the macro equivalent of 
TVM_ENSUREVISIBLE) in wxTreeCtrl::EnsureVisible() in src/msw/treectrl.cpp. 
And that does seem to have been unchanged for quite some time.  
Nevertheless, there is this difference in behavior when it's called 
multiple times.

I suspect that the change is due to something else in the code handling the 
change in the selected or activated node when this occurs, or possibly in 
response to our code's call to SetItemBackgroundColour().

Do you have any idea how to find the relevant code change and work around 
it?

We do need other changes in wxWidgets 3.2, so rolling back completely is 
not a good solution.

Thanks,
Dan


On Thursday, June 12, 2025 at 3:23:46 PM UTC-5 Vadim Zeitlin wrote:

> On Thu, 12 Jun 2025 11:59:57 -0700 (PDT) Dan Korn wrote:
>
> DK> Now, however, in wxWidgets 3.2 on Windows, when EnsureVisible() is 
> called, 
> DK> all previously opened nodes are closed. So only the last matching item 
> is 
> DK> left open. This is a regression, as users are confused because they no 
> DK> longer see all the matching items.
> DK> 
> DK> Was this an intentional change to wxTreeCtrl? Is there any workaround, 
> so 
> DK> that all matching nodes can be opened?
>
> This is very surprising because wxTreeCtrl::EnsureVisible() is basically
> unchanged since the very first version-controlled version from 1998. It is
> also an extremely simple function which just sends TVM_ENSUREVISIBLE to the
> tree control.
>
> Could the change be actually due to a change in behaviour in Windows
> itself or do you really see different behaviour from different wx versions
> under the same version of the OS?
>
> Regards,
> VZ
>
> -- 
> TT-Solutions: wxWidgets consultancy and technical support
> https://www.tt-solutions.com/
>

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/0be4e29c-3301-4514-85c9-40a185d14fc7n%40googlegroups.com.