Re: How to listen to multi-item selection with wxListCtrl
Carlos Azevedo <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <CAHF9xfpgzvwY=ygqAbjNv+3E0TASjvJ0+PYzCmSVL4EsMUbNRw@mail.gmail.com> |
According to https://learn.microsoft.com/en-us/windows/win32/controls/lvn-itemchanged you may need to handle the LVN_ODSTATECHANGED notification. Best regards, Carlos Azevedo Em 31/08/2023 14:44, "Igor Korot" <[email protected]> escreveu: > Hi, > > On Thu, Aug 31, 2023, 8:41 AM Andreas Falkenhahn <[email protected]> > wrote: > >> On 29.08.2023 at 19:47 Andreas Falkenhahn wrote: >> >> > Actually, just adding an additional listener for wxEVT_LIST_ITEM_FOCUSED >> > did the trick for me but I only need a solution that works on MSW. >> >> Hmm, actually, I have now found some cases where listening to >> wxEVT_LIST_ITEM_FOCUSED doesn't do the job. But there's not really >> anything that could be done about it because it's caused by weird >> behaviour of Windows' ListView widget. >> >> For some reason, Windows sometimes sets the iItem of the NMLISTVIEW >> structure to -1 when it sends an LVN_ITEMCHANGED message even though >> the message is clearly sent in response to selecting an item with >> shift+LMB. When doing so, the clicked item is correctly added to the >> selection in the listview widget but still the listview receives an >> LVN_ITEMCHANGED message with iItem set to -1 :( >> > > I presume you tried to reproduce it in pure Windows application (Win32)? > > If that's the case you can try to ping MS about that and see what the > say... > > Thank you. > > >> It only happens in certain situations and I don't understand why >> it does but it's clearly reproducible and of course it renders the >> wxEVT_LIST_ITEM_FOCUSED workaround useless because it doesn't work >> in all cases... sucks, but looks like a Windows problem. >> >> -- >> Best regards, >> Andreas Falkenhahn mailto: >> [email protected] >> >> -- >> 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 on the web visit https://groups.google.com/d/ >> msgid/wx-users/1667226010.20230831154221%40falkenhahn.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 on the web visit https://groups.google.com/d/ > msgid/wx-users/CA%2BFnnTxOhyv6Ty_ZGaL5krwK8b-9X3M5kGNdsJBvfcLdKzuEJw% > 40mail.gmail.com > <https://groups.google.com/d/msgid/wx-users/CA%2BFnnTxOhyv6Ty_ZGaL5krwK8b-9X3M5kGNdsJBvfcLdKzuEJw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 on the web visit https://groups.google.com/d/msgid/wx-users/CAHF9xfpgzvwY%3DygqAbjNv%2B3E0TASjvJ0%2BPYzCmSVL4EsMUbNRw%40mail.gmail.com.