Mouse Wheel and Scroll Bars
The GraphComponent provides a number of properties which allow specifying mouse wheel behavior, scroll bar policy, and zoom limits.
- mouseWheelBehavior
- Whether the mouse wheel is used to zoom or scroll (or both).
- mouseWheelZoomFactor
- How fast the zoom level changes when the mouse wheel is turned.
- mouseWheelScrollFactor
- How fast the viewport scrolls when the mouse wheel is turned.
- centerZoomEventRecognizer
- An event recognizer which determines whether zooming is towards the center of the view or towards the mouse location.
- mouseWheelZoomEventRecognizer
- An event recognizer which determines whether mouse wheel turns should scroll or zoom. This recognizer is only used if mouseWheelBehavior has both the SCROLL and ZOOM flags.
- verticalScrollBarPolicy
- horizontalScrollBarPolicy
- Whether and when to display vertical and horizontal scroll bars.
- minimumZoom
- maximumZoom
- Minimum and maximum allowed values for the zoom factor.
Event | Occurs when … |
---|---|
Panning
Panning, i.e. dragging the visible area with the mouse, is handled by MoveViewportInputMode. This input mode is a child input mode of both GraphEditorInputMode and GraphViewerInputMode.
MoveViewportInputMode allows customization by changing the recognizers for some gestures. This might be of importance to avoid conflicts with input modes which share the same gesture (dragging on an empty canvas), e.g. MarqueeSelectionInputMode or LassoSelectionInputMode.
- pressedRecognizer
- An event recognizer which returns
true
if an event is recognized as a valid gesture during viewport movement. This recognizer has to returntrue
for all events during the complete drag gesture. - draggedRecognizer
- An event recognizer which returns
true
if an event is recognized as a drag gesture that actually starts moving the viewport. This is only queried if the pressedRecognizer already returnstrue
. - releasedRecognizer
- An event recognizer which returns
true
if an event is recognized as a valid gesture to finish panning.
MoveViewportInputMode also supports touch gestures. Besides panning its touch support also manages zooming by pinch gestures.
- primaryDownRecognizer
- An event recognizer which returns
true
if an event is recognized as a gesture that can start a marquee selection or a pinch zoom, usually the primary touch (i.e. "first finger down"). - primaryMoveRecognizer
- An event recognizer which returns
true
if an event is recognized as a drag gesture. The gesture actually starts moving the viewport if no secondary touch device is down, otherwise it starts a pinch zoom gesture. This is only queried if the primaryMoveRecognizer already returnstrue
. - primaryUpRecognizer
- An event recognizer which returns
true
if an event is recognized as a valid gesture to finish panning. - secondaryDownRecognizer
- An event recognizer which returns
true
if an event is recognized as a valid gesture to start the actual pinch zoom, usually the second touch ("second finger down"). secondaryMoveRecognizerAn event recognizer which returnstrue
if an event is recognized as a pinch gesture (if primary touch device is down) or pan (if no primary touch device is down). - secondaryUpRecognizer
- An event recognizer which returns
true
if an event is recognized as a valid gesture to finish pinch zoom or panning if no primary touch is down.
Event | Occurs when … |
---|---|