I'd like to create a popup menu to select colors, but would like to bring up a selected color palette instead of allowing the user to select from the entire *COLORPOP* selection. Is there a way to prompt the user to select from the pre-selected colors in the "Custom colors" section in the attached image?
To be clear, it doesn't need to be the built-in "Custom colors" section. I just mean that I want the user to be able to select from a subset of all of the available colors, so that all charts use the same color palette of 5-10 previously designated colors.
Can you point me into the direction of how to create custom popups like this? (That's really the intention of my poorly-worded original question).
I can't figure out the programming sequence to create an item in a menu list that is a solid color of a specified (r,g,b) value.
I read through the "Setting the Popup Menu Items" section of the popupmenu help entry. Perhaps my question is more about the escape sequence to generate a solid colored block without text?
Are you wanting this in a user-defined menu (somewhere in the menu bar or in a contextual menu), or a PopupMenu control?
Either way, Igor doesn't offer a custom palette color picker, but for a PopupMenu control you could (with considerable effort) implement something like the PopupWaveSelector that instead pops up a list of colors in a ListBox control.
See PopupWaveSelector.ipf, loaded when you add this line to your procedure window:
Thanks for the suggestions. I loaded the sample experiment and got a pop-up of wave names, but didn't see any custom color panels.
I think that boil down my question to a simpler question: how can I create a single custom color panel in a menu for the user to select? Once I can figure out how to create a single entry in the popup menu that shows a swatch of a single color, I think that I can figure it out from there, but that's the piece of code that's eluding me.
I think the intention of the pointer to PopupWaveSelector was as an example of the sorts of things that can be done with great effort :) You could probably use a similar idea of a control panel with a listbox in it that pops up on a mouse click. The listbox can have list items with colored backgrounds, and maybe color names as the text instead of wave names. It would be similar to the active listbox in the Color Wave Editor package (Data->Packages->Color Wave Editor).
I have worked my way through the example and can see now how to manage the background color in a listbox using the colorwave parameter.
Unless there's a way to select the background color of an individual listing in a popup menu, I'm inclined to do this with buttons of specified color and associated checkboxes.
Am I correct that there's not a way to modify the background color of a popup menu?
June 6, 2016 at 01:56 pm - Permalink
You'll need your own custom panel with five color popups.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
June 6, 2016 at 05:28 pm - Permalink
I can't figure out the programming sequence to create an item in a menu list that is a solid color of a specified (r,g,b) value.
I read through the "Setting the Popup Menu Items" section of the popupmenu help entry. Perhaps my question is more about the escape sequence to generate a solid colored block without text?
June 7, 2016 at 07:12 am - Permalink
Either way, Igor doesn't offer a custom palette color picker, but for a PopupMenu control you could (with considerable effort) implement something like the PopupWaveSelector that instead pops up a list of colors in a ListBox control.
See PopupWaveSelector.ipf, loaded when you add this line to your procedure window:
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
June 7, 2016 at 10:47 am - Permalink
But really you should check the demo experiment: File->Example Experiments->Programming->WaveSelectorWidgetExample.pxp
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 7, 2016 at 11:37 am - Permalink
I think that boil down my question to a simpler question: how can I create a single custom color panel in a menu for the user to select? Once I can figure out how to create a single entry in the popup menu that shows a swatch of a single color, I think that I can figure it out from there, but that's the piece of code that's eluding me.
June 8, 2016 at 03:51 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 8, 2016 at 09:15 am - Permalink
Unless there's a way to select the background color of an individual listing in a popup menu, I'm inclined to do this with buttons of specified color and associated checkboxes.
Am I correct that there's not a way to modify the background color of a popup menu?
June 9, 2016 at 03:38 am - Permalink
You are correct.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 9, 2016 at 01:07 pm - Permalink
That's actually a bit easier than a popup listbox.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
June 9, 2016 at 08:21 pm - Permalink