Ejemplo n.º 1
0
 public ActionResult Index(HomeCommand command)
 {
     // if we get here, ModelState is valid
     // save to db etc.
     return(new AjaxAwareRedirectResult(Url.Action("index"))
            .AndAlert(this, AlertType.Success, "Subscription Received.", "Thank you for subscribing, we now have your most personal details. Mwah ha ha ha haaa!"));
 }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var vm = new HomeCommand
            {
                Number = 0
            };

            return View(vm);
        }
Ejemplo n.º 3
0
 public DashboardVM()
 {
     CurrentModel     = new DashboardModel();
     ChildUserControl = new selectOptionUserControl(this, currentUser);
     AboutUs          = new AboutUsCommand(this);
     ContactUs        = new ContactUsCommand(this);
     Home             = new HomeCommand(this);
     Account          = new AccountCommand(this);
     ShutDown         = new ShutDownCommand(this);
 }
Ejemplo n.º 4
0
        private void ClearHistory()
        {
            history.Clear();
            actualHistoryItem = null;

            backButton.IsEnabled = false;

            HomeCommand.ChangeCanExecute();
            ClearCacheCommand.ChangeCanExecute();
        }
Ejemplo n.º 5
0
 public MainWindowViewModel()
 {
     mainWindowModel = new MainWindowModel();
     initLogIn();
     HomeCommand        = new HomeCommand();
     LogOutCommand      = new LogOutCommand();
     DailyFoodCommand   = new DailyFoodCommand();
     WeekGoalsCommand   = new WeekGoalsCommand();
     SearchCommand      = new SearchFoodCommand();
     WeekDetailsCommand = new WeekDetailsCommand();
 }
Ejemplo n.º 6
0
        protected override void OnModelPropertyChanged(string propertyName)
        {
            RaisePropertyChanged(propertyName);

            if (propertyName == "Presentation")
            {
                RemoveNodeCommand.RaiseCanExecuteChanged();
                RemoveAllButCommand.RaiseCanExecuteChanged();
                ShowCyclesCommand.RaiseCanExecuteChanged();
                RemoveNodesWithoutSourcesCommand.RaiseCanExecuteChanged();
                RemoveNodesWithoutTargetsCommand.RaiseCanExecuteChanged();
                RemoveNodesWithoutSiblingsCommand.RaiseCanExecuteChanged();
                ShowNodesOutsideClustersCommand.RaiseCanExecuteChanged();
                FoldUnfoldAllClustersCommand.RaiseCanExecuteChanged();
                AddVisibleNodesOutsideClustersToClusterCommand.RaiseCanExecuteChanged();
                ClearSelectionCommand.RaiseCanExecuteChanged();
                InvertSelectionCommand.RaiseCanExecuteChanged();
                HomeCommand.RaiseCanExecuteChanged();
                InvalidateLayoutCommand.RaiseCanExecuteChanged();
                PrintGraphCommand.RaiseCanExecuteChanged();

                BuildClustersMenu();
                BuildSelectedNodesMenu();

                if (myTransformationsModuleObserver != null)
                {
                    mySelectionObserver.ModuleChanged -= OnSelectionChanged;
                    mySelectionObserver.Dispose();
                    mySelectionObserver = null;

                    myTransformationsModuleObserver.ModuleChanged -= OnTransformationsModuleChanged;
                    myTransformationsModuleObserver.Dispose();
                    myTransformationsModuleObserver = null;
                }

                if (Presentation != null)
                {
                    var transformations = Presentation.GetModule <ITransformationModule>();
                    myTransformationsModuleObserver = transformations.CreateObserver();
                    myTransformationsModuleObserver.ModuleChanged += OnTransformationsModuleChanged;

                    mySelectionObserver = Presentation.GetPropertySetFor <Selection>().CreateObserver();
                    mySelectionObserver.ModuleChanged += OnSelectionChanged;
                }
            }
        }
