void g2Controller::__MouseHover(int x, int y)
{
    // Ignore if not visible
    if(!GetVisibility())
        return;
    
    // Update mouse to localized positions
    x -= pX;
    y -= pY;
    
    // If the user is moving and pressing, then do a drag event
    if(InController(x, y) && ControllerState == g2ControllerState_Pressed)
        __MouseDrag(x, y);
    // Else, if we are out of the controller, we are done dragging
    if(!InController(x, y) && ControllerState == g2ControllerState_Pressed)
        ControllerState = g2ControllerState_None;
    
    // Update the hovering actions
    MouseHover(x, y);
    
    // Update all children
    int QueueSize = (int)ChildObjects.size();
    for(int i = 0; i < QueueSize; i++)
    {
        // Get child
        g2Controller* Child = ChildObjects.front();
        ChildObjects.pop();
        
        // Update child with localized coordinates
        Child->__MouseHover(x, y);
        
        // Put back
        ChildObjects.push(Child);
    }
}
Esempio n. 2
0
void g2Controller::__MouseHover(int x, int y)
{
    // Ignore if not visible
    if(!GetVisibility())
        return;
    
    // Update mouse to localized positions
    x -= pX;
    y -= pY;
    
    // If the user is moving and pressing, then do a drag event
    if(InController(x, y) && ((ControllerState & g2ControllerState_Pressed) != 0) )
        __MouseDrag(x, y);
    
    // Update the hovering state
    if(InController(x, y))
        ControllerState |= g2ControllerState_Hover;
    // Remove if needed
    else if((ControllerState & g2ControllerState_Hover) != 0)
        ControllerState ^= g2ControllerState_Hover;
    
    // Update the hovering actions
    MouseHover(x, y);
    
    // Update all children
    for(ChildObjectsIt Child = ChildObjects.begin(); Child != ChildObjects.end(); Child++)
        (*Child)->__MouseHover(x, y);
}
Esempio n. 3
0
void EC_Touchable::OnHover()
{
    if (!IsVisible())
        Show();
    emit MouseHover();
}