Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Named property class. More...
#include <ilviews/util/animator.h>
Public Types | |
enum | IlvAnimationMode { IlvAnimationNone, IlvAnimationForward, IlvAnimationBackward, IlvAnimationForwardOnce, IlvAnimationBackwardOnce } |
This enumeration defines the possible values for the animation mode of an | |
Public Member Functions | |
IlvAnimator (IlSymbol *name, IlvAnimationMode mode=IlvAnimationForward, IlUInt period=100) | |
Constructor. | |
virtual void | animate () |
Called to animate the animator. | |
void | changeState (IlUInt state, IlBoolean redraw=((IlBoolean) 1)) |
Changes the animator state. | |
IlvAnimationMode | getAnimationMode () const |
Returns the animation mode of the animator. | |
IlUInt | getPeriod () const |
Returns the animation period of the animator. | |
IlUInt | getState () const |
Returns the animator state. | |
virtual IlUInt | getStatesCount () const =0 |
Returns the number of states of the animator. | |
virtual void | initReDraws () const =0 |
Called to begin a redraw session. | |
virtual void | invalidateRegion () const =0 |
Called to invalidate the area affected by the animator. | |
virtual IlBoolean | isLastState (IlUInt state) const |
Returns a Boolean value indicating whether the specified state is the last one. | |
virtual IlUInt | nextState (IlUInt state) const |
Returns the animator state that must be set after a given state. | |
virtual void | reDraw () const |
Called to redraw the animator. | |
virtual void | reDrawViews () const =0 |
Called to finish a redraw session. | |
void | setAnimationMode (IlvAnimationMode mode, IlUInt period) |
Sets the animation mode and the period of the animator. | |
void | setAnimationMode (IlvAnimationMode mode) |
Sets the animation mode of the animator. | |
void | setState (IlUInt state) |
Sets the animator state. | |
virtual void | stateChanged (IlUInt newState, IlUInt oldState) |
Called by IlvAnimator::changeState each time the animator state changes. |
Named property class.
Library: views
IlvAnimator
is a subclass of IlvNamedProperty
that deals with animation. You can use it to animate any object that can be connected to a named property (IlvGraphic
, IlvGadgetItem
, IlvPane
, IlvNotebookPage
). Once started the animator calls the virtual method IlvAnimator::animate
to animate the object.
IlvBitmapAnimator
, IlvGraphicAnimator
This enumeration defines the possible values for the animation mode of an IlvAnimator
object.
IlvAnimator::IlvAnimator | ( | IlSymbol * | name, | |
IlvAnimationMode | mode = IlvAnimationForward , |
|||
IlUInt | period = 100 | |||
) |
Constructor.
Initializes a new instance of the IlvAnimator
class. The animator will start when it is connected to any object.
name | The animator name. | |
mode | The animation mode. | |
period | The animator period. |
virtual void IlvAnimator::animate | ( | ) | [virtual] |
Called to animate the animator.
The default implementation calls IlvAnimator::changeState
with the result of IlvAnimator::nextState
as new state, and with redraw set to IlTrue
.
getState
, nextState
, setState
, changeState
Reimplemented in IlvGraphicAnimator.
Changes the animator state.
This method calls IlvAnimator::setState
to change the state, and then calls IlvAnimator::stateChanged
.
state | The new animator state. | |
redraw | A Boolean specifying whether the animator should be redrawn. |
getState
, nextState
, setState
, reDrawViews
IlvAnimationMode IlvAnimator::getAnimationMode | ( | ) | const |
Returns the animation mode of the animator.
IlUInt IlvAnimator::getPeriod | ( | ) | const |
Returns the animation period of the animator.
The animation period is the period between two calls TO the IlvAnimator::animate
method.
IlUInt IlvAnimator::getState | ( | ) | const |
Returns the animator state.
The animator state is a value that represents the state of the animator. The default value is 0
.
setState
, nextState
, changeState
virtual IlUInt IlvAnimator::getStatesCount | ( | ) | const [pure virtual] |
Returns the number of states of the animator.
You must redefine this method in a subclass.
nextState
, changeState
Implemented in IlvBitmapAnimator.
virtual void IlvAnimator::initReDraws | ( | ) | const [pure virtual] |
Called to begin a redraw session.
You must redefine this method in a subclass.
reDraw
, invalidateRegion
, reDrawViews
Implemented in IlvGraphicAnimator.
virtual void IlvAnimator::invalidateRegion | ( | ) | const [pure virtual] |
Called to invalidate the area affected by the animator.
You must redefine this method in a subclass.
reDraw
, initReDraws
, reDrawViews
Implemented in IlvGraphicAnimator.
Returns a Boolean value indicating whether the specified state is the last one.
The default implementation compares state to the result of IlvAnimator::getStatesCount()
. You can override this function in your own subclass if you do not know the total number of states that the animator has.
state | The state. |
getStatesCount
, nextState
, changeState
Reimplemented in IlvBitmapAnimator.
Returns the animator state that must be set after a given state.
The default implementation uses the animation mode to increment (IlvAnimationForward
) or decrement (IlvAnimationBackward
) the state. You may override this method to implement your own state automate.
state | The animator state. |
IlvBadIndex
is returned, the animator stops. animate
, changeState
virtual void IlvAnimator::reDraw | ( | ) | const [virtual] |
Called to redraw the animator.
The default implementation calls IlvAnimator::initReDraws
, then IlvAnimator::invalidateRegion
, and finally reDrawViews
.
initReDraws
, invalidateRegion
, reDrawViews
virtual void IlvAnimator::reDrawViews | ( | ) | const [pure virtual] |
Called to finish a redraw session.
You must redefine this method in a subclass.
reDraw
, initReDraws
, invalidateRegion
Implemented in IlvGraphicAnimator.
void IlvAnimator::setAnimationMode | ( | IlvAnimationMode | mode, | |
IlUInt | period | |||
) |
Sets the animation mode and the period of the animator.
mode | The new animation mode. | |
period | The new animation period. |
void IlvAnimator::setAnimationMode | ( | IlvAnimationMode | mode | ) |
Sets the animation mode of the animator.
This method does not change the animation period.
mode | The new animation mode. |
void IlvAnimator::setState | ( | IlUInt | state | ) |
Sets the animator state.
This method does not call any other method.
state | The new animator state. |
getState
, nextState
, changeState
Called by IlvAnimator::changeState
each time the animator state changes.
The default implementation does nothing.
newState | The new animator state. | |
oldState | The previous animator state. |
getState
, nextState
, changeState
Reimplemented in IlvBitmapAnimator, and IlvGraphicAnimator.
© 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.