Ejemplo n.º 7
0
        private bool PopHistoryItem()
        {
            if (history.Count >= 1)
            {
                HistoryItem item = history.Last();
                switch (item.Type)
                {
                case HistoryType.Search:
                    Search((string)item.Value, false);
                    break;

                case HistoryType.Number:
                    ShowByNumber((int)item.Value, false);
                    break;

                case HistoryType.Key:
                    ShowByKey((string)item.Value, false);
                    break;

                case HistoryType.Random:
                    ShowRandomRule((int?)item.Value, false);
                    break;
                }

                /*list.UpdateLayout();
                 * ScrollViewer scrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(list, 0), 0) as ScrollViewer;
                 * scrollViewer?.ChangeView(null, item.VerticalOffset, null, true);*/
                //list.ScrollTo(item.Value, ScrollToPosition.Center, true);
                //list.SelectedItem = item.Value;

                history.RemoveAt(history.Count() - 1);
                actualHistoryItem = item;

                backButton.IsEnabled = history.Count > 0;

                HomeCommand.ChangeCanExecute();

                return(true);
            }

            return(false);
        }
Ejemplo n.º 8
0
        private void SendHomeCommand()
        {
            var validationFailure = false;

            void FailureHandler(Exception ex)
            {
                validationFailure = true;
            }

            var command = new HomeCommand(_checkSummer, _sender)
            {
                AziB = _textBoxParser.Parse(txtHomeAziB, BearingParser, FailureHandler),
                AltB = _textBoxParser.Parse(txtHomeAltB, BearingParser, FailureHandler)
            };

            if (!validationFailure)
            {
                SendCommand(command);
            }
        }
        private void Machine_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Machine.Connected) ||
                e.PropertyName == nameof(Machine.Mode))
            {
                SoftResetCommand.RaiseCanExecuteChanged();
                ClearAlarmCommand.RaiseCanExecuteChanged();
                FeedHoldCommand.RaiseCanExecuteChanged();
                CycleStartCommand.RaiseCanExecuteChanged();
                JogCommand.RaiseCanExecuteChanged();
                ResetCommand.RaiseCanExecuteChanged();
                HomeCommand.RaiseCanExecuteChanged();
                SetCameraCommand.RaiseCanExecuteChanged();
                SetTool1Command.RaiseCanExecuteChanged();

                SetToMoveHeightCommand.RaiseCanExecuteChanged();
                SetToPickHeightCommand.RaiseCanExecuteChanged();
                SetToPlaceHeightCommand.RaiseCanExecuteChanged();
                MoveToBottomCameraCommand.RaiseCanExecuteChanged();
            }

            if (e.PropertyName == nameof(Machine.ViewType))
            {
                SetCameraCommand.RaiseCanExecuteChanged();
                SetTool1Command.RaiseCanExecuteChanged();
            }

            if (e.PropertyName == nameof(Machine.Settings))
            {
                /* Keep the saved values as temp vars since updating the StepMode will overwrite */
                var originalXYStepSize = Machine.Settings.XYStepSize;
                var originalZStepSize  = Machine.Settings.ZStepSize;

                XYStepMode = Machine.Settings.XYStepMode;
                ZStepMode  = Machine.Settings.ZStepMode;

                XYStepSizeSlider = originalXYStepSize;
                ZStepSizeSlider  = originalZStepSize;
            }
        }
