コード例 #1
0
ファイル: LoopButton.cs プロジェクト: xinfushe/projectanarchy
        /// <summary>
        /// Constructor
        /// </summary>
        public LoopButton()
            : base()
        {
            //create _intervalChangeDialog but do not show it yet
            _intervalChangeDialog = new IntervalChangeDialog(this);


            //create SplitButton MenuItem for animate
            this._toolStripMenuItem_Animate             = new System.Windows.Forms.ToolStripMenuItem();
            this._toolStripMenuItem_Animate.Name        = "ToolStripMenuItem_Animate";
            this._toolStripMenuItem_Animate.Size        = new System.Drawing.Size(150, 22);
            this._toolStripMenuItem_Animate.Text        = "Loop animation";
            this._toolStripMenuItem_Animate.ToolTipText = "loops animation";
            this._toolStripMenuItem_Animate.Click      += new System.EventHandler(this.ToolStripMenuItem_LoopAnimate_Click);

            //create SplitButton MenuItem for play in editor
            this._toolStripMenuItem_PlayInEditor             = new System.Windows.Forms.ToolStripMenuItem();
            this._toolStripMenuItem_PlayInEditor.Name        = "ToolStripMenuItem_PlayInEditor";
            this._toolStripMenuItem_PlayInEditor.Size        = new System.Drawing.Size(150, 22);
            this._toolStripMenuItem_PlayInEditor.Text        = "Loop play in editor";
            this._toolStripMenuItem_PlayInEditor.ToolTipText = "loops play in editor mode";
            this._toolStripMenuItem_PlayInEditor.Click      += new System.EventHandler(this.ToolStripMenuItem_LoopPlayInEditor_Click);

            //create SplitButton MenuItem for set interval
            this._toolStripMenuItem_SetInterval             = new System.Windows.Forms.ToolStripMenuItem();
            this._toolStripMenuItem_SetInterval.Name        = "ToolStripMenuItem_SetInterval";
            this._toolStripMenuItem_SetInterval.Size        = new System.Drawing.Size(150, 22);
            this._toolStripMenuItem_SetInterval.Text        = "Set loop interval...";
            this._toolStripMenuItem_SetInterval.ToolTipText = "sets the loop interval";
            this._toolStripMenuItem_SetInterval.Click      += new System.EventHandler(this.ToolStripMenuItem_SetInterval_Click);

            //button settings
            this.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this._toolStripMenuItem_Animate,
                this._toolStripMenuItem_PlayInEditor,
                this._toolStripMenuItem_SetInterval
            });
            this.Image = _buttonIconPlay;
            this.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.ToolTipText           = "Plays or animates loop in engine view";
            this.Visible      = true;
            this.Enabled      = false;
            this.ButtonClick += new System.EventHandler(this.Button_Loop_Click);

            //store dropdown value of button
            _play_Dropdown = this.DropDown;

            //register eventhandler for events that influence the loopbutton
            EditorManager.SceneChanged      += new SceneChangedEventHandler(EditorManager_SceneChanged);
            EditorManager.EditorModeChanged += new EditorModeChangedEventHandler(EditorManager_EditorModeChanged);

            //add this button to the EnginePanelToolbar
            EditorManager.GUI.EnginePanelToolBar.Items.Add(this);
        }
コード例 #2
0
ファイル: LoopButton.cs プロジェクト: hxzpily/projectanarchy
        /// <summary>
        /// Constructor
        /// </summary>
        public LoopButton()
            : base()
        {
            //create _intervalChangeDialog but do not show it yet
              _intervalChangeDialog = new IntervalChangeDialog(this);

              //create SplitButton MenuItem for animate
              this._toolStripMenuItem_Animate = new System.Windows.Forms.ToolStripMenuItem();
              this._toolStripMenuItem_Animate.Name = "ToolStripMenuItem_Animate";
              this._toolStripMenuItem_Animate.Size = new System.Drawing.Size(150, 22);
              this._toolStripMenuItem_Animate.Text = "Loop animation";
              this._toolStripMenuItem_Animate.ToolTipText = "loops animation";
              this._toolStripMenuItem_Animate.Click += new System.EventHandler(this.ToolStripMenuItem_LoopAnimate_Click);

              //create SplitButton MenuItem for play in editor
              this._toolStripMenuItem_PlayInEditor = new System.Windows.Forms.ToolStripMenuItem();
              this._toolStripMenuItem_PlayInEditor.Name = "ToolStripMenuItem_PlayInEditor";
              this._toolStripMenuItem_PlayInEditor.Size = new System.Drawing.Size(150, 22);
              this._toolStripMenuItem_PlayInEditor.Text = "Loop play in editor";
              this._toolStripMenuItem_PlayInEditor.ToolTipText = "loops play in editor mode";
              this._toolStripMenuItem_PlayInEditor.Click += new System.EventHandler(this.ToolStripMenuItem_LoopPlayInEditor_Click);

              //create SplitButton MenuItem for set interval
              this._toolStripMenuItem_SetInterval = new System.Windows.Forms.ToolStripMenuItem();
              this._toolStripMenuItem_SetInterval.Name = "ToolStripMenuItem_SetInterval";
              this._toolStripMenuItem_SetInterval.Size = new System.Drawing.Size(150, 22);
              this._toolStripMenuItem_SetInterval.Text = "Set loop interval...";
              this._toolStripMenuItem_SetInterval.ToolTipText = "sets the loop interval";
              this._toolStripMenuItem_SetInterval.Click += new System.EventHandler(this.ToolStripMenuItem_SetInterval_Click);

              //button settings
              this.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
              this.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._toolStripMenuItem_Animate,
            this._toolStripMenuItem_PlayInEditor,
            this._toolStripMenuItem_SetInterval});
              this.Image = _buttonIconPlay;
              this.ImageTransparentColor = System.Drawing.Color.Magenta;
              this.ToolTipText = "Plays or animates loop in engine view";
              this.Visible = true;
              this.Enabled = false;
              this.ButtonClick += new System.EventHandler(this.Button_Loop_Click);

              //store dropdown value of button
              _play_Dropdown = this.DropDown;

              //register eventhandler for events that influence the loopbutton
              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);
              EditorManager.EditorModeChanged += new EditorModeChangedEventHandler(EditorManager_EditorModeChanged);

              //add this button to the EnginePanelToolbar
              EditorManager.GUI.EnginePanelToolBar.Items.Add(this);
        }