예제 #1
0
        /*Tastensteuerung der LoopList*/
        protected override void OnKeyDown(KeyEventArgs e)
        {
            try
            {
                switch (e.Key)
                {
                case Key.Left:
                    MyLoopList.AnimH(true);
                    break;

                case Key.Right:
                    MyLoopList.AnimH(false);
                    break;

                case Key.Up:
                    if (!_waitForTextList)
                    {
                        MyLoopList.AnimV(true);
                    }
                    break;

                case Key.Down:
                    if (!_waitForTextList)
                    {
                        MyLoopList.AnimV(false);
                    }
                    break;

                case Key.NumPad4:
                    MyLoopList.HDragPercent(-0.25);
                    break;

                case Key.NumPad6:
                    MyLoopList.HDragPercent(0.25);
                    break;

                case Key.NumPad8:
                    if (!_waitForTextList)
                    {
                        MyLoopList.VDragPercent(-0.25);
                    }
                    break;

                case Key.NumPad2:
                    if (!_waitForTextList)
                    {
                        MyLoopList.VDragPercent(0.25);
                    }
                    break;
                }
            }
            catch (Exception exc)
            {
                ExceptionTextBlock.Text = exc.Message + "\r\n" + exc.InnerException;
            }
        }
예제 #2
0
        public void SwipeDown(object sender, EventArgs e)
        {
            if (_unclicked)
            {
                Click(new Point(0, 0));
            }
            SwipeArgs sa       = (SwipeArgs)e;
            Point     newPoint = new Point(0, -MyLoopList.GetDraggableVLength() * sa.Progress);

            Drag(newPoint, 0);
        }
예제 #3
0
 private void InitList()
 {
     MyLoopList.SetAutoDragOffset(0.50);
     MyLoopList.SetDuration(new Duration(new TimeSpan(3000000))); //300m
     MyLoopList.Scrolled     += MyLoopListOnScrolled;
     MyTextLoopList.Scrolled += MyTextLoopList_Scrolled;
     MyTextLoopList.SetFontSize(36);
     MyTextLoopList.SetFontColor(Colors.White);
     //MyTextLoopList.SetWordWrap(TextWrapping.Wrap);
     //MyTextLoopList.SetFontFamily("Miriam Fixed");
     MyTextLoopList.SetDuration(new Duration(new TimeSpan(5500000)));
     LoadPictures(new LocalPictureUiLoader());
 }
예제 #4
0
    private void Start()
    {
        TestData[] datas = new TestData[]
        {
            new TestData("111"), new TestData("222"),
            new TestData("333"), new TestData("444"),
            new TestData("555"), new TestData("666"),
            new TestData("777"), new TestData("888"),
            new TestData("999"), new TestData("101010"),
            new TestData("111111"), new TestData("121212"),
            new TestData("131313"), new TestData("14141414"),
        };
        MyLoopList <TestData, TestView> v = new MyLoopList <TestData, TestView>();

        v.Init(datas, new Vector2(10, 10), 200, 150, 2, 30, go, rect);
    }
예제 #5
0
        public void UnClick()
        {
            try
            {
                _oldMovePoint = null;
                _unclicked    = true;
                ResetDragDirectionObvious();

                _doDrag = false;
                MyLoopList.AnimBack(); //zurueckspringen des Bildes
            }
            catch (Exception exc)
            {
                ExceptionTextBlock.Text = exc.Message + "\r\n" + exc.InnerException;
            }
        }
