Sorting of WaveSelector Widget output
hegedus
I have developed an instrument control that makes use of waveslector widget to great success.
For the wave data, it is grouped by folder name and then each individual wave has a date field. The question then becomes:
Can I sort the fields in the waveselctor widget such that the folder is alphabetical and the individual waves are reverse alphabetical? The net result of this is that the latest data is always on top of the list as directory is opened. Some of the folders of the folders may have 50+ waves and the user must scroll to the bottom of the list. I would like the most recent data to be first.
It looks to me like the folders are always alphabetical no matter what sorting you choose for the waves. Then you can use the Reverse option to sort the waves in reverse alpha order.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 6, 2010 at 01:46 pm - Permalink
Thanks for the reply. I am trying to decipher the demo code to understand how I would implement the sort and I see this function:
WS_SetGetSortOrder(windowname, listcontrolname, sortKindOrMinus1, sortReverseOrMinus1)
// Sets or gets the sort ordering. sortKindOrMinus1 and sortReverseOrMinus1 are pass-by-reference
// Listcontrolname can be the popupcontrolname passed to MakePopupIntoWaveSelectorSort.
This seems the function to call, now I do implement it?
WS_SetGetSortOrder("Settings", "List0", sortKindOrMinus1, sortReverseOrMinus1) what do I use for the sortkindorminus1 and sortreverseorminus1?
January 7, 2010 at 11:37 am - Permalink
These two functions are also documented in the comments at the top of WaveSelectorWidget.ipf.
If you use PopupWaveSelector.ipf, the popup window has a sort menu that you don't have to program.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 7, 2010 at 12:02 pm - Permalink
Thank you. With your sage advice and counsel, I was able to incorporate the improvements and make my users happy. Of course I was the main user where the previous sorting was annoying.
Thanks again.
January 8, 2010 at 10:59 am - Permalink