3.4 Range widgets

This section describes the widgets in the ABAQUS GUI Toolkit that allow the user to specify a value within certain bounds. The following topics are covered:


3.4.1 Sliders

The AFXSlider widget provides a handle that the user can drag to set a value using only the mouse. AFXSlider extends the capability of the FXSlider widget by providing the following:

  • An optional title.

  • Minimum and maximum range labels.

  • The ability to display the current value above the drag handle.

For example,
slider = AFXSlider(p, 0, 0, 
    AFXSLIDER_INSIDE_BAR|AFXSLIDER_SHOW_VALUE|LAYOUT_FILL_X)
slider.setMinLabelText('Min')
slider.setMaxLabelText('Max')
slider.setDecimalPlaces(1)
slider.setRange(20, 80)
slider.setValue(50)

Figure 3–17 An example of a slider from AFXSlider.


3.4.2 Spinners

The AFXSpinner widget combines a text field and two arrow buttons. The arrows increment the integer value shown in the text field. AFXSpinner extends the capability of the FXSpinner widget by providing an optional label. For example,

spinner = AFXSpinner(p, 4, 'AFXSpinner:')
spinner.setRange(20, 80)
spinner.setValue(50)

Figure 3–18 An example of a spinner from AFXSpinner.

The AFXFloatSpinner widget is similar to the AFXSpinner widget, but it allows floating point values.