コード例 #1
0
        private void mtbButton_TimelineControlButtonClicked(MapTimelineControlButton sender, MapTimelineControlButtonType ButtonType)
        {
            if (this.SelectedButtonType == ButtonType && ButtonType == MapTimelineControlButtonType.FastForward)
            {
                if (this.m_flControlChangeSpeed < 512.0F)
                {
                    this.m_flControlChangeSpeed = this.m_flControlChangeSpeed * 2.0F;
                }
            }
            else if (this.SelectedButtonType == ButtonType && ButtonType == MapTimelineControlButtonType.Rewind)
            {
                if (this.m_flControlChangeSpeed < 512.0F)
                {
                    this.m_flControlChangeSpeed = this.m_flControlChangeSpeed * 2.0F;
                }
            }
            else if (ButtonType == MapTimelineControlButtonType.FastForward || ButtonType == MapTimelineControlButtonType.Rewind)
            {
                this.m_flControlChangeSpeed = 2.0F;
            }

            foreach (MapTimelineControlButton mtbButton in this.TimelineButtons)
            {
                if (mtbButton == sender)
                {
                    mtbButton.ForegroundColour = Color.LightSeaGreen;
                }
                else
                {
                    mtbButton.ForegroundColour = Color.White;
                }
            }

            this.SelectedButtonType = ButtonType;
        }
コード例 #2
0
        public MapTimelineControl()
        {
            this.m_mtsSeek = new MapTimelineSeekButton();

            this.TimelineButtons = new List <MapObject>();

            GraphicsPath gpButtonPath = new GraphicsPath();

            gpButtonPath.AddLines(new Point[] { new Point(0, 6), new Point(6, 12), new Point(6, 6), new Point(12, 12), new Point(12, 0), new Point(6, 6), new Point(6, 0), new Point(0, 6) });
            gpButtonPath.CloseFigure();
            MapTimelineControlButton mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.Rewind);

            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            gpButtonPath = new GraphicsPath();
            gpButtonPath.AddRectangles(new Rectangle[] { new Rectangle(0, 0, 4, 12), new Rectangle(8, 0, 4, 12) });
            mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.Pause);
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            gpButtonPath = new GraphicsPath();
            gpButtonPath.AddLines(new Point[] { new Point(1, 0), new Point(1, 12), new Point(9, 6), new Point(1, 0) });
            gpButtonPath.CloseFigure();
            mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.Play);
            mtbButton.ForegroundColour              = Color.LightSeaGreen;
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            gpButtonPath = new GraphicsPath();
            gpButtonPath.AddLines(new Point[] { new Point(0, 0), new Point(0, 12), new Point(6, 6), new Point(6, 12), new Point(12, 6), new Point(6, 0), new Point(6, 6), new Point(0, 0) });
            gpButtonPath.CloseFigure();
            mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.FastForward);
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            this.SelectedButtonType     = MapTimelineControlButtonType.Play;
            this.m_flControlChangeSpeed = 2.0F;
        }
コード例 #3
0
ファイル: MapTimelineControl.cs プロジェクト: eaceaser/PRoCon
        public MapTimelineControl()
        {
            this.m_mtsSeek = new MapTimelineSeekButton();

            this.TimelineButtons = new List<MapObject>();

            GraphicsPath gpButtonPath = new GraphicsPath();
            gpButtonPath.AddLines(new Point[] { new Point(0, 6), new Point(6, 12), new Point(6, 6), new Point(12, 12), new Point(12, 0), new Point(6, 6), new Point(6, 0), new Point(0, 6) });
            gpButtonPath.CloseFigure();
            MapTimelineControlButton mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.Rewind);
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            gpButtonPath = new GraphicsPath();
            gpButtonPath.AddRectangles(new Rectangle[] { new Rectangle(0, 0, 4, 12), new Rectangle(8, 0, 4, 12) });
            mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.Pause);
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            gpButtonPath = new GraphicsPath();
            gpButtonPath.AddLines(new Point[] { new Point(1, 0), new Point(1, 12), new Point(9, 6), new Point(1, 0) });
            gpButtonPath.CloseFigure();
            mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.Play);
            mtbButton.ForegroundColour = Color.LightSeaGreen;
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            gpButtonPath = new GraphicsPath();
            gpButtonPath.AddLines(new Point[] { new Point(0, 0), new Point(0, 12), new Point(6, 6), new Point(6, 12), new Point(12, 6), new Point(6, 0), new Point(6, 6), new Point(0, 0) });
            gpButtonPath.CloseFigure();
            mtbButton = new MapTimelineControlButton(gpButtonPath, MapTimelineControlButtonType.FastForward);
            mtbButton.TimelineControlButtonClicked += new MapTimelineControlButton.TimelineControlButtonClickedHandler(mtbButton_TimelineControlButtonClicked);
            this.TimelineButtons.Add(mtbButton);

            this.SelectedButtonType = MapTimelineControlButtonType.Play;
            this.m_flControlChangeSpeed = 2.0F;
        }
コード例 #4
0
ファイル: MapTimelineControl.cs プロジェクト: eaceaser/PRoCon
        private void mtbButton_TimelineControlButtonClicked(MapTimelineControlButton sender, MapTimelineControlButtonType ButtonType)
        {
            if (this.SelectedButtonType == ButtonType && ButtonType == MapTimelineControlButtonType.FastForward) {
                if (this.m_flControlChangeSpeed < 512.0F) {
                    this.m_flControlChangeSpeed = this.m_flControlChangeSpeed * 2.0F;
                }
            }
            else if (this.SelectedButtonType == ButtonType && ButtonType == MapTimelineControlButtonType.Rewind) {
                if (this.m_flControlChangeSpeed < 512.0F) {
                    this.m_flControlChangeSpeed = this.m_flControlChangeSpeed * 2.0F;
                }
            }
            else if (ButtonType == MapTimelineControlButtonType.FastForward || ButtonType == MapTimelineControlButtonType.Rewind) {
                this.m_flControlChangeSpeed = 2.0F;
            }

            foreach (MapTimelineControlButton mtbButton in this.TimelineButtons) {
                if (mtbButton == sender) {
                    mtbButton.ForegroundColour = Color.LightSeaGreen;
                }
                else {
                    mtbButton.ForegroundColour = Color.White;
                }
            }

            this.SelectedButtonType = ButtonType;
        }