You can add many kinds of controls to Igor Pro®'s control panels or graphs and implement their behavior by writing “control procedures” for them.

The Add/Modify Control dialog makes this relatively simple. Select the graph or panel you want to add the control to, and choose "Add Control" from the Graph or Panel menu:

Add Control Menu Item

 

Set up the control's size and other properties using the dialog:

Add Slider Control dialog

A skeleton procedure is created for you. Add your custom code in this dialog or afterwards in the procedure window. Here we’ve added only the value set code which re-computes a single-tone audio wave whose frequency is controlled by the slider value as a percentage of the 44100 Hz sampling frequency. The remaining text is the structure-based skeleton code for a slider control.

Click on Save Procedure Now, then click Do It in the main dialog to create the slider control:

Graph with Slider control

Move the slider’s thumb to see how the slider’s procedure changes the data array:


Graph with Slider moved

Other standard controls can be added using dialogs:


All Controls Demo panel

Once created the controls can be arranged by dragging, by copy-and-paste, or by contextual menus that align, distribute or even retrieve controls that stray beyond the window’s bounds:


Align controls

So far, if you change the size of the window, the controls stay where they are. It would be convenient if as the window gets wider, the slider got more room and the radio buttons stayed near the right edge. As of Igor 10, that can be easily accomplished using "Guides Mode". Guides are lines that you can position in various ways to move or resize controls. Here we have added guides to the example to allow the slider to get bigger and the radio buttons to stay at the right edge:

 Guides Mode for Panel Controls

We have added three guide lines to the panel, indicated in this editing mode as dashed green lines. the one at the left end is a fixed distance from the left edge of the panel. The two at the right end are a fixed distance from the right edge of the panel. The radio buttons have a left edge attached to one of the guides; that will make them move with the right edge of the panel. The slider is attached at both the left and right edges, making it resize as the window gets wider or narrower:

Wider window moves controls with guides

Help for Controls

You can add contextual help tips to explain the controls to your users by entering Help Text in the control dialogs:

Entering help text for a control

Another way to provide help is to create a Help button that opens an Igor Help File (that you’ve created) using the DisplayHelpTopic command:

Adding a Help button

Help file for Sine/Cosine Panel

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More