Dials & Gauges Blockset    

Controlling Values with the Mouse

A key benefit of using a source block, such as a knob or slider, from the Dials & Gauges Blockset is the ability to adjust the value of the control by clicking or dragging the mouse over the control. Except for toggle elements, most mouse-controllable values in this blockset offer three modes of mouse response: None, Relative, and Snap To. This section describes the mouse-reponse modes and explains how to choose a mouse-response mode.

Description of Mouse-Response Modes

The table below describes how a control's value responds to mouse events under different mouse-response modes.

Mode
Behavior
None
The control's value does not respond to mouse events.
Relative
The change in the control's value depends on the change in the mouse position when the mouse pointer is dragged.
Snap To
The control's value becomes that of the current mouse position when the mouse button is released.

For example, if a vertical slider block uses the Snap To mode, then you can set the block's value to 12 by clicking on the value 12 on the block. If the same block uses the Relative mode and has a current value of 20, then you can set the block's value to 12 by dragging the mouse pointer downward until the slider knob corresponds to 12. When you drag, the mouse pointer must be within the bounds of the slider control, but does not need to be on or near the value 12.

Choosing a Mouse-Response Mode

The mouse-response modes described above correspond to settings of the MouseControl property in a block's ActiveX Control Properties dialog box. The table below indicates which categories of blocks and which dialog box panels have a MouseControl property.

Category of Block
Panel in Dialog Box with MouseControl Property
Angular Gauges
Needles
Knobs & Selectors
Knob
Linear Gauges
Pointers
Percent Indicators
Portions
Sliders
Knob

In typical Simulink models, blocks acting as sources use the Relative or Snap To mode to enable mouse control, while blocks acting as sinks use the None mode to disable mouse control.


  Displaying Text on a Block Modifying the Displayed Range