5.5.4. Handling user interface events in the Theme class

The methods in Example 5.29 react to user input:

Example 5.29. Handling user interface events in the Theme class

...
void Blue::onTouchDrag(Widget* w, MultiTouch::Event e)
{
    if (w != this) return;
    if (state == StateBrowsing)
    {
        velocity -= float(e.position.x-lastMouseX) * 0.25f;
    }
    lastMouseX = (float)e.position.x;
}

void Blue::onTouchPress(Widget* w, MultiTouch::Event e)
{
    if (w != this) return;
    lastMouseX = (float)e.position.x;
    lastMouseTime = getTime();
    isPressed = true;
}

void Blue::onTouchRelease(Widget* w, MultiTouch::Event e)
{
    isPressed = false;
}

void Blue::onTouchTap(Widget* w, MultiTouch::Event e)
{
    if (w != this) return;

    if( state == StateBrowsing ) 
    {
        targetApplet = 0;
        state = StateOpeningTargetApplet;
    }
}
...

Copyright © 2010 ARM. All rights reserved.ARM DUI 0527A‑02a
Non-Confidential - Draft - BetaID070710