//==============================
// VRMenuEventHandler::DispatchToPath
bool VRMenuEventHandler::DispatchToPath( OvrGuiSys & guiSys, VrFrame const & vrFrame, 
        VRMenuEvent const & event, Array< menuHandle_t > const & path, bool const log ) const
{
	// send to the focus path only -- this list should be parent -> child order
	for ( int i = 0; i < path.GetSizeI(); ++i )
	{
		VRMenuObject * obj = guiSys.GetVRMenuMgr().ToObject( path[i] );
		char const * const indent = "                                                                ";
		// set to 
		if ( obj != NULL && DispatchToComponents( guiSys, vrFrame, event, obj ) )
		{
			if ( log )
			{
				LOG( "%sDispatchToPath: %s, object '%s' consumed event.", &indent[64 - i * 2],
						VRMenuEvent::EventTypeNames[event.EventType], ( obj != NULL ? obj->GetText().ToCStr() : "<null>" ) );
			}	
			return true;    // consumed by a component
		}
		if ( log )
		{
			LOG( "%sDispatchToPath: %s, object '%s' passed event.", &indent[64 - i * 2],
					VRMenuEvent::EventTypeNames[event.EventType], obj != NULL ? obj->GetText().ToCStr() : "<null>" );
		}
	}
	return false;
}
Esempio n. 2
0
const String & UILabel::GetText() const
{
	VRMenuObject * object = GetMenuObject();
	assert( object );
	return object->GetText();
}