rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvButtonInteractor Class Reference

Button interactor class. More...

#include <ilviews/graphics/inter.h>

Inheritance diagram for IlvButtonInteractor:
IlvInteractor IlvRepeatButtonInteractor IlvToggleInteractor

List of all members.

Public Member Functions

 IlvButtonInteractor (IlUShort button=((IlUShort) 0x0001), IlvApplyObject action=0, IlAny arg=0)
 Constructor.
virtual void doIt (IlvGraphic *obj)
 Calls the user function.
IlvApplyObject getAction () const
 Returns the user function.
virtual IlBoolean handleEvent (IlvGraphic *obj, IlvEvent &event, const IlvTransformer *t)
 Handles events received by the interactor.
void setAction (IlvApplyObject action, IlAny arg=0)
 Sets the user function and the user argument.

Detailed Description

Button interactor class.

Library: views

Use the IlvButtonInteractor class to make an object act like a standard interface button. The member function handleEvent is designed to call the member function IlvGraphic::invert of the object. This gives the object the appearance that is is pressed or activated when you click on it.

The registered name of this interactor is "Button".

See also:
IlvButton, IlvRepeatButtonInteractor.

Constructor & Destructor Documentation

IlvButtonInteractor::IlvButtonInteractor ( IlUShort  button = ((IlUShort) 0x0001),
IlvApplyObject  action = 0,
IlAny  arg = 0 
)

Constructor.

Initializes a new instance of the IlvButtonInteractor class. The action function will be called when the user clicks on the object. If action is not specified, the object's callback is called.

Parameters:
button The mouse button that is used for the interaction.
action The user function called on a click.
arg The user argument.

Member Function Documentation

virtual void IlvButtonInteractor::doIt ( IlvGraphic obj  )  [virtual]

Calls the user function.

Called when the user presses and releases the mouse button over the object obj. The default implementation calls the associated action, if one exists. If there is no associated action, then the object's callback is called. Then the object's callback corresponding to the Button symbol is called. You can overload this method to implement a different button-like behavior.

Parameters:
obj The graphic object.
See also:
setAction, IlvGraphic::setCallback
IlvApplyObject IlvButtonInteractor::getAction (  )  const

Returns the user function.

Returns:
The action associated with the interactor.
virtual IlBoolean IlvButtonInteractor::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:
g The graphic object that receives the event.
event The received event.
t The transformer applied to the view in which the event occurred.
Returns:
IlTrue if the event was successfully handled and IlFalse otherwise.

Implements IlvInteractor.

Reimplemented in IlvToggleInteractor.

void IlvButtonInteractor::setAction ( IlvApplyObject  action,
IlAny  arg = 0 
)

Sets the user function and the user argument.

Sets the action to action and its argument to userArg.

Parameters:
action The user function.
arg The user argument.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.