Esempio n. 1
0
        /// <summary>
        /// Create a new ExtendedScrollBar.
        /// </summary>
        public ExtendedScrollBar()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.hScrollBar.SmallChange = 10;
            this.hScrollBar.LargeChange = 100;

            this.scrollAmount             = this.hScrollBar.SmallChange;
            this.autoscrollTimer.Interval = 100;

            this.buttonMode = ExtendedScrollBarButtonMode.PlaySymbols;

            // create left play symbol
            this.leftPlayRegion = new Region();
            this.leftPlayRegion.MakeEmpty();
            this.leftPlayRegion.Union(new Rectangle(1, 4, 1, 1));
            this.leftPlayRegion.Union(new Rectangle(2, 3, 1, 3));
            this.leftPlayRegion.Union(new Rectangle(3, 2, 1, 5));
            this.leftPlayRegion.Union(new Rectangle(4, 1, 1, 7));
            this.leftPlayRegion.Union(new Rectangle(5, 0, 2, 9));

            // create right play symbol
            this.rightPlayRegion = this.leftPlayRegion.Clone();
            System.Drawing.Drawing2D.Matrix matrixTransform = new System.Drawing.Drawing2D.Matrix();
            matrixTransform.RotateAt(45, new Point(4, 4));
            matrixTransform.RotateAt(45, new Point(5, 5));
            matrixTransform.RotateAt(45, new Point(4, 4));
            matrixTransform.RotateAt(45, new Point(4, 4));
            this.rightPlayRegion.Transform(matrixTransform);

            // create stop symbol
            this.stopRegion = new Region();
            this.stopRegion.MakeEmpty();
            this.stopRegion.Union(new Rectangle(1, 0, 1, 1));
            this.stopRegion.Union(new Rectangle(7, 0, 1, 1));
            this.stopRegion.Union(new Rectangle(0, 1, 3, 1));
            this.stopRegion.Union(new Rectangle(6, 1, 3, 1));
            this.stopRegion.Union(new Rectangle(1, 2, 3, 1));
            this.stopRegion.Union(new Rectangle(5, 2, 3, 1));
            this.stopRegion.Union(new Rectangle(2, 3, 5, 1));
            this.stopRegion.Union(new Rectangle(3, 4, 3, 1));
            this.stopRegion.Union(new Rectangle(2, 5, 5, 1));
            this.stopRegion.Union(new Rectangle(5, 6, 3, 1));
            this.stopRegion.Union(new Rectangle(1, 6, 3, 1));
            this.stopRegion.Union(new Rectangle(6, 7, 3, 1));
            this.stopRegion.Union(new Rectangle(0, 7, 3, 1));
            this.stopRegion.Union(new Rectangle(7, 8, 1, 1));
            this.stopRegion.Union(new Rectangle(1, 8, 1, 1));

            this.CreateBitmaps();
        }
Esempio n. 2
0
        /// <summary>
        /// Handle the button click events of the two autoscroll buttons, and set timers and images appropriately.
        /// </summary>
        private void MovieButtonsClicked()
        {
            if (this.buttonMode == ExtendedScrollBarButtonMode.PlaySymbols)
            {
                this.leftPictureBox.Image  = stopImageList.Images[0];
                this.rightPictureBox.Image = stopImageList.Images[4];
                this.buttonMode            = ExtendedScrollBarButtonMode.StopSymbols;

                // start the auto-scroll timer
                this.autoscrollTimer.Start();
            }
            else
            {
                this.leftPictureBox.Image  = playImageList.Images[0];
                this.rightPictureBox.Image = playImageList.Images[4];
                this.buttonMode            = ExtendedScrollBarButtonMode.PlaySymbols;

                // stop the auto-scroll timer if it is still active
                if (this.autoscrollTimer.Enabled)
                {
                    this.autoscrollTimer.Stop();
                }
            }
        }