Пример #1
0
        public ScrollControl(Screen screen, Boolean allowScroll, Boolean smooth)
        {
            GazeManager.Instance.Activate(GazeManager.ApiVersion.VERSION_1_0, GazeManager.ClientMode.Push);
            GazeManager.Instance.AddGazeListener(this);
            ActiveScreen = screen;
            autoScroll   = allowScroll;
            Smooth       = smooth;

            //Size of the scroll area, in percent
            int regWidth   = 30;
            int regHeight  = 10;
            int bottomPadd = 15;

            int screenHeight = screen.Bounds.Height;
            int screenWidth  = screen.Bounds.Width;

            //Create Scroll Regions
            topReg    = new ScrollRegion(toPercent(screenWidth, (100 - regWidth) / 2), 0, screenWidth - toPercent(screenWidth, (100 - regWidth) / 2), toPercent(screenHeight, regHeight));
            bottomReg = new ScrollRegion(toPercent(screenWidth, (100 - regWidth) / 2), screenHeight - toPercent(screenHeight, bottomPadd + (100 - regHeight) / 2), screenWidth - toPercent(screenWidth, (100 - regWidth) / 2), screenHeight - toPercent(screenHeight, bottomPadd));
            leftReg   = new ScrollRegion(0, toPercent(screenHeight, (100 - regHeight) / 2), toPercent(screenWidth, regWidth), screenHeight - toPercent(screenHeight, (100 - regHeight) / 2));
            rightReg  = new ScrollRegion(screenWidth - toPercent(screenHeight, regWidth), toPercent(screenHeight, (100 - regHeight) / 2), screenWidth, screenHeight - toPercent(screenHeight, (100 - regHeight) / 2));
        }
Пример #2
0
        public CursorControl(Screen screen, bool enabled, bool scrollEnabled, bool smooth)
        {
            GazeManager.Instance.Activate(GazeManager.ApiVersion.VERSION_1_0, GazeManager.ClientMode.Push);
            GazeManager.Instance.AddGazeListener(this);
            ActiveScreen  = screen;
            Enabled       = enabled;
            ScrollEnabled = scrollEnabled;
            Smooth        = smooth;

            /*-------Scrolling Stuff------*/
            //Size of the scroll area, in percent
            int regWidth   = 30;
            int regHeight  = 10;
            int bottomPadd = 15;

            int screenHeight = screen.Bounds.Height;
            int screenWidth  = screen.Bounds.Width;

            //Create Scroll Regions
            topReg    = new ScrollRegion(toPercent(screenWidth, (100 - regWidth) / 2), 0, screenWidth - toPercent(screenWidth, (100 - regWidth) / 2), toPercent(screenHeight, regHeight));
            bottomReg = new ScrollRegion(toPercent(screenWidth, (100 - regWidth) / 2), screenHeight - toPercent(screenHeight, bottomPadd + (100 - regHeight) / 2), screenWidth - toPercent(screenWidth, (100 - regWidth) / 2), screenHeight - toPercent(screenHeight, bottomPadd));
            leftReg   = new ScrollRegion(0, toPercent(screenHeight, (100 - regHeight) / 2), toPercent(screenWidth, regWidth), screenHeight - toPercent(screenHeight, (100 - regHeight) / 2));
            rightReg  = new ScrollRegion(screenWidth - toPercent(screenHeight, regWidth), toPercent(screenHeight, (100 - regHeight) / 2), screenWidth, screenHeight - toPercent(screenHeight, (100 - regHeight) / 2));
        }