Inheritance: Grafiti.GRConfiguration
Exemple #1
0
        public DemoObject(DemoObjectManager objectManager, Viewer viewer, int fiducialId, float x, float y, float angle)
        {
            m_targetRadius = 0.4f;

            m_objectManager = objectManager;
            m_viewer = viewer;
            m_id = fiducialId++;
            m_x = x;
            m_y = y;
            m_angle = angle;

            m_color = new MyColor(s_random.NextDouble(), s_random.NextDouble(), s_random.NextDouble());

            GestureEventManager.SetPriorityNumber(typeof(BasicMultiFingerGR), m_objectManager.BasicMultiFingerGRConf, 0);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), m_objectManager.BasicMultiFingerGRConf, "Hover", OnHover);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), m_objectManager.BasicMultiFingerGRConf, "EndHover", OnEndHover);
            GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), m_objectManager.BasicMultiFingerGRConf, "Tap", OnTap);
            //GestureEventManager.RegisterHandler(typeof(BasicMultiFingerGR), m_objectManager.BasicMultiFingerGRConf, "DoubleTap", OnDoubleTap);

            PinchingGRConfiguration m_pinchingGRConf = new PinchingGRConfiguration(true, this, false);
            GestureEventManager.SetPriorityNumber(typeof(PinchingGR), m_pinchingGRConf, 3);
            GestureEventManager.RegisterHandler(typeof(PinchingGR), m_pinchingGRConf, "Pinch", OnPinch);
        }
Exemple #2
0
        private float m_x = 0.5f, m_y = 0.5f; // position in tuio coordinates

        #endregion Fields

        #region Constructors

        public Calculator()
        {
            m_buttons.Add(new CalcButton(this, Items.Digit0, 1, 26, 12, 6)); // topleft, size
            m_buttons.Add(new CalcButton(this, Items.Digit1, 1, 20, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit2, 7, 20, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit3, 13, 20, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit4, 1, 14, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit5, 7, 14, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit6, 13, 14, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit7, 1, 8, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit8, 7, 8, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Digit9, 13, 8, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Point, 13, 26, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Enter, 20, 26, 12, 6));
            m_buttons.Add(new CalcButton(this, Items.OpPlus, 20, 20, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.OpMinus, 20, 14, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.OpMult, 26, 20, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.OpDiv, 26, 14, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.Back, 20, 8, 6, 6));
            m_buttons.Add(new CalcButton(this, Items.ClearAll, 26, 8, 6, 6));

            m_lcd = new LCD(1, 32, 9);

            PinchingGRConfiguration m_pinchingConf = new PinchingGRConfiguration(true, this, true);
            GestureEventManager.RegisterHandler(typeof(PinchingGR), m_pinchingConf, "Pinch", OnPinch);
        }