Ejemplo n.º 1
0
        private void MessageSuperClick(object sender, RoutedEventArgs e)
        {
            var messagePrompt = new MessagePrompt
            {
                Title      = "Advanced Message",
                Background = _naturalBlueSolidColorBrush,
                Foreground = _aliceBlueSolidColorBrush,
                Overlay    = _cornFlowerBlueSolidColorBrush,
            };

            var btnHide = new RoundButton {
                Content = "Hide"
            };

            btnHide.Click += (o, args) => messagePrompt.Hide();

            var btnComplete = new RoundButton {
                Content = "Complete"
            };

            btnComplete.Click += (o, args) => messagePrompt.OnCompleted(new PopUpEventArgs <string, PopUpResult> {
                PopUpResult = PopUpResult.Ok, Result = "You clicked the Complete Button"
            });

            messagePrompt.ActionPopUpButtons.Clear();
            messagePrompt.ActionPopUpButtons.Add(btnHide);
            messagePrompt.ActionPopUpButtons.Add(btnComplete);

            messagePrompt.Completed += PopUpPromptStringCompleted;

            messagePrompt.Show();
        }
Ejemplo n.º 2
0
        internal static void ButtonPic_Click(object sender, EventArgs e, RoundButton buttonPic, string file, TrackBar elapsedBar)
        {
            System.Windows.Forms.Timer audioTimer = new System.Windows.Forms.Timer();
            audioTimer.Interval = 100;
            audioTimer.Tick    += (sendere, ee) => AudioTimer_Tick(sender, e, elapsedBar, audioTimer, buttonPic);

            if (waveOut.PlaybackState != PlaybackState.Playing || waveOut == null)
            {
                PlayAudioBubble(file);
                Thread.Sleep(200);
                audioTimer.Start();
            }
            else if (waveOut.PlaybackState == PlaybackState.Playing || waveOut != null)
            {
                waveOut.Pause();
                audioTimer.Stop();
            }
            else if (file != nowPlaying)
            {
                waveOut.Dispose();
                audioTimer.Stop();
                PlayAudioBubble(file);
                Thread.Sleep(200);
                audioTimer.Start();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 生成Button
        /// </summary>
        /// <param name="parentControl"></param>
        /// <param name="text"></param>
        /// <param name="width"></param>
        /// <returns></returns>
        public Button CreateActionBtn(Control parentControl, string text, int width = 0, bool isRound = false)
        {
            var currentWidth = width;

            if (currentWidth == 0)
            {
                currentWidth = parentControl.Width;
            }

            var foreColor = Color.WhiteSmoke;

            var backColor = Color.Black;

            var btn = new Button()
            {
                Text = text, ForeColor = foreColor, BackColor = backColor, Width = currentWidth, FlatStyle = FlatStyle.Flat, FlatAppearance = { BorderSize = 0 }
            };


            ///圆角button
            if (isRound)
            {
                btn = new RoundButton()
                {
                    Text = text, Width = currentWidth, FlatStyle = FlatStyle.Flat, FlatAppearance = { BorderSize = 0 }
                };
            }

            parentControl.Controls.Add(btn);

            return(btn);
        }
Ejemplo n.º 4
0
        private void SetLed(int total, int num, int r, Panel panel, string group)
        {

            int centerX = (int)(panel.Width * 0.5);
            int centerY = (int)(panel.Height * 0.5);

            RoundButton led = new RoundButton();

            double angel = 2.0 / total * Math.PI * (num + 1) - Math.PI * 0.5;

            led.Height = 30;
            led.Width = 30;

            int block = int.Parse(panel.Name.Substring(5));
            led.Name = ((block - 1) * 10 + num).ToString();
            led.Tag = group + block + num;
            SetLedlocation(led, centerX, centerY, r);
            led.Click += led_Click;

            Label label = new Label();
            label.AutoSize = true;
            label.Text = group + block + num;
            label.Font = new System.Drawing.Font("Arial", 9.0F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            
            SetLabellocation(label, centerX, centerY, r);
            panel.Controls.Add(led);
            panel.Controls.Add(label);

            leds.Add((block - 1) * 10 + num, led);
        }
Ejemplo n.º 5
0
 private void SetLedlocation(RoundButton led, int centerX, int centerY, int rDistance)
 {
     string name = led.Name;
     int num = int.Parse(name.Substring(name.Length - 1, 1));
     double angel = 2.0 / _bloclNum * Math.PI * (num + 1) - Math.PI * 1.2;
     led.Location = new Point(centerX + (int)(Math.Cos(angel) * rDistance) - 15, centerY + (int)(Math.Sin(angel) * rDistance) - 15);
 }
Ejemplo n.º 6
0
        private void SetSquare(Panel panel)
        {
            int centerX = (int)(panel.Width * 0.5);
            int centerY = (int)(panel.Height * 0.5);
            //int centerX = 85;
            //int centerY = 95;
            RoundButton led = new RoundButton();
            // led.LedStyle = LedStyle.Square3D;
            led.Height = 30;
            led.Width = 30;

            led.Location = new Point(centerX - 15, centerY - 15);
            //led.InteractionMode = BooleanInteractionMode.Indicator;
            int block = int.Parse(panel.Name.Substring(5));
            //led.Name = (80 + block - 1).ToString();
            panel.Controls.Add(led);

            Label label=new Label();
            label.AutoSize = true;
            label.Text = "S"+block;
            label.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            label.Location = new Point(centerX - 5, centerY -25);
            label.Location = new Point(0, 0);
            label.ForeColor = Color.Crimson;
            panel.Controls.Add(label);
            
            led.Anchor = AnchorStyles.None;
            leds.Add(80 + block - 1, led);

        }
Ejemplo n.º 7
0
        private void CreateDynamicButton()  // Đặt ở View
        {
            x    = new int[] { 896, 882, 890, 905, 695, 588, 695 };
            y    = new int[] { 202, 32, 300, 390, 510, 347, 470 };
            size = new int[] { 20, 15, 15, 20, 15, 20, 15 };
            pictureBox1.Controls.Clear();

            for (int i = 0; i < x.Length; i++)
            {
                RoundButton dynamicButton = new RoundButton();
                if (trackBar1.Value == 0)
                {
                    dynamicButton.Height   = size[i];
                    dynamicButton.Width    = size[i];
                    dynamicButton.Location = new Point(x[i] - dynamicButton.Width / 2, y[i] - dynamicButton.Width / 2);
                }
                else
                {
                    dynamicButton.Location = new Point((x[i] - size[i] / 2 - dynamicButton.Width / 2) * trackBar1.Value, (y[i] - size[i] / 2 - dynamicButton.Height / 2) * trackBar1.Value);
                    dynamicButton.Height   = size[i] * trackBar1.Value;
                    dynamicButton.Width    = size[i] * trackBar1.Value;
                }
                dynamicButton.BackColor = Color.Aqua;
                dynamicButton.Text      = BLL_DoAn.Instance.text[i];
                dynamicButton.Click    += new EventHandler(roundButton1_Click);
                pictureBox1.Controls.Add(dynamicButton);
            }
        }
Ejemplo n.º 8
0
    public void setRounds(char value)
    {
        RoundButton lastActive = GameObject.Find("Setup-Rounds" + sTheGameState.BestOf + "Button").GetComponent <RoundButton>();

        lastActive.Deactivate();
        sTheGameState.BestOf = (int)(value) - 48;
    }
Ejemplo n.º 9
0
        private void btnNews_Click(object sender, RoutedEventArgs e)
        {
            RoundButton btn = sender as RoundButton;

            if (btn != null)
            {
                btn.Background = Application.Current.Resources["PhoneAccentBrush"] as SolidColorBrush;
                switch (btn.Name)
                {
                case "btnNews":
                    this.btnBlogs.Background    = new SolidColorBrush(Colors.Black);
                    this.btnHotBlogs.Background = new SolidColorBrush(Colors.Black);
                    this.newsList.NewsType      = Controls.NewsType.News;
                    this.lblTitleNews.Text      = "资讯";
                    break;

                case "btnBlogs":
                    this.btnNews.Background     = new SolidColorBrush(Colors.Black);
                    this.btnHotBlogs.Background = new SolidColorBrush(Colors.Black);
                    this.newsList.NewsType      = Controls.NewsType.Blogs;
                    this.lblTitleNews.Text      = "博客";
                    break;

                case "btnHotBlogs":
                    this.btnNews.Background  = new SolidColorBrush(Colors.Black);
                    this.btnBlogs.Background = new SolidColorBrush(Colors.Black);
                    this.newsList.NewsType   = Controls.NewsType.RecommendBlogs;
                    this.lblTitleNews.Text   = "推荐";
                    break;
                }
            }
        }
Ejemplo n.º 10
0
        public void SwitchWnd(RoundButton btn)
        {
            if (m_currentButton != btn)
            {
                if (null == m_currentButton)
                {
                    m_currentButton           = RoundButton_Login;
                    m_currentButton.BaseColor = m_currentButton.BaseColorEnd = Color.FromArgb(160, 72, 160);
                }

                m_lastButton = m_currentButton;

                if (m_currentButton != null)
                {
                    m_currentButton.BaseColor = m_currentButton.BaseColorEnd = Color.MediumAquamarine;
                }

                m_currentButton = btn;

                m_currentButton.BaseColor = m_currentButton.BaseColorEnd = Color.FromArgb(160, 72, 160);

                if (m_currentForm != null)
                {
                    m_currentForm.Hide();
                }

                if (m_currentForm != m_dicForm[btn])
                {
                    m_currentForm = m_dicForm[btn];
                    m_currentForm.Show();
                }
            }
        }
        private void MessageSuperClick(object sender, RoutedEventArgs e)
        {
            InitializePrompt();

            _prompt.Title      = "Advanced Message";
            _prompt.Background = _naturalBlueSolidColorBrush;
            _prompt.Foreground = _aliceBlueSolidColorBrush;
            _prompt.Overlay    = _cornFlowerBlueSolidColorBrush;

            var btnHide = new RoundButton {
                Label = "Hide"
            };

            btnHide.Click += (o, args) => _prompt.Hide();

            var btnComplete = new RoundButton {
                Label = "Complete"
            };

            btnComplete.Click += (o, args) => _prompt.OnCompleted(new PopUpEventArgs <string, PopUpResult> {
                PopUpResult = PopUpResult.Ok, Result = "You clicked the Complete Button"
            });

            _prompt.ActionPopUpButtons.Clear();
            _prompt.ActionPopUpButtons.Add(btnHide);
            _prompt.ActionPopUpButtons.Add(btnComplete);

            _prompt.Show();
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 水井焦点事件
        /// </summary>
        /// <param name="Sender"></param>
        /// <param name="e"></param>
        private void WaterWellBtn_Focus(object Sender, RoutedEventArgs e)
        {
            RoundButton rb = e.Source as RoundButton;

            action = delegate(string i) { ChangeColor(i); };
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ApplicationIdle, action, rb.Uid);
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            passwordBox = GetTemplateChild("passwordBox") as PasswordBox;
            if (passwordBox != null)
            {
                passwordBox.KeyUp += (sender, args) =>
                {
                    if (args.Key == Key.Enter)
                    {
                        DoLogin();
                    }
                };
            }

            loginButton = GetTemplateChild("loginButton") as RoundButton;
            if (loginButton != null)
            {
                loginButton.Click += (sender, args) => DoLogin();
            }

            checkBox = GetTemplateChild("chbxSaveUser") as CheckBox;
            if (checkBox != null)
            {
                checkBox.Tap += (sender, args) =>
                {
                    checkboxTapped = true;
                };
            }
        }
Ejemplo n.º 14
0
        private void DrawLines()
        {
            for (int i = 0; i < 10; i++)
            {
                LineOfPegs line = new LineOfPegs(i);
                for (int j = 0; j < 4; j++)
                {
                    RoundButton roundButton = new RoundButton();
                    roundButton.Location  = new Point(40 + 60 * j, 20 + 40 * i);
                    roundButton.Height    = 40;
                    roundButton.Width     = 40;
                    roundButton.BackColor = Color.LightGray;
                    roundButton.Show();
                    roundButton.MouseDown += new MouseEventHandler(RoundButton_Click);
                    Controls.Add(roundButton);
                    line.Attach(roundButton);
                }

                if (i == 0)
                {
                    line.IsActive = true;
                    line.Notify();
                }
                lines.Add(line);
            }
        }
Ejemplo n.º 15
0
        public void GetPhoto(GetPhotoCallback callback)
        {
            this.getPhotoCallback = callback;
            MessagePrompt questionMessage = new MessagePrompt();

            questionMessage.Title = "Choose source:";
            SelectPhotoDialog dialogContent = new SelectPhotoDialog();

            dialogContent.TakePhotoCommand = new DelegateCommand((o) =>
            {
                questionMessage.Hide();
                this.photoCameraCapture.Show();
            });
            dialogContent.ChosePhotoCommand = new DelegateCommand((o) =>
            {
                questionMessage.Hide();
                this.photoChooserTask.Show();
            });
            dialogContent.RandomPhotoCommand = new DelegateCommand((o) =>
            {
                questionMessage.Hide();
                callback(null);
            });
            questionMessage.Body = dialogContent;
            RoundButton cancelButton = new RoundButton();

            cancelButton.ImageSource = new BitmapImage(new Uri("/Resources/icons/appbar.stop.rest.png", UriKind.Relative));
            cancelButton.Click      += (sender, args) =>
            {
                questionMessage.Hide();
            };
            questionMessage.ActionPopUpButtons.Clear();
            questionMessage.ActionPopUpButtons.Add(cancelButton);
            questionMessage.Show();
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 油井点
        /// </summary>
        /// <returns></returns>
        private RoundButton OilWellPoint()
        {
            RoundButton roundButton = new RoundButton();

            roundButton.EllipseDiameter = 15;
            roundButton.FillColor       = Brushes.Black;
            return(roundButton);
        }
Ejemplo n.º 17
0
        private void roundButton1_Click(object sender, EventArgs e)    // Đặt ở View
        {
            RoundButton btn = sender as RoundButton;
            string      s   = btn.Text;
            Form2       f   = new Form2(s, BLL_DoAn.Instance.g.pathNode);

            f.Show();
        }
Ejemplo n.º 18
0
        private void AdjacentBtn_MouseDown(object sender, MouseEventArgs e)
        {
            RoundButton roundBtn = (RoundButton)sender;

            ShowRGB      = roundBtn.RGB;
            CNCSNum.Text = Tool.AuxiliaryAPI.RGB2xyz(tempRGB);
            ShowPanel.Refresh();
        }
Ejemplo n.º 19
0
    public RoundButtonDemo()
    {
        Text         = "RoundButton Demonstration";
        Font         = new Font("Times New Roman", 18);
        AutoSize     = true;
        AutoSizeMode = AutoSizeMode.GrowAndShrink;

        FlowLayoutPanel flow = new FlowLayoutPanel();

        flow.Parent        = this;
        flow.AutoSize      = true;
        flow.FlowDirection = FlowDirection.TopDown;

        FlowLayoutPanel flowTop = new FlowLayoutPanel();

        flowTop.Parent   = flow;
        flowTop.AutoSize = true;
        flowTop.Anchor   = AnchorStyles.None;

        Label lbl = new Label();

        lbl.Parent   = flowTop;
        lbl.AutoSize = true;
        lbl.Text     = "Enter some text:";
        lbl.Anchor   = AnchorStyles.None;

        TextBox txtbox = new TextBox();

        txtbox.Parent   = flowTop;
        txtbox.AutoSize = true;

        FlowLayoutPanel flowBottom = new FlowLayoutPanel();

        flowBottom.Parent   = flow;
        flowBottom.AutoSize = true;
        flowBottom.Anchor   = AnchorStyles.None;

        RoundButton btnOk = new RoundButton();

        btnOk.Parent       = flowBottom;
        btnOk.Text         = "OK";
        btnOk.Anchor       = AnchorStyles.None;
        btnOk.DialogResult = DialogResult.OK;
        AcceptButton       = btnOk;

        RoundButton btnCancel = new RoundButton();

        btnCancel.Parent       = flowBottom;
        btnCancel.AutoSize     = true;
        btnCancel.Text         = "Cancel";
        btnCancel.Anchor       = AnchorStyles.None;
        btnCancel.DialogResult = DialogResult.Cancel;
        CancelButton           = btnCancel;

        btnOk.Size = btnCancel.Size;
    }
Ejemplo n.º 20
0
        private void OilWellDrag_PreviewMouseMove(object Sender, MouseEventArgs e)
        {
            RoundButton roundButton = e.Source as RoundButton;

            if (e.LeftButton == MouseButtonState.Pressed)
            {
                DataObject data = new DataObject(roundButton.GetType(), roundButton);
                DragDrop.DoDragDrop(roundButton, data, DragDropEffects.Move);
            }
        }
Ejemplo n.º 21
0
 public override void HandleRequest(RoundButton roundButton, MouseButtons button)
 {
     if (button == MouseButtons.Right)
     {
         roundButton.SetColorPrev();
     }
     else if (successor != null)
     {
         successor.HandleRequest(roundButton, button);
     }
 }
Ejemplo n.º 22
0
        public TargetDetails()
        {
            this.pages  = new List <TargetDetailPageInfo>();
            this.button = new RoundButton(ButtonSize);
            this.button.SetIcon(@"GH\Texture\GhRoundIcon");
            this.button.ClickCallback = this.OnClick;
            this.button.Button.Hide();
            var eventListener = new GameEventListener();

            eventListener.RegisterEvent(UnitInfoEvent.PLAYER_TARGET_CHANGED, this.OnTargetChange);
        }
Ejemplo n.º 23
0
        private void btnFancyRecord_MouseUp(object sender, MouseEventArgs e)
        {
            if (!btnAvailable)
            {
                return;
            }
            RoundButton rb = buttons[((Control)sender).Name];

            rb.startAnimation(rb.x, rb.y, rb.r, rb.x, rb.y, rb.r * 1.2f, 10, true, Interpolator.BUMP);
            rb.r = rb.r * 1.2f;
        }
Ejemplo n.º 24
0
        private void RoundButton_Click(object sender, MouseEventArgs e)
        {
            RoundButton btnSender = (RoundButton)sender;
            Clicker     left      = new LeftClicker();
            Clicker     right     = new RightClicker();
            Clicker     middle    = new MiddleClicker();

            left.SetSuccessor(right);
            right.SetSuccessor(middle);
            left.HandleRequest(btnSender, e.Button);
        }
Ejemplo n.º 25
0
 public override void HandleRequest(RoundButton roundButton, MouseButtons button)
 {
     if (button == MouseButtons.Middle)
     {
         roundButton.ResetColor();
     }
     else if (successor != null)
     {
         successor.HandleRequest(roundButton, button);
     }
 }
Ejemplo n.º 26
0
        private void btnFancyRecord_MouseDown(object sender, MouseEventArgs e)
        {
            if (!btnAvailable)
            {
                return;
            }
            toolStripMenuItem10_MouseDown(sender, e);
            RoundButton rb = buttons[((Control)sender).Name];

            rb.startAnimation(rb.x, rb.y, rb.r, rb.x, rb.y, rb.r / 1.2f, 10, true, Interpolator.LINEAR);
            rb.r = ((Control)sender).Width / 2;
        }
Ejemplo n.º 27
0
        public void createFromView(Control control, Color color, Bitmap icon)
        {
            String      tag    = control.Name;
            float       radius = (float)Math.Sqrt(control.Width * control.Width + control.Height + control.Height) / 2;
            float       x      = picClockFace.Left + control.Left + control.Width / 2;
            float       y      = picClockFace.Top + control.Top + control.Height / 2;
            RoundButton rb     = new RoundButton(color, icon, x, y, radius);

            rb.visibility = false;

            buttons.Add(tag, rb);
        }
Ejemplo n.º 28
0
        private void btnFancyRecord_MouseLeave(object sender, EventArgs e)
        {
            if (!btnAvailable)
            {
                return;
            }
            RoundButton rb = buttons[((Control)sender).Name];
            float       lr = ((Control)sender).Width / 2;

            rb.startAnimation(rb.x, rb.y, rb.r, rb.x, rb.y, lr, 16, true, Interpolator.OVERSHOOT);
            rb.r = lr;
        }
Ejemplo n.º 29
0
        private void btnFancyRecord_MouseEnter(object sender, EventArgs e)
        {
            if (!btnAvailable)
            {
                return;
            }
            toolStripMenuItem10_MouseEnter(sender, e);
            RoundButton rb = buttons[((Control)sender).Name];

            rb.startAnimation(rb.x, rb.y, rb.r, rb.x, rb.y, rb.r * 1.2f, 16, true, Interpolator.OVERSHOOT);
            rb.r = rb.r * 1.2f;
        }
Ejemplo n.º 30
0
 private void callOnClick(RoundButton led)
 {
     //建立一个类型  
     Type t = typeof(RoundButton);
     //参数对象  
     object[] p = new object[1];
     //产生方法  
     MethodInfo m = t.GetMethod("OnClick", BindingFlags.NonPublic | BindingFlags.Instance);
     //参数赋值。传入函数  
     p[0] = EventArgs.Empty;
     //调用  
     m.Invoke(led, p);
     return;
 }