예제 #6
0
        private void InitList()
        {
            MyLoopList.SetAutoDragOffset(0.5);
            MyLoopList.SetDuration(new Duration(new TimeSpan(3000000))); //300m
            MyLoopList.Scrolled     += MyLoopListOnScrolled;
            MyTextLoopList.Scrolled += MyTextLoopList_Scrolled;
            MyTextLoopList.SetFontSize(36);
            MyTextLoopList.SetFontFamily("Miriam Fixed");
            MyTextLoopList.SetDuration(new Duration(new TimeSpan(5500000)));

            string[] paths = Directory.GetFiles(Environment.CurrentDirectory + @"\images\Beach");
            Image    img   = new Image {
                Source = new BitmapImage(new Uri(paths[0], UriKind.RelativeOrAbsolute))
            };
            Node node1 = MyLoopList.AddNewToLeft(null, -1, img);

            img = new Image {
                Source = new BitmapImage(new Uri(paths[1], UriKind.RelativeOrAbsolute))
            };
            Node node2 = MyLoopList.AddNewToLeft(null, -1, img);

            node1.Right = node2;
            node2.Left  = node1;
            node2.Below = node1;
            node2.Right = node1;
            Node nodeHallo = MyLoopList.AddNewToAbove(null, -1, new Button {
                Content = "Hallo", Width = 40, Height = 40
            });
            Node nodeToll = MyLoopList.AddNewToLeft(nodeHallo, -1, new Button {
                Content = "Toll, ne?", Width = 100, Height = 40
            });

            node2.Above     = nodeToll;
            nodeToll.Below  = nodeHallo;
            nodeToll.Above  = nodeHallo;
            nodeHallo.Above = nodeToll;
            nodeHallo.Below = nodeToll;
            MyTextLoopList.Add("lol");
            MyTextLoopList.Add("käse");
            MyTextLoopList.Add("Test");
            MyTextLoopList.Add("Ahjo");
            MyTextLoopList.Add("a");
            MyTextLoopList.Add("b");
            MyTextLoopList.Add("c");
        }
예제 #7
0
        private void Drag(Point currentPos)
        {
            try
            {
                if (!_doDrag)
                {
                    return;
                }
                if (!_oldMovePoint.HasValue)
                {
                    _oldMovePoint = currentPos;
                }
                if (Math.Abs(_oldMovePoint.Value.X - currentPos.X) < 0.000000001 &&
                    Math.Abs(_oldMovePoint.Value.Y - currentPos.Y) < 0.000000001)
                {
                    return; //keine Bewegung?
                }
                int xDistance = (int)(currentPos.X - _oldMovePoint.Value.X);
                int yDistance = (int)(currentPos.Y - _oldMovePoint.Value.Y);

                Orientation dragDirection = Math.Abs(xDistance) >= Math.Abs(yDistance) ? Orientation.Horizontal : Orientation.Vertical;
                if (!_dragDirectionIsObvious)
                {
                    if (_savedDirections.Count < 4)
                    {
                        _savedDirections.Add(dragDirection);
                        return;
                    }
                    int xCount = 0;
                    int yCount = 0;
                    foreach (Orientation dir in _savedDirections)
                    {
                        switch (dir)
                        {
                        case Orientation.Horizontal:
                            xCount++;
                            break;

                        case Orientation.Vertical:
                            yCount++;
                            break;
                        }
                    }
                    int greater = Math.Max(xCount, yCount);
                    int lower   = Math.Min(xCount, yCount);
                    if (lower / (double)greater < 0.15) //x- und y-Entwicklung unterscheiden sich deutlich.
                    {
                        _dragDirectionIsObvious             = true;
                        dragDirection                       = greater == xCount ? Orientation.Horizontal : Orientation.Vertical;
                        KinectVibratingRectangle.Visibility = Visibility.Collapsed;
                    }
                    _savedDirections.Clear();
                    if (!_dragDirectionIsObvious)
                    {
                        KinectVibratingRectangle.Visibility = Visibility.Visible;
                        return;
                    }
                }

                bool mayDragOn = false;
                if (dragDirection == Orientation.Horizontal)
                {
                    mayDragOn = MyLoopList.HDrag(xDistance);
                }
                else
                {
                    if (!_waitForTextList) //<-- nervt doch nur ... <-- nein das dient der synchronisation zwischen linkem text und looplist.
                    {
                        mayDragOn = MyLoopList.VDrag(yDistance);
                    }
                }
                if (!mayDragOn)
                {
                    _doDrag = false;
                }
            }
            catch (Exception exc)
            {
                ExceptionTextBlock.Text = exc.Message + "\r\n" + exc.InnerException;
            }
            finally
            {
                _oldMovePoint = currentPos;
            }
        }