Mon, 06/06/2016 - 01:48 pm
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?
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