Creating a control panel interface that allows me to control a number of custom functions

Hi,

I am trying to integrate a number of custom functions into a control panel box that will be present when Igor Pro is initialised. The functions have been written to analyse a wave and report back specific information. When my electrophysiological data is loaded into Igor Pro it creates a number of waves that are present across two channels - designated channel A and B.
I want to generate a command window that will allow me to quickly analyse waves in this way:
- Two tabs to choose between analysis of channel A or channel B;
- A dropdown box that allows me to choose the wave and a corresponding variable (data is analysed by using the window name, but the window is called using a frame number - therefore i need to call WindowN and n) - this would be constant across all waves loaded in - the same command will call the same waves...
- Tick boxes to determine tell igor which function to use (Function A or Function B)
- A box that reports back a value from the analysis - at the moment this value prints to the command line
- A "Go" button that executes the procedure after the commands are set.

This is an attempt to make these commands as universal as possible for my application. Does anyone know how I would go about doing this - could someone give me a generalised example as to how to construct the command window so that it starts up when igor pro is loaded and how to bring all my functions together?

Many Thanks
For executing code at startup, take a look at this.

You will need to learn how to make graphical interfaces in Igor code. I'll assume that you have at least some grasp of Igor programming.

Take a look at part III-14 of the Igor manual, "Controls and Control Panels". Also, remember that Igor code is usually plain text and therefore you can study graphical interfaces that other people have written. Open a few Igor example experiments that have controls and try to understand how they work.

Experiment. Create a new panel (Window menu -> New -> panel), show the tools (panel menu -> show tools), and add some controls (panel menu -> add controls). Experiment with the properties of the controls and try to understand what they do. Note the "procedure" property, which is the Igor code (that you write) that determines what happens when the control is activated.

Once you have created a control panel that you like, create a recreation macro (window menu -> control -> window control, hit the 'recreation macro' checkbox. Find the macro in the procedure window and paste the code into an igor function. Then execute that function. Now you know how to create a panel with controls from Igor code. Rinse, lather, repeat.

Start with something simple. How about a button that will cause a wave to be created when you click it? Then expand until you have something that resembles what you want.
First ... you have a lot of ground to cover.

Is this your first time programming such things in Igor Pro? If so, you might want to work through a few tutorials.

This recent post seems to have a similar idea to you ... http://www.igorexchange.com/node/4455. Please read in particular the comments about separating the coding for GUI design from that for data analysis.

My suggestion is to put together the panel one step at a time. By this I mean

-> add the two tabs and confirm that they work
-> add the drop down menu and confirm that it works
-> ...

The final step should be to get all of your code to start up properly when you open a (blank) experiment.

Finally, you could do well to break in to the code behind some existing panels from WaveMetrics or others posted here, especially when the panel seems to be close to what you want. Remember to muck around in copies of the procedure files, not the originals.

You'll find the forum here can help to troubleshoot specific issues as you go along.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville