예제 #1
0
파일: Slider.cs 프로젝트: radtek/MFE
 protected override void OnTouchUp(TouchEventArgs e)
 {
     if (TouchCapture.Captured == this)
     {
         TouchCapture.ReleaseCapture();
     }
 }
예제 #2
0
 protected override void OnTouchMove(TouchEventArgs e)
 {
     if (TouchCapture.Captured == this && !ContainsScreenPoint(e.Point))
     {
         TouchCapture.ReleaseCapture();
         Invalidate();
     }
 }
예제 #3
0
파일: HomePage.cs 프로젝트: radtek/MFE
        public HomePage()
            : base(0, 0, DemoManager.Desktop.Width, DemoManager.Desktop.Height)
        {
            panelNavigation = new Panel(5, 5, DemoManager.Desktop.Width - 10, DemoManager.Desktop.Height - 10)
            {
                Background = new LinearGradientBrush(Color.Bisque, Color.Black, 0, 0, 1000, 1000, 120),
                Border     = new Pen(Color.Black, 1)
            };
            Children.Add(panelNavigation);

            header            = new Panel(0, 0, panelNavigation.Width - 0, 25);
            header.Background = DemoManager.Bar;
            header.Children.Add(new Label(10, 5, DemoManager.FontCourierNew10, "Navigation")
            {
                ForeColor = Color.CornflowerBlue
            });
            header.TouchDown += delegate(object sender, TouchEventArgs e) { TouchCapture.Capture(header); p = e.Point; };
            header.TouchMove += delegate(object sender, TouchEventArgs e) { if (TouchCapture.Captured == header)
                                                                            {
                                                                                panelNavigation.Translate(e.Point.X - p.X, e.Point.Y - p.Y); p = e.Point;
                                                                            }
            };
            header.TouchUp += delegate(object sender, TouchEventArgs e) { if (TouchCapture.Captured == header)
                                                                          {
                                                                              TouchCapture.ReleaseCapture();
                                                                          }
            };
            panelNavigation.Children.Add(header);

            x    = margin;
            w    = panelNavigation.Width / 2 - 2 * margin;
            y    = header.Height + margin;
            step = h + margin;

            AddButton("Level");
            AddButton("ProgressBar");
            AddButton("Image");
            //AddButton("Panel");
            //AddButton("Checkbox");
            //AddButton("Button");
            //AddButton("MultiImage");
            //AddButton("Label");
            //AddButton("RadioButton");
            //AddButton("Slider");
            //AddButton("TextBlock");
            //AddButton("");
            //AddButton("");
            //AddButton("");
            //AddButton("");
            //AddButton("");
            //AddButton("");
        }
예제 #4
0
        protected override void OnTouchUp(TouchEventArgs e)
        {
            if (TouchCapture.Captured == this)
            {
                TouchCapture.ReleaseCapture();
                Invalidate();

                if (ContainsScreenPoint(e.Point))
                {
                    NotifyClick(EventArgs.Empty);
                }
            }
        }