コード例 #1
0
        public ComboBoxWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            ScaleX = 12;
            ScaleY = 9;
            this.Closing += GuiManager.RemoveWindow;
            
            mTextField = new TextField();
            mTextField.SetDimensions(-2, -8, 1, 23, 0);
            mTextField.Z = 100;
            mTextField.WindowParent = this;

            mComboBox = new ComboBox(mCursor);
            AddWindow(mComboBox);
            mComboBox.ScaleX = ScaleX - 2;
            mComboBox.ScaleY = 1.4f;
            mComboBox.SetPositionTL(ScaleX, 2 * ScaleY - 5);

            mCancelButton = new Button(mCursor);
            AddWindow(mCancelButton);
            mCancelButton.ScaleY = 1.5f;
            mCancelButton.Text = "Cancel";
            mCancelButton.SetPositionTL(2 * ScaleX - 5.2f, 2 * ScaleY - 2);
            mCancelButton.Click += GuiManager.RemoveWindow;

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
            mOkButton.ScaleY = 1.5f;
            mOkButton.Text = "Ok";
            mOkButton.SetPositionTL(5.2f, 2 * ScaleY - 2);
        }
コード例 #2
0
        public TimeLineWindow(Cursor cursor) : 
            base(cursor)
		{
			GuiManager.AddWindow(this);
			SetPositionTL(55.2f, 80.1f);
			ScaleX = 55.2f;
			ScaleY = 3.3f;
			mName = "Time Line";

            #region Zoom in button

            zoomInTimeLineButton = AddButton();
			zoomInTimeLineButton.SetPositionTL(104.7474f, 4.5f);
			zoomInTimeLineButton.ScaleX = 1.1f;
			zoomInTimeLineButton.ScaleY = 1.1f;
			zoomInTimeLineButton.Text = "Zoom in time line";
			zoomInTimeLineButton.SetOverlayTextures(3, 2);
			zoomInTimeLineButton.Click += new GuiMessage(TimeLineMessages.ZoomInClick);

            #endregion

            #region Zoom out button

            zoomOutTimeLineButton = AddButton();
			zoomOutTimeLineButton.SetPositionTL(102.2f, 4.5f);
			zoomOutTimeLineButton.ScaleX = 1.1f;
			zoomOutTimeLineButton.ScaleY = 1.1f;
			zoomOutTimeLineButton.Text = "Zoom out time line";
			zoomOutTimeLineButton.SetOverlayTextures(2, 2);
			zoomOutTimeLineButton.Click += new GuiMessage(TimeLineMessages.ZoomOutClick);

            #endregion

            #region Current time TextBox
            currentTimeTextBox = AddTextBox();
			currentTimeTextBox.SetPositionTL(92, 4.3f);
			currentTimeTextBox.ScaleX = 6;
			currentTimeTextBox.ScaleY = 1.1f;
			currentTimeTextBox.Format = TextBox.FormatTypes.Decimal;
			currentTimeTextBox.LosingFocus += new GuiMessage(TimeLineMessages.CurrentTimeTextBoxChange);
			currentTimeTextBox.Text = "0";
            #endregion

            #region Insert Keyframe Button
            insertKeyframeButton = AddButton();
			insertKeyframeButton.SetPositionTL(99.5f, 4.6f);
			insertKeyframeButton.ScaleX = 1.3f;
			insertKeyframeButton.ScaleY = 1.3f;
			insertKeyframeButton.Text = "Insert Keyframe";
			insertKeyframeButton.SetOverlayTextures(4, 2);
			insertKeyframeButton.Click += new GuiMessage(TimeLineMessages.InsertKeyframeClick);
            insertKeyframeButton.Visible = false; // need to remove this.
            #endregion

            #region Time Line
            timeLine = new MarkerTimeLine(cursor);
			AddWindow(timeLine);
			timeLine.ScaleX = 42.0f;
			timeLine.ScaleY = 2;
			timeLine.SetPositionTL(43.0f, this.ScaleY * 2 - 2.4f);
            timeLine.GuiChange += new GuiMessage(TimeLineMessages.TimeLineGUIValueChange);
			timeLine.MarkerClick += new GuiMessage(TimeLineMessages.KeyframeMarkerClick);

			timeLine.Start = 0;
            timeLine.TimeUnitDisplayed = TimeLine.TimeUnit.Second;
			timeLine.MinimumValue = 0;
			timeLine.MaximumValue = 999;
			timeLine.ValueWidth = 20;
			timeLine.AutoCalculateVerticalLineSpacing();
            #endregion

            timeUnit = this.AddComboBox();
			timeUnit.ScaleX = 6f;
			timeUnit.AddItem("Milliseconds");
			timeUnit.AddItem("Seconds");
			timeUnit.Text = "Seconds";
			timeUnit.SetPositionTL(92f, 1.8f);
			timeUnit.ItemClick += new GuiMessage(TimeLineMessages.TimeUnitChange);

            #region All or Current Combo Box

            mAllOrCurrent = this.AddComboBox();
            mAllOrCurrent.ScaleX = 5;
            mAllOrCurrent.SetPositionTL(104, 1.8f);
            mAllOrCurrent.AddItem("All", InstructionMode.All);
            mAllOrCurrent.AddItem("Current", InstructionMode.Current);
            mAllOrCurrent.Text = "All";
            mAllOrCurrent.SelectedObject = InstructionMode.All;
            mAllOrCurrent.ItemClick += AllOrCurrentItemClick;

            #endregion
        }