The list that "pops up" from a Popupmenus in Igor7 has a vertical bar down it, with an empty space on the left side. For color table popup menu (and possibly other popup modes), this space contains a checkmark for the currently selected item. Are there any (perhaps undocumented) hooks to use this left side space with user defined menu list popup menus? Like being able to populate it with checks or bullets for selected items? I currently do something like this:
DisplayHelpTopic "Special Characters in Menu Item Strings"
But be aware that a PopupMenu control requires that special character interpretation be enabled, so you need to add "\\M1" to your menu items. DisplayHelpTopic "Enabling and Disabling Special Character Interpretation".
[quote=johnweeks]DisplayHelpTopic "Special Characters in Menu Item Strings"
But be aware that a PopupMenu control requires that special character interpretation be enabled, so you need to add "\\M1" to your menu items. DisplayHelpTopic "Enabling and Disabling Special Character Interpretation".
Thanks John, that works, puts the checkmark in the intended location. It looks so much better.
Note that with this method of marking selections you can't use something like
if(char2num(popStr[0])!= 7)
to see if an item is selected; the checkmarks are not part of the string. It is easy to redo the functions so they work properly, though.
This code uses a variable for a bitwise channel selection (0 =1, 1-2, 2=4, 3=8, etc) and a string containing the list of channels. The popmenu shows the list of channels with selected channels checked. Selecting a currently unselected channel from the popmenu selects it, selecting a selected channel deselects it.
But be aware that a PopupMenu control requires that special character interpretation be enabled, so you need to add "\\M1" to your menu items. DisplayHelpTopic "Enabling and Disabling Special Character Interpretation".
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 24, 2016 at 10:07 am - Permalink
But be aware that a PopupMenu control requires that special character interpretation be enabled, so you need to add "\\M1" to your menu items. DisplayHelpTopic "Enabling and Disabling Special Character Interpretation".
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com[/quote]
Thanks John, that works, puts the checkmark in the intended location. It looks so much better.
Note that with this method of marking selections you can't use something like
to see if an item is selected; the checkmarks are not part of the string. It is easy to redo the functions so they work properly, though.
This code uses a variable for a bitwise channel selection (0 =1, 1-2, 2=4, 3=8, etc) and a string containing the list of channels. The popmenu shows the list of channels with selected channels checked. Selecting a currently unselected channel from the popmenu selects it, selecting a selected channel deselects it.
October 26, 2016 at 10:42 am - Permalink