Ejemplo n.º 1
0
void
Gui::notifyMouseMove(int ux, int uy) 
{
	movie_root* m = _stage;

	if ( ! _started ) return;

	if ( _stopped ) return;

	// A stage pseudopixel is user pixel / _xscale wide
	boost::int32_t x = (ux-_xoffset) / _xscale;

	// A stage pseudopixel is user pixel / _xscale high
	boost::int32_t y = (uy-_yoffset) / _yscale;

#ifdef DEBUG_MOUSE_COORDINATES
	log_debug(_("mouse @ %d,%d"), x, y);
#endif

	if ( m->mouseMoved(x, y) )
	{
		// any action triggered by the
		// event required screen refresh
		display(m);
	}
    
	DisplayObject* activeEntity = m->getActiveEntityUnderPointer();
	if ( activeEntity )
	{
		if ( activeEntity->isSelectableTextField() )
		{
			setCursor(CURSOR_INPUT);
		}
		else if ( activeEntity->allowHandCursor() )
		{
			setCursor(CURSOR_HAND);
		}
		else
		{
			setCursor(CURSOR_NORMAL);
		}
	}
	else
	{
		setCursor(CURSOR_NORMAL);
	}

#ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
	_xpointer = ux;
	_ypointer = uy;
#endif


}
Ejemplo n.º 2
0
bool
MovieTester::usingHandCursor()
{
	DisplayObject* activeEntity = _movie_root->getActiveEntityUnderPointer();
	if ( ! activeEntity ) return false;

    if ( activeEntity->isSelectableTextField() ) {
        return false; // setCursor(CURSOR_INPUT);
    } else if ( activeEntity->allowHandCursor() ) {
        return true; // setCursor(CURSOR_HAND);
    } else {
        return false; // setCursor(CURSOR_NORMAL);
    }
}