Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Types | Public Member Functions
IlvGaugeInteractor Class Reference

Interactor class for IlvGauge objects. More...

#include <ilviews/graphics/gauge.h>

Inheritance diagram for IlvGaugeInteractor:
IlvInteractor

Public Types

typedef void(* Callback) (IlvGauge *gauge, IlFloat value, IlAny userArg)
 

Public Member Functions

 IlvGaugeInteractor (Callback callback=0, IlAny callbackArg=0, Callback dragCallback=0, IlAny dragCallbackArg=0)
 Constructor: More...
 
virtual IlBoolean accept (const IlvGraphic *) const
 Indicates whether the current interactor can be associated with a given object. More...
 
virtual void draggedValueChanged (IlvGauge *gauge, IlFloat value)
 Action triggered when dragging the mouse over the gauge. More...
 
virtual IlBoolean handleEvent (IlvGraphic *obj, IlvEvent &event, const IlvTransformer *t)
 Handles events received by the interactor. More...
 
virtual void valueChanged (IlvGauge *gauge, IlFloat value)
 Action triggered when the gauge value changes. More...
 
- Public Member Functions inherited from IlvInteractor
virtual void abort (IlvGraphic *obj)
 Aborts the interactor. More...
 
virtual void endOperation ()
 Performs the actions needed when the interaction ends. More...
 
virtual void getCallbackTypes (IlUInt &count, const char *const **names, const IlSymbol *const **types) const
 Gets the number of register callback types for the interactor. More...
 
const char * getRegisteredName () const
 Returns the name of the predefined shared instance. More...
 
IlBoolean isAborted () const
 Indicates whether the current interactor is in an aborted state. More...
 
IlBoolean isInOperation () const
 Indicates whether the current interactor is in an interaction state. More...
 
void lock ()
 Locks the current instance. Increments the counter that is used to know how many objects reference the current instance. More...
 
virtual void startOperation ()
 Performs the actions needed when the interaction starts. More...
 
void unLock ()
 Unlocks the current instance. Decrements the reference counter. When the counter drops down to zero, the current instance is deleted. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvInteractor
static IlvInteractorGet (const char *name, IlBoolean=IlTrue)
 Returns a predefined shared interactor instance. More...
 

Detailed Description

Interactor class for IlvGauge objects.

Library: views

Use this class to interactively change values for gauges. You can easily subtype this class, and create more application-dedicated tasks, by overloading the member functions valueChanged() or draggedValueChanged() to test for the values that the end-user specifies.
The registered name of this interactor is "Gauge".

See also
IlvGauge.

Member Typedef Documentation

§ Callback

IlvGaugeInteractor::Callback

This type defines the signatures of functions that are called by the gauge interactor.

Parameters
gaugeThe gauge object that the function applies to.
valueThe new value for the gauge object gauge.
userArgThe user parameter.

Constructor & Destructor Documentation

§ IlvGaugeInteractor()

IlvGaugeInteractor::IlvGaugeInteractor ( Callback  callback = 0,
IlAny  callbackArg = 0,
Callback  dragCallback = 0,
IlAny  dragCallbackArg = 0 
)

Constructor:

The constructor of this interactor expects two possible pairs of a user-defined function and argument. The first, callback, is a function that is called with the callbackArg parameter when the user has set a new value to a gauge and released the gauge. The second callback, dragCallback, is called each time a value is changed, allowing the application to follow the user's choices.

Member Function Documentation

§ accept()

virtual IlBoolean IlvGaugeInteractor::accept ( const IlvGraphic obj) const
virtual

Indicates whether the current interactor can be associated with a given object.

Parameters
objThe considered graphic object.
Returns
IlTrue if the interactor can safely be attached to obj, and IlFalse otherwise.
See also
IlvGraphic::setInteractor().

Reimplemented from IlvInteractor.

§ draggedValueChanged()

virtual void IlvGaugeInteractor::draggedValueChanged ( IlvGauge gauge,
IlFloat  value 
)
virtual

Action triggered when dragging the mouse over the gauge.

Called when the user drags the mouse. The default implementation is to update the gauge, and call the callback function if it exists.

Parameters
gaugeThe gauge.
valueThe new value of the gauge.

§ handleEvent()

virtual IlBoolean IlvGaugeInteractor::handleEvent ( IlvGraphic g,
IlvEvent event,
const IlvTransformer t 
)
virtual

Handles events received by the interactor.

This method is the entry point of all events dispatched to this interactor.

Parameters
gThe graphic object that receives the event.
eventThe received event.
tThe transformer applied to the view in which the event occurred.
Returns
IlTrue if the event was successfully handled and IlFalse otherwise.

Implements IlvInteractor.

§ valueChanged()

virtual void IlvGaugeInteractor::valueChanged ( IlvGauge gauge,
IlFloat  value 
)
virtual

Action triggered when the gauge value changes.

Called when the user releases the gauge being manipulated. The default implementation is to update the gauge, and call the callback function if it exists.

Parameters
gaugeThe gauge.
valueThe new value of the gauge.

© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.