Ejemplo n.º 10
0
        private void PushHistoryItem(HistoryItem historyItem)
        {
            /*SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
             *  AppViewBackButtonVisibility.Visible;
             * ScrollViewer scrollViewer =
             *  VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(list, 0), 0) as ScrollViewer;
             * if (scrollViewer != null)
             *  actualSearch.VerticalOffset = scrollViewer.VerticalOffset;*/

            if (actualHistoryItem == null || historyItem == null || (!actualHistoryItem.Type.Equals(historyItem.Type) || !actualHistoryItem.Value.Equals(historyItem.Value)))
            {
                if (actualHistoryItem != null)
                {
                    history.Add(actualHistoryItem);

                    backButton.IsEnabled = true;
                }

                actualHistoryItem = historyItem;

                HomeCommand.ChangeCanExecute();
            }
        }
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     _journal = navigationContext.NavigationService.Journal;
     HomeCommand.RaiseCanExecuteChanged();
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Initalize values.
        /// </summary>
        public NavBarViewModel()
            : base("Nav")
        {
            _pm          = IoC.Get <PulseManager>();
            _events      = IoC.Get <IEventAggregator>();
            _adcpConn    = IoC.Get <AdcpConnection>();
            _IsRecording = false;
            this.NotifyOfPropertyChange(() => this.IsRecording);

            // Set the record image
            SetRecorderImage();

            // Warning timer
            _recorderTimer           = new System.Timers.Timer();
            _recorderTimer.Interval  = 2000;               // 2 seconds.
            _recorderTimer.Elapsed  += _recorderTimer_Elapsed;
            _recorderTimer.AutoReset = true;
            _recorderTimer.Start();

            // Command to go back a view
            BackCommand = ReactiveCommand.Create();
            BackCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.Back)));

            // Command to go to Home View
            HomeCommand = ReactiveCommand.Create();
            HomeCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.HomeView)));

            // Command to go to SmartPage View
            ConfigureCommand = ReactiveCommand.Create();
            ConfigureCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.SmartPageView)));

            // Command to go to ViewData View
            ViewDataCommand = ReactiveCommand.Create();
            ViewDataCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.ViewDataView)));

            //// Command to go to Playback data
            //PlaybackCommand = ReactiveCommand.Create();
            //PlaybackCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.SelectPlaybackView)));

            // Select a file to playback
            PlaybackCommand = ReactiveCommand.Create();
            PlaybackCommand.Subscribe(_ => PlaybackFile());

            // Command to go to ScreenData View
            ScreenDataCommand = ReactiveCommand.Create();
            ScreenDataCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.ScreenDataView)));

            // Command to go to Project View
            ProjectCommand = ReactiveCommand.Create();
            ProjectCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.ProjectView)));

            // Command to go to VesselMount Options View
            VmOptionsCommand = ReactiveCommand.Create();
            VmOptionsCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.VesselMountOptionsView)));

            // Command to go to Data Format View
            DataFormatCommand = ReactiveCommand.Create();
            DataFormatCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.DataFormatView)));

            // Command to go to VesselMount Options View
            AveragingCommand = ReactiveCommand.Create();
            AveragingCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.AveragingView)));

            // Set the Clock time to Local System time on the ADCP
            StartTestingCommand = ReactiveCommand.CreateAsyncTask(this.WhenAny(x => x.IsTesting, x => !x.Value),
                                                                  _ => Task.Run(() => On_StartTesting()));

            // Create a command to stop testing
            StopTestingCommand = ReactiveCommand.CreateAsyncTask(this.WhenAny(x => x.IsTesting, x => x.Value),
                                                                 _ => Task.Run(() => On_StopTesting()));
        }
Ejemplo n.º 13
0
        public ActionResult SquareResult(HomeCommand command)
        {
            var vm = Mediator.Send(command);

            return View(vm);
        }
Ejemplo n.º 14
0
	/// <summary>
	/// Processes input and handles menu interaction
	/// as per the Unity integration doc, the back button responds to "mouse 1" button down/up/etc
	/// </summary>
	void Update () {
		if ( !isVisible ) {
			if ( Input.GetKeyDown( KeyCode.Escape ) ) {
				CancelInvoke( "DelayedShowMenu" );
				if ( Time.realtimeSinceStartup < ( homeButtonDownTime + doubleTapDelay ) ) {
					// reset so the menu doesn't pop up after resetting orientation
					homeButtonDownTime = 0f;
					// reset the HMT orientation
					//OVRDevice.ResetOrientation();
				} else {
					homeButtonDownTime = Time.realtimeSinceStartup;
				}
			} else if ( Input.GetKey( KeyCode.Escape ) && ( ( Time.realtimeSinceStartup - homeButtonDownTime ) >= longPressDelay) ) {
				Debug.Log( "[PlatformUI] Showing @ " + Time.time );
				// reset so something else doesn't trigger afterwards
				Input.ResetInputAxes();
				homeButtonDownTime = 0.0f;
				CancelInvoke( "DelayedShowMenu" );
#if UNITY_ANDROID && !UNITY_EDITOR
				// show the platform UI
				OVRPluginEvent.Issue( RenderEventType.PlatformUI );
#endif
			} else if ( Input.GetKeyUp( KeyCode.Escape ) ) {
				float elapsedTime = ( Time.realtimeSinceStartup - homeButtonDownTime );
				if ( elapsedTime < longPressDelay ) {
					if ( elapsedTime >= doubleTapDelay ) {
						Show( true );
					} else {
						Invoke( "DelayedShowMenu", ( doubleTapDelay - elapsedTime ) );
					}
				}
			}
		} else if ( !isShowingOrHiding ) {
			// menu is visible, check input
			if ( Input.GetKeyDown( KeyCode.Escape ) ) {
				// back out of the menu
				Show( false );
			} else {
				// handle user gaze
				Ray ray = new Ray();
#if (UNITY_ANDROID && !UNITY_EDITOR)
				if ( cameraController.GetCameraRay( ref ray ) ) {
#else
				if ( true ) {
					// in the editor use the mouse
					Camera currentCamera = null;
					cameraController.GetCamera( ref currentCamera );
					ray = currentCamera.ScreenPointToRay( Input.mousePosition );
#endif
					// find the active button
					HomeButton lastActiveButton = activeButton;
					activeButton = null;
					RaycastHit hit = new RaycastHit();
					for ( int i = 0; i < buttons.Length; i++ ) {
						if ( buttons[i].collider.Raycast( ray, out hit, 100.0f ) ) {
							activeButton = buttons[i];
							if ( activeButton != lastActiveButton ) {
								// play highlight sound and anim
								PlaySound( menuHighlightSound );
								PlayAnim( buttons[i].name + highLightPrefix, true );
							}
							break;
						}
					}
					if ( ( activeButton == null ) && ( lastActiveButton != null ) ) {
						// return to idle anim (in our case the default anim clip)
						PlayAnim( menuIdleAnim, true );
					}
					if ( activeButton != null ) {
						// check user tap on a button
						if ( Input.GetButtonDown( selectButtonName ) ) {
							PlaySound( menuClickSound );
							float delaySecs = PlayAnim( activeButton.name + selectPrefix ) + 0.05f;
							selectedCommand = activeButton.commandId;
							// activate the menu item after the anim is done playing
							Invoke( "OnMenuItemPressed", delaySecs );
						}
					}
				}
			}
		}
	}

	/*
	-----------------------
	DelayedShowMenu()
	-----------------------
	*/
	void DelayedShowMenu() {
		Show( true );
	}

	/// <summary>
	/// Handle a home menu button press
	/// </summary>
	void OnMenuItemPressed() {
		bool immediate = false;
		switch ( selectedCommand ) {
		case HomeCommand.NewGame:
			// TODO
			break;
		case HomeCommand.Continue:
			// TODO
			break;
		case HomeCommand.Quit:
			cameraController.ReturnToLauncher();
			break;
		case HomeCommand.None:
		default:
			Debug.LogError( "Unhandled home command: " + selectedCommand );
			break;
		}
		// hide the menu
		Show ( false, immediate );
	}

	/// <summary>
	/// Handle a single press to the back button
	/// </summary>
	void OnBackButtonPressed() {
		// TODO
		Show ( false );
	}

}
Ejemplo n.º 15
0
	/// <summary>
	/// Processes input and handles menu interaction
	/// as per the Unity integration doc, the back button responds to "mouse 1" button down/up/etc
	/// </summary>
	void Update()
	{
		if (!isVisible)
		{
			if (Input.GetKeyDown(KeyCode.Escape))
			{
				CancelInvoke("DelayedShowMenu");
				if (Time.realtimeSinceStartup < (homeButtonDownTime + doubleTapDelay))
				{
					// reset so the menu doesn't pop up after resetting orientation
					homeButtonDownTime = 0f;
					// reset the HMT orientation
					//OVRManager.display.RecenterPose();
				}
				else
				{
					homeButtonDownTime = Time.realtimeSinceStartup;
				}
			}
			else if (Input.GetKey(KeyCode.Escape) && ((Time.realtimeSinceStartup - homeButtonDownTime) >= longPressDelay))
			{
				Debug.Log("[PlatformUI] Showing @ " + Time.time);
				// reset so something else doesn't trigger afterwards
				Input.ResetInputAxes();
				homeButtonDownTime = 0.0f;
				CancelInvoke("DelayedShowMenu");

				OVRManager.PlatformUIGlobalMenu();
			}
			else if (Input.GetKeyUp(KeyCode.Escape))
			{
				float elapsedTime = (Time.realtimeSinceStartup - homeButtonDownTime);
				if (elapsedTime < longPressDelay)
				{
					if (elapsedTime >= doubleTapDelay)
					{
						Show(true);
					}
					else
					{
						Invoke("DelayedShowMenu", (doubleTapDelay - elapsedTime));
					}
				}
			}
		}
		else if (!isShowingOrHiding)
		{
			// menu is visible, check input
			if (Input.GetKeyDown(KeyCode.Escape))
			{
				// back out of the menu
				Show(false);
			}
			else
			{
				// handle user gaze
				Ray ray = new Ray(cameraController.centerEyeAnchor.position, cameraController.centerEyeAnchor.forward);

				// find the active button
				HomeButton lastActiveButton = activeButton;
				activeButton = null;
				RaycastHit hit = new RaycastHit();
				for (int i = 0; i < buttons.Length; i++)
				{
					if (buttons[i].GetComponent<Collider>().Raycast(ray, out hit, 100.0f))
					{
						activeButton = buttons[i];
						if (activeButton != lastActiveButton)
						{
							// play highlight sound and anim
							PlaySound(menuHighlightSound);
							PlayAnim(buttons[i].name + highLightPrefix, true);
						}
						break;
					}
				}
				if ((activeButton == null) && (lastActiveButton != null))
				{
					// return to idle anim (in our case the default anim clip)
					PlayAnim(menuIdleAnim, true);
				}
				if (activeButton != null)
				{
					// check user tap on a button
					if (Input.GetButtonDown(selectButtonName))
					{
						PlaySound(menuClickSound);
						float delaySecs = PlayAnim(activeButton.name + selectPrefix) + 0.05f;
						selectedCommand = activeButton.commandId;
						// activate the menu item after the anim is done playing
						Invoke("OnMenuItemPressed", delaySecs);
					}
				}
			}
		}
	}
Ejemplo n.º 16
0
    /// <summary>
    /// Processes input and handles menu interaction
    /// as per the Unity integration doc, the back button responds to "mouse 1" button down/up/etc
    /// </summary>
    void Update()
    {
        if (!isVisible)
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                CancelInvoke("DelayedShowMenu");
                if (Time.realtimeSinceStartup < (homeButtonDownTime + doubleTapDelay))
                {
                    // reset so the menu doesn't pop up after resetting orientation
                    homeButtonDownTime = 0f;
                    // reset the HMT orientation
                    //OVRManager.display.RecenterPose();
                }
                else
                {
                    homeButtonDownTime = Time.realtimeSinceStartup;
                }
            }
            else if (Input.GetKey(KeyCode.Escape) && ((Time.realtimeSinceStartup - homeButtonDownTime) >= longPressDelay))
            {
                Debug.Log("[PlatformUI] Showing @ " + Time.time);
                // reset so something else doesn't trigger afterwards
                Input.ResetInputAxes();
                homeButtonDownTime = 0.0f;
                CancelInvoke("DelayedShowMenu");

                OVRManager.PlatformUIGlobalMenu();
            }
            else if (Input.GetKeyUp(KeyCode.Escape))
            {
                float elapsedTime = (Time.realtimeSinceStartup - homeButtonDownTime);
                if (elapsedTime < longPressDelay)
                {
                    if (elapsedTime >= doubleTapDelay)
                    {
                        Show(true);
                    }
                    else
                    {
                        Invoke("DelayedShowMenu", (doubleTapDelay - elapsedTime));
                    }
                }
            }
        }
        else if (!isShowingOrHiding)
        {
            // menu is visible, check input
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                // back out of the menu
                Show(false);
            }
            else
            {
                // handle user gaze
                Ray ray = new Ray(cameraController.centerEyeAnchor.position, cameraController.centerEyeAnchor.forward);

                // find the active button
                HomeButton lastActiveButton = activeButton;
                activeButton = null;
                RaycastHit hit = new RaycastHit();
                for (int i = 0; i < buttons.Length; i++)
                {
                    if (buttons[i].GetComponent <Collider>().Raycast(ray, out hit, 100.0f))
                    {
                        activeButton = buttons[i];
                        if (activeButton != lastActiveButton)
                        {
                            // play highlight sound and anim
                            PlaySound(menuHighlightSound);
                            PlayAnim(buttons[i].name + highLightPrefix, true);
                        }
                        break;
                    }
                }
                if ((activeButton == null) && (lastActiveButton != null))
                {
                    // return to idle anim (in our case the default anim clip)
                    PlayAnim(menuIdleAnim, true);
                }
                if (activeButton != null)
                {
                    // check user tap on a button
                    if (Input.GetButtonDown(selectButtonName))
                    {
                        PlaySound(menuClickSound);
                        float delaySecs = PlayAnim(activeButton.name + selectPrefix) + 0.05f;
                        selectedCommand = activeButton.commandId;
                        // activate the menu item after the anim is done playing
                        Invoke("OnMenuItemPressed", delaySecs);
                    }
                }
            }
        }
    }
Ejemplo n.º 17
0
    /// <summary>
    /// Processes input and handles menu interaction
    /// as per the Unity integration doc, the back button responds to "mouse 1" button down/up/etc
    /// </summary>
    void Update()
    {
        if (!isVisible)
        {
            //habilito el menu desde el momento de inicio.
            Show (true);

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Debug.Log ("ESCAPE");
                CancelInvoke("DelayedShowMenu");
                if (Time.realtimeSinceStartup < (homeButtonDownTime + doubleTapDelay))
                {
                    // reset so the menu doesn't pop up after resetting orientation
                    homeButtonDownTime = 0f;
                    // reset the HMT orientation
                    //OVRManager.display.RecenterPose();
                }
                else
                {
                    homeButtonDownTime = Time.realtimeSinceStartup;
                }
            }
            else if (Input.GetKey(KeyCode.Escape) && ((Time.realtimeSinceStartup - homeButtonDownTime) >= longPressDelay))
            {
                Debug.Log("[PlatformUI] Showing @ " + Time.time);
                // reset so something else doesn't trigger afterwards
                Input.ResetInputAxes();
                homeButtonDownTime = 0.0f;
                CancelInvoke("DelayedShowMenu");
                #if UNITY_ANDROID && !UNITY_EDITOR
                // show the platform UI
                OVRPluginEvent.Issue(RenderEventType.PlatformUI);
                #endif
            }
            else if (Input.GetKeyUp(KeyCode.Escape))
            {
                float elapsedTime = (Time.realtimeSinceStartup - homeButtonDownTime);
                if (elapsedTime < longPressDelay)
                {
                    if (elapsedTime >= doubleTapDelay)
                    {
                        Show(true);
                    }
                    else
                    {
                        Invoke("DelayedShowMenu", (doubleTapDelay - elapsedTime));
                    }
                }
            }
        }
        else if (!isShowingOrHiding)
        {
            // menu is visible, check input
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                // back out of the menu
                Show(false);
            }
            else
            {
                // handle user gaze
                Ray ray = new Ray(cameraController.centerEyeAnchor.position, cameraController.centerEyeAnchor.forward);

                // find the active button
                HomeButton lastActiveButton = activeButton;
                activeButton = null;
                RaycastHit hit = new RaycastHit();
                for (int i = 0; i < buttons.Length; i++)
                {
                    if (buttons[i].GetComponent<Collider>().Raycast(ray, out hit, 100.0f))
                    {
                        activeButton = buttons[i];
                        if (activeButton != lastActiveButton)
                        {
                            // play highlight sound and anim
                            PlaySound(menuHighlightSound);
                            //PlayAnim(buttons[i].name + highLightPrefix, true);
                            //GameObject.Find ("highlight_01");

                            Debug.Log("Click en  el boton" + buttons[i]);

                            if (activeButton == buttons[0]) {

                                //myObject.GetComponent<MyScript>().MyFunction();
                                Debug.Log ("le doy play al video");
                                videoscript = buttons[i].transform.FindChild("MovieSurface").gameObject;
                                videoscript.GetComponent<MoviePlayerSample>().DelayedStartVideo();
                            }
                        }
                        break;
                    }
                }
                if ((activeButton == null) && (lastActiveButton != null))
                {
                    // return to idle anim (in our case the default anim clip)
                    //PlayAnim(menuIdleAnim, true);
                    //dejo de hacer foco en el boton
                    Debug.Log("Pongo en pausa");
                    videoscript.GetComponent<MoviePlayerSample>().videoPause();
                }
                if (activeButton != null)
                {
                    // check user tap on a button
                    if (Input.GetButtonDown(selectButtonName))
                    {
                        PlaySound(menuClickSound);
                        float delaySecs = PlayAnim(activeButton.name + selectPrefix) + 0.05f;
                        selectedCommand = activeButton.commandId;
                        // activate the menu item after the anim is done playing
                        Invoke("OnMenuItemPressed", delaySecs);
                    }
                }
            }
        }
    }