Popupmenu enhancements for very many entries
Fri, 04/20/2018 - 03:46 pm
The popup menus in Igor are currently not usable for more than > 50 entries.
NewPanel make/T/N=256/O data = num2char(97 + mod(p, 26)) + "_" + num2str(p) string/G str = Textwavetolist(data, ";") PopupMenu pop, value=str
- User has to do too much scrolling for selecting an entry.
- When selecting an entry from very far off from the currently selected entry there is also a lot of scrolling involved too.
- Unresolved issues in multi monitor setups where no entries are shown at all
Provide a mechanism for creating subgroups for the popup menus like in 1.
PopupMenu subMenu(SubMenuName)="a_.*", subMenu(...)=...
All popupmenu list items matching the regular expression would be collected and moved into a submenu named
SubMenuName. The order of giving the keywords determines the order of collection for multiple submenus. No entry can be in more than one submenu. The position of the submenu can be set by adding an entry named
SubMenuName into the item list. There is no resorting done so the order of the entries is completely controllable by the user.
GUI control procedure
The submenus are transparent for the GUI procedure this means the list indizes passed into it are the linear indizes without using submenus. There is no event send when selecting a submenu entry.
Recursion can be achieved by adding entries like
SubMenuB would be a submenu in
SubMenuA. The items for
SubMenuB would be collected just from the subset of items of
Alternative ways of specifying the list
There are cases where a regular expression is not the right choice. For these cases the user can specify a semicolon separated list of items for each submenu or one could invent new
Special Characters in Menu Item Strings specifiers for denoting a submenu name and to which submenu an item belongs.