コード例 #1
0
ファイル: TestSceneBackButton.cs プロジェクト: Wieku/osu
        public TestSceneBackButton()
        {
            BackButton button;

            BackButton.Receptor receptor = new BackButton.Receptor();

            Child = new Container
            {
                Anchor   = Anchor.Centre,
                Origin   = Anchor.Centre,
                Size     = new Vector2(300),
                Masking  = true,
                Children = new Drawable[]
                {
                    receptor,
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4.SlateGray
                    },
                    button = new BackButton(receptor)
                    {
                        Anchor = Anchor.BottomLeft,
                        Origin = Anchor.BottomLeft,
                    }
                }
            };

            button.Action = () => button.Hide();

            AddStep("show button", () => button.Show());
            AddStep("hide button", () => button.Hide());
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Haurum/P2
 // Går tilbage til visning af hele løbet i tabellen
 private void BackButton_Click(object sender, EventArgs e)
 {
     headers--;
     isLeg = false;
     Put_Data(MainLeg);
     BackButton.Hide();
 }
コード例 #3
0
 protected void Back()
 {
     NameLabel.Hide();
     NameBox.Hide();
     NameBox.Text = "";
     TypeLabeld.Hide();
     Typebox.Hide();
     OwnerLabel.Hide();
     OwnerBox.Hide();
     OwnerBox.Text = "";
     AddButton.Show();
     ViewButton.Show();
     BackButton.Hide();
     DoneButton.Hide();
     ScreenLabel.Hide();
     ScreenSpin.Hide();
     ScreenSpin.Text = "0";
     CatLabel.Hide();
     CatBox.Hide();
     ExcLabel.Hide();
     ExTablesButton.Hide();
     ExTablesButton.Active = false;
     HoursLabel.Hide();
     HoursBox.Hide();
     HoursBox.Text = "";
 }
コード例 #4
0
ファイル: TicTacToePage.cs プロジェクト: emactaggart/CS476
 public TicTacToePage()
 {
     InitializeComponent();
     _state = new BasicObserver <MatchState>();
     BackButton.Hide();
     _gameOver = false;
 }
コード例 #5
0
        public string getExcuse()
        {
            string hereItIs   = "";
            int    numExcuses = Settings.Default.ExcuseList.Count;
            int    indx       = rand.Next(0, numExcuses);
            bool   allSeen    = checkAllSeenExcuses();

            if (allSeen)
            {
                ExcuseText.Hide();
                RestartExcuses.Show();
                ExcuseNotification.Text = "You've seen all the excuses!";
                ExcuseButton.Hide();
                SendToEmail.Hide();
                CopyButton.Hide();
                BackButton.Hide();
                ForwardButton.Hide();
            }
            else
            {
                if (Settings.Default.ExcuseSeen[indx] == "0")
                {
                    hereItIs = Settings.Default.ExcuseList[indx].ToString();
                }
                else
                {
                    hereItIs = findNextUnseenExcuse();
                }

                Settings.Default.CurrentExcuse    = indx;
                Settings.Default.ExcuseSeen[indx] = "1";
                Settings.Default.Save();
            }
            return(hereItIs);
        }
コード例 #6
0
 private void RefreshButton_Click(object sender, EventArgs e)
 {
     nested = 0;
     BackButton.Hide();
     CancelButton.Hide();
     DetailsButton.Show();
     this.RefreshUsers();
 }
コード例 #7
0
        public UsersPanel(ServerManager server)
        {
            InitializeComponent();
            myServer    = server;
            this.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));

            BackButton.Hide();
            CancelButton.Hide();
        }
コード例 #8
0
 public Scoreboard()
 {
     InitializeComponent();
     pictureBoxes[0] = pictureBoxHusidman;
     pictureBoxes[1] = pictureBoxYeruham;
     pictureBoxes[2] = pictureBoxOrt;
     if (Global.whoPlay[0] && Global.whoPlay[1] && Global.whoPlay[2])
     {
         this.BackgroundImage = score.Properties.Resources.ניקוד_סופי;
         BackButton.Hide();
     }
     showScore();
 }
コード例 #9
0
 private void RestartExcuses_Click(object sender, EventArgs e)
 {
     resetSeenExcuses();
     RestartExcuses.Hide();
     ExcuseText.Show();
     ExcuseButton.Show();
     BackButton.Hide();
     ForwardButton.Hide();
     ExcuseNotification.Text = "";
     ExcuseText.Text         = "Excuses Ahead...";
     BackBox.Items.Clear();
     ForwardBox.Items.Clear();
     BackBox.EndUpdate();
     ForwardBox.EndUpdate();
     Count = 0;
     Settings.Default.CurrentExcuse = 0;
     Settings.Default.Save();
 }
コード例 #10
0
 //Hides Converter Menu
 private void HideConverter()
 {
     CategoryLabel.Hide();
     CategoryComboBox.Hide();
     InstructionLabel.Hide();
     ValueOfLabel.Hide();
     UserInputTextBox.Hide();
     FromLabel.Hide();
     InitialUnitsComboBox.Hide();
     ToLabel.Hide();
     ResultingUnitsComboBox.Hide();
     ConvertSubmissionButton.Hide();
     BackButtonLabel.Hide();
     BackButton.Hide();
     DividerLabel.Hide();
     InitialValueLabel.Hide();
     InitialUnitsLabel.Hide();
     EqualsLabel.Hide();
     ResultingUnitsLabel.Hide();
     ResultingValueLabel.Hide();
     //When navigating back to the main menu its important to clear the field values for the ComboBoxes
     ClearUnitsComboBoxes();
 }
コード例 #11
0
        protected virtual void ScreenChanged(IScreen current, IScreen newScreen)
        {
            switch (newScreen)
            {
            case IntroScreen intro:
                introScreen = intro;
                break;

            case MainMenu menu:
                menuScreen = menu;
                break;
            }

            if (newScreen is IOsuScreen newOsuScreen)
            {
                OverlayActivationMode.Value = newOsuScreen.InitialOverlayActivationMode;

                if (newOsuScreen.HideOverlaysOnEnter)
                {
                    CloseAllOverlays();
                }
                else
                {
                    Toolbar.Show();
                }

                if (newOsuScreen.AllowBackButton)
                {
                    BackButton.Show();
                }
                else
                {
                    BackButton.Hide();
                }
            }
        }
コード例 #12
0
 private void ResetExcuses_Click(object sender, EventArgs e)
 {
     RestartExcuses.Hide();
     ExcuseText.Show();
     ExcuseButton.Show();
     BackButton.Hide();
     ForwardButton.Hide();
     CopyButton.Hide();
     SendToEmail.Hide();
     ExcuseNotification.Text = "";
     ExcuseText.Text         = "Excuses Ahead...";
     BackBox.Items.Clear();
     ForwardBox.Items.Clear();
     BackBox.EndUpdate();
     ForwardBox.EndUpdate();
     Count = 0;
     Settings.Default.CurrentExcuse = 0;
     for (int i = 0; i < Settings.Default.ExcuseSeen.Count; i++)
     {
         Settings.Default.ExcuseSeen[i] = "0";
         Settings.Default.Save();
     }
     Settings.Default.Save();
 }
コード例 #13
0
        /// <summary>
        ///     Realiza la navegación al siguiente Panel T, transmitiéndole información
        ///     para su inicialización.
        /// </summary>
        /// <typeparam name="T">Tipo del Panel.</typeparam>
        /// <param name="data">Información a enviar al Panel durante su inicialización.</param>
        /// <returns>Devuelve la instancia del nuevo Panel, ya inicializado.</returns>
        public T NextPanel <T>() where T : UserControl
        {
            // Revisar si es necesaio un Invoke.
            if (InvokeRequired)
            {
                return((T)Invoke(
                           new Func <UserControl>(() => NextPanel <T>())
                           ));
            }

            UserControl nextPanel    = null;
            UserControl currentPanel = null;

            var initializePanel    = false;
            var hidePreviousButton = false;

            if (m_currentPanelNode == null || m_currentPanelNode.Value == null)
            {
                // Insertar el nuevo Panel como primer elemento de la lista.
                nextPanel          = Activator.CreateInstance <T>() as UserControl;
                m_currentPanelNode = m_panelHistory.AddFirst(nextPanel);
                initializePanel    = true;
                hidePreviousButton = true;
            }
            else
            {
                currentPanel = m_currentPanelNode.Value;

                if (m_currentPanelNode.Next == null || m_currentPanelNode.Next.Value == null || !(m_currentPanelNode.Next.Value is T))
                {
                    // Insertar el nuevo Panel como el siguiente del Panel actual.
                    nextPanel          = Activator.CreateInstance <T>() as UserControl;
                    m_currentPanelNode = m_panelHistory.AddAfter(m_currentPanelNode, nextPanel);
                    initializePanel    = true;
                }
                else
                {
                    // Navegar al siguiente Panel que ya se encuentra en memoria.
                    m_currentPanelNode = m_currentPanelNode.Next;
                    nextPanel          = m_currentPanelNode.Value;
                }
            }

            Trace.WriteLine("Panel switch [>] " + nextPanel.ToString());

            // Mostrar u ocultar el botón Atrás según sea necesario.
            if (nextPanel is Panels.IPanelNoBackButton || hidePreviousButton)
            {
                BackButton.Hide();
            }
            else
            {
                BackButton.Show();
            }

            // Preparar las animaciones de los Paneles.
            nextPanel.Parent  = MainPanel;
            nextPanel.Top     = 0;
            nextPanel.Left    = nextPanel.Width + 30;
            nextPanel.Enabled = true;
            nextPanel.CreateControl();
            nextPanel.Show();
            nextPanel.BringToFront();

            var animateNext = new EventHandler((Object s1, EventArgs e1) => {
                MainPanel.StopAnimation("Height", "Width");

                if (nextPanel.Width != MainPanel.Width)
                {
                    MainPanel.AnimateProperty <Animation.EaseInOutBack>("Width", nextPanel.Width);
                }

                MainPanel.AnimateProperty <Animation.EaseInOutBack>("Height", nextPanel.Height).AnimationFinished +=
                    (Object s2, EventArgs e2) => {
                    nextPanel.AnimateProperty <Animation.EaseInOutElastic>("Left", 0).AnimationFinished +=
                        (Object s3, EventArgs e3) => {
                        // Inicializar el siguiente Panel si es necesario.
                        if (initializePanel)
                        {
                            nextPanel.SizeChanged += Panel_SizeChanged;
                        }
                        if (initializePanel && nextPanel is Panels.IPanelInitialize)
                        {
                            (nextPanel as Panels.IPanelInitialize).Initialize();
                        }

                        // Ejecutar el evento de navegación en el Panel anterior.
                        if (currentPanel is Panels.IPanelNextEvent)
                        {
                            (currentPanel as Panels.IPanelNextEvent).OnNextPanelNavigation();
                        }
                    };
                };
            });

            if (currentPanel == null)
            {
                animateNext(null, null);
            }
            else
            {
                var animator = currentPanel.GetCurrentAnimator("Left");
                currentPanel.Enabled = false;
                nextPanel.Left       = (currentPanel.Left > 0 ? CurrentPanel.Left : 0) + currentPanel.Width + 30;

                if (animator == null)
                {
                    animator = currentPanel.AnimateProperty <Animation.EaseInOutElastic>("Left", -currentPanel.Width);
                    animator.AnimationFinished += animateNext;
                }
                else
                {
                    animator.AnimationFinished += (Object s2, EventArgs e2) =>
                                                  currentPanel.AnimateProperty <Animation.EaseInOutElastic>("Left", -currentPanel.Width).AnimationFinished +=
                        animateNext;
                }
            }

            return((T)nextPanel);
        }
コード例 #14
0
        /// <summary>
        ///     Realiza la navegación al Panel anterior.
        /// </summary>
        /// <returns>Devuelve la instancia del Panel anterior.</returns>
        public UserControl PreviousPanel()
        {
            // Revisar si es necesaio un Invoke.
            if (InvokeRequired)
            {
                return((UserControl)Invoke(
                           new Func <UserControl>(() => PreviousPanel())
                           ));
            }

            if (m_currentPanelNode == null || m_currentPanelNode.Value == null)
            {
                throw new InvalidOperationException("There is exactly NO f*****g panels in history.");
            }

            if (m_currentPanelNode.Previous == null || m_currentPanelNode.Previous.Value == null)
            {
                throw new InvalidOperationException("There is no panel to go back to.");
            }

            UserControl currentPanel  = m_currentPanelNode.Value;
            UserControl previousPanel = m_currentPanelNode.Previous.Value;

            m_currentPanelNode = m_currentPanelNode.Previous;

            Trace.WriteLine("Panel switch [<] " + previousPanel.ToString());

            // Mostrar u ocultar el botón Atrás según sea necesario.
            if (previousPanel is Panels.IPanelNoBackButton || m_currentPanelNode.Previous == null)
            {
                BackButton.Hide();
            }
            else
            {
                BackButton.Show();
            }

            // Preparar las animaciones de los Paneles.
            previousPanel.Left    = -previousPanel.Width;
            previousPanel.Enabled = true;
            previousPanel.CreateControl();
            previousPanel.Show();
            previousPanel.BringToFront();

            currentPanel.Enabled = false;

            var animateNext = new EventHandler((Object s1, EventArgs e1) => {
                MainPanel.StopAnimation("Height", "Width");
                MainPanel.AnimateProperty <Animation.EaseInOutBack>("Width", previousPanel.Width);
                MainPanel.AnimateProperty <Animation.EaseInOutBack>("Height", previousPanel.Height).AnimationFinished +=
                    (Object s2, EventArgs e2) => {
                    previousPanel.AnimateProperty <Animation.EaseInOutElastic>("Left", 0).AnimationFinished +=
                        (Object s3, EventArgs e3) => {
                        // Ejecutar el evento de navegación en el Panel anterior.
                        if (currentPanel is Panels.IPanelPreviousEvent)
                        {
                            (currentPanel as Panels.IPanelPreviousEvent).OnPreviousPanelNavigation();
                        }
                    };
                };
            });

            var animator           = currentPanel.GetCurrentAnimator("Left");
            var currentPanelOffset = (currentPanel.Width > previousPanel.Width ? currentPanel.Width : previousPanel.Width) + 30;

            if (animator == null)
            {
                animator = currentPanel.AnimateProperty <Animation.EaseInOutElastic>("Left", currentPanelOffset);
                animator.AnimationFinished += animateNext;
            }
            else
            {
                animator.AnimationFinished += (Object s2, EventArgs e2) =>
                                              currentPanel.AnimateProperty <Animation.EaseInOutElastic>("Left", currentPanelOffset).AnimationFinished +=
                    animateNext;
            }

            return(previousPanel);
        }