Re: Very long listboxes
Quentin Cosendey <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
Hello, The simplest you can do is add letter navigation. Note that depending on the exact control used, it isn't always natively available. For exemple under windows, for wxListBox, wxComboBox and wxChoice, by default it works only with the first letter. If you rapidely type C and then H, the first element starting with H will be selected, rather than the first element starting with CH. It will works fully if you use wxListCtrl or wxListView instead. You can of course implement or reimplement letter navigation yourself, it isn't that hard. I can share some code if you want. However, it will look more modern if you add an instantaneous filter above the list, in a separate wxTextCtrl or similar. It is done in many apps nowadays. By instant filter, I mean that whenever you type something in the text field, the list is refreshed and only shows matching items. If you do something like this, it's simpler for you if you rely on the user data value / item data to identify what the user selected, rather than the actual item string or index. Hopes it helps. Le 01.08.2023 à 14:33, Marian Beermann a écrit : > If there is any kind of grouping/hierarchy to the items (even > synthetic) then those controls would be an option, like a tree control > or (if we are in the deep 90s) miller columns. > > The more modern approach is to add an instant filter widget > (wxSearchCtrl) on top of the list widget. > > Cheers > > On 7/31/23 19:54, Kenneth Porter wrote: >> I've got a dialog with a listbox populated with perhaps 100 entries. >> Scrolling down and spotting the desired one can be tedious. Are there >> better ways to handle that? (Think of when you're old like me and you >> have scroll down to find your birth year!) >> > -- 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/adfa1d88-cfc0-2ede-7123-c8485537120c%40bluewin.ch.