A UI element which displays text and visually responds to pushes.
Наследование: Window
Пример #1
0
        private static PropertyGrid CreatePropertyGridForObject(object objectToCreateGridFor)
        {

            object[] arguments = new object[]{
                        GuiManager.Cursor,
                        objectToCreateGridFor
                };

            Type t = typeof(PropertyGrid<>).MakeGenericType(mTypeOfObjectToSerialize);
            object obj = Activator.CreateInstance(t, arguments);

            PropertyGrid propertyGrid = obj as PropertyGrid;
            GuiManager.AddWindow(propertyGrid);
            propertyGrid.HasCloseButton = true;
            propertyGrid.Closing += GuiManager.RemoveWindow;

            Button saveButton = new Button(GuiManager.Cursor);
            saveButton.Text = "Save Object as XML";
            saveButton.ScaleX = 9f;
            saveButton.Click += XmlSeralizeObject;
            propertyGrid.AddWindow(saveButton);

            Button loadButton = new Button(GuiManager.Cursor);
            loadButton.Text = "Load Object from XML";
            loadButton.ScaleX = 9f;
            loadButton.Click += XmlDeserializeObject;
            propertyGrid.AddWindow(loadButton);

            return propertyGrid;
        }
Пример #2
0
        public OkListWindow(string message, string title)
            : base(GuiManager.Cursor)
        {
            mName = title;
            ScaleX = 13;
            ScaleY = 15;
            HasMoveBar = true;
            HasCloseButton = true;
            MinimumScaleX = 9;
            MinimumScaleY = 10;

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
            mOkButton.ScaleX = 1.7f;
			mOkButton.ScaleY = 1.2f;
            mOkButton.Text = "Ok";
			mOkButton.Click += new GuiMessage(OkButtonClicked);

            mMessageTextDisplay = new TextDisplay(mCursor);
            AddWindow(mMessageTextDisplay);
            mMessageTextDisplay.Text = message;
            mMessageTextDisplay.X = 1;
            mMessageTextDisplay.Y = 1.4f;

            mListBox = new ListBox(mCursor);
            AddWindow(mListBox);
            mListBox.StrongSelect += ShowSelectedItemInNewWindow;

            this.Resizable = true;
            Resizing += WindowResize;

            WindowResize(this);

            GuiManager.AddDominantWindow(this);
        }
Пример #3
0
        public SaveUseWindow(Cursor cursor)
            : base(cursor)
        {
            mComboBox = new ComboBox(cursor);
            mSaveButton = new Button(cursor);

            AddWindow(mComboBox);
            AddWindow(mSaveButton);

            ScaleX = 9;
            ScaleY = 3.5f;

            mComboBox.Y = 2;
            mSaveButton.Y = 4.5f;

            mSaveButton.Text = "Save";

            mComboBox.ScaleX = 8.5f;
            mSaveButton.ScaleX = mComboBox.ScaleX;

            mComboBox.X = .5f + mComboBox.ScaleX;
            mSaveButton.X = .5f + mSaveButton.ScaleX;            

            mSaveButton.Click += new GuiMessage(SaveButtonClick);
            mComboBox.ItemClick += new GuiMessage(ComboBoxItemClick);

        }
Пример #4
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);
        }
Пример #5
0
        // Methods
        public AttributesWindow(GuiMessages messages)
            : base(GuiManager.Cursor)
        {
            this.ScaleX = 11f;
            this.ScaleY = 20f;
            base.HasMoveBar = true;
            base.HasCloseButton = true;
            base.Name = "Attributes";

            this.mListBox = new ListBox(mCursor);
            AddWindow(mListBox);
            this.mListBox.ScaleX = this.ScaleX - 0.5f;
            this.mListBox.ScaleY = this.ScaleY - 3f;
            this.mListBox.SetPositionTL(this.ScaleX, this.ScaleY - 0.5f);
            this.mListBox.Click += new GuiMessage(this.AttributesListBoxClick);
            this.mListBox.Name = "Attributes ListBox";

            this.mAddAttribute = new Button(mCursor);
            AddWindow(mAddAttribute);
            this.mAddAttribute.ScaleX = 8f;
            this.mAddAttribute.ScaleY = 1.4f;
            this.mAddAttribute.SetPositionTL(8.5f, (2f * this.ScaleY) - 2f);
            this.mAddAttribute.Text = "Create New Attribute";
            this.mAddAttribute.Click += new GuiMessage(this.AddAttribute);
        }
Пример #6
0
        public ToolsWindow(Cursor cursor) : base()
		{
			messages = GuiData.Messages;

			SetPositionTL(3.5f, 63.8f);

            HasCloseButton = true;

            moveObject = AddToggleButton();
			moveObject.Text = "Move";
			moveObject.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>("Content/icons/Tools/move.tga", AppState.Self.PermanentContentManager),
                null);

            attachObject = AddToggleButton();
			attachObject.Text = "Attach";
			moveObject.AddToRadioGroup(attachObject);
			attachObject.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>("Content/icons/attach.tga", AppState.Self.PermanentContentManager),
                null);


            detachObject = AddButton();
			detachObject.Text = "Detach";
			detachObject.Enabled = false;
			detachObject.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>("Content/icons/detach.tga", AppState.Self.PermanentContentManager),             
                null);
			detachObject.Click += new GuiMessage(messages.DetachObjectClick);


            copyEmitter = AddButton();
			copyEmitter.Text = "Copy";
			copyEmitter.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>("Content/icons/duplicate.tga", AppState.Self.PermanentContentManager),             
                null);
			copyEmitter.Click += new GuiMessage(CopyEmitterClick);
            copyEmitter.Enabled = false ;

            scaleEmitterTime = AddButton();
			scaleEmitterTime.Text = "Scale Emitter Speed";
			scaleEmitterTime.SetOverlayTextures(15, 2);
			scaleEmitterTime.Click += new GuiMessage(ScaleEmitterTimeClick);
			scaleEmitterTime.Enabled = false;

            #region DownZFreeRotateButton

            this.mDownZFreeRotateButton = base.AddToggleButton();


            mDownZFreeRotateButton.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\DownZ.png", FlatRedBallServices.GlobalContentManager),
                FlatRedBallServices.Load<Texture2D>(@"Content\FreeRotation.png", FlatRedBallServices.GlobalContentManager));


            #endregion
		}
Пример #7
0
        public ActivityWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            ScaleX = 10;
            ScaleY = 6.5f;
            HasCloseButton = true;
            HasMoveBar = true;
            SetPositionTL(10, 52f);

            emitCurrent = new Button(mCursor);
            AddWindow(emitCurrent);
            emitCurrent.ScaleX = 4.8f;
            emitCurrent.SetPositionTL(ScaleX - 4.6f, 2);
            emitCurrent.ScaleY = 1f;
            emitCurrent.Text = "Emit Current";
            emitCurrent.Click += new GuiMessage(emitCurrentClick);

            emitAll = new Button(mCursor);
            AddWindow(emitAll);
            emitAll.ScaleX = 4.5f;
            emitAll.SetPositionTL(ScaleX + 5, 2);
            emitAll.ScaleY = 1f;
            emitAll.Text = "Emit All";
            emitAll.Click += new GuiMessage(emitAllClick);


            startStopCurrent = new ToggleButton(mCursor);
            AddWindow(startStopCurrent);
            startStopCurrent.ScaleX = 4.8f;
            startStopCurrent.SetText("Start Current", "Stop Current");
            startStopCurrent.SetPositionTL(ScaleX - 4.6f, 5);

            startStopAll = new ToggleButton(mCursor);
            AddWindow(startStopAll);
            startStopAll.ScaleX = 4.5f;
            startStopAll.SetText("Start All", "Stop All");
            startStopAll.SetPositionTL(ScaleX + 5, 5);

            clearAllButton = new Button(mCursor);
            AddWindow(clearAllButton);
            clearAllButton.ScaleX = 8.5f;
            clearAllButton.ScaleY = 1.5f;
            clearAllButton.SetPositionTL(ScaleX, 8);
            clearAllButton.Text = ("Clear All");
            clearAllButton.Click += new GuiMessage(clearAllButtonClick);

            numberOfSpritesDisplay = new TextDisplay(mCursor);
            AddWindow(numberOfSpritesDisplay);
            numberOfSpritesDisplay.Text = "Number of Sprites: 0";
            numberOfSpritesDisplay.SetPositionTL(ScaleX - 10, 11);
        }
Пример #8
0
        public MessageBox(Cursor cursor) : 
            base(cursor)
		{
            okButton = new Button(mCursor);
            AddWindow(okButton);
			this.HasMoveBar = true;
            this.HasCloseButton = true;
            Visible = false;
			textDisplay = new TextField();

			textDisplay.mAlignment = HorizontalAlignment.Left;

            
            //mTextRed = mTextGreen = mTextBlue = 20;

		}
Пример #9
0
        public TextInputWindow(Cursor cursor) : 
            base(cursor)
		{
            mCancelButton = new Button(mCursor);
            AddWindow(mCancelButton);

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);

            mTextBox = new TextBox(mCursor);
            AddWindow(mTextBox);

			mTextBox.EnterPressed += new GuiMessage(OkButtonClick);
			this.HasMoveBar = true;
            this.HasCloseButton = true;
            Visible = false;
			mTextDisplay = new TextField();

        }
Пример #10
0
        public EditAndSetButtons(Cursor cursor) : base(cursor)
        {
            ScaleY = 1.6f;
            ScaleX = 5.7f;

            mEditButton = new Button(mCursor);
            this.AddWindow(mEditButton);
            mEditButton.ScaleX = 2.5f;
            mEditButton.X = 3f;
            mEditButton.Text = "Edit";
            mEditButton.Click += OnEditButtonClick;



            mSetButton =  new Button(mCursor);
            this.AddWindow(mSetButton);
            mSetButton.ScaleX = 2.5f;
            mSetButton.X = 2*ScaleX - 3f;
            mSetButton.Text = "Set"; 
            mSetButton.Click += OnSetButtonClick;
        }
        public TimeControlButtonWindow(Cursor cursor) : base(cursor)
        {
			//GuiManager.AddWindow(this);

			SetPositionTL(5.2f, 40);
			ScaleX = 5.2f;
			ScaleY = 1.95f;
			mName = "Time Controls";
			mMoveBar = true;


            toStartButton = new Button(mCursor);
            AddWindow(toStartButton);
			toStartButton.SetPositionTL(1.9f, 1.9f);
			toStartButton.ScaleX = 1.5f;
			toStartButton.ScaleY = 1.5f;
			toStartButton.SetOverlayTextures(10, 1);
			toStartButton.Click += new GuiMessage(toStartButtonClick);
            toStartButton.Text = "To Start";


            stopButton = new Button(mCursor);
            AddWindow(stopButton);
			stopButton.SetPositionTL(5.1f, 1.9f);
			stopButton.ScaleX = 1.5f;
			stopButton.ScaleY = 1.5f;
			stopButton.SetOverlayTextures(11, 1);
			stopButton.Click += new GuiMessage(stopButtonClick);
            stopButton.Text = "Stop";

            playButton = new ToggleButton(mCursor);
            AddWindow(playButton);
			playButton.SetPositionTL(8.3f, 1.9f);
			playButton.ScaleX = 1.5f;
			playButton.ScaleY = 1.5f;
			playButton.SetOverlayTextures(9, 1);
			playButton.Click += new GuiMessage(playButtonClick);
            playButton.Text = "Play";

        }
Пример #12
0
        public Vector3OkWindow(Cursor cursor)
            : base(cursor)
        {
            this.ScaleX = 6.5f;
            this.ScaleY = 6.0f;
            HasMoveBar = true;
            HasCloseButton = true;

            mVector3Display = new Vector3Display(cursor);
            this.AddWindow(mVector3Display);
            mVector3Display.Y = .5f + mVector3Display.ScaleY;

            this.Closing += GuiManager.RemoveWindow;

            Button okButton = new Button(mCursor);
            AddWindow(okButton);
            const float border = .5f;
            okButton.Y = this.ScaleY * 2 - okButton.ScaleY - border;
            okButton.ScaleX = 3;
            okButton.Text = "Ok";
            okButton.Click += ShiftSceneOk;
        }
Пример #13
0
        // Methods
        public SpriteRigSaveOptions(GuiMessages messages, Cursor cursor)
            : base(cursor)
        {
            this.messages = messages;
            GuiManager.AddWindow(this);
            this.ScaleX = 13f;
            this.ScaleY = 17f;
            base.HasMoveBar = true;
            base.mName = "SpriteRig Options";
            base.HasCloseButton = true;

            TextDisplay tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Include:";
            tempTextDisplay.SetPositionTL(0.2f, 1.5f);

            this.sceneOrGroup = new ComboBox(mCursor);
            AddWindow(sceneOrGroup);
            this.sceneOrGroup.ScaleX = 8f;
            this.sceneOrGroup.SetPositionTL(10f, 3.5f);
            this.sceneOrGroup.Text = "Entire Scene";
            this.sceneOrGroup.AddItem("Current Group");
            this.sceneOrGroup.AddItem("Entire Scene");

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Body Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 6f);

            this.bodySpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(bodySpriteSelectionMethod);
            this.bodySpriteSelectionMethod.ScaleX = 8f;
            this.bodySpriteSelectionMethod.SetPositionTL(10f, 8.5f);
            this.bodySpriteSelectionMethod.Text = "Name Includes";
            this.bodySpriteSelectionMethod.AddItem("Name Includes");
            this.bodySpriteSelectionMethod.AddItem("By Texture");
            this.bodySpriteSelectionMethod.AddItem("All Not Joint");
            this.bodySpriteSelectionMethod.AddItem("All");
            this.bodySpriteSelectionMethod.ItemClick += new GuiMessage(this.bodySpriteSelectionMethodClicked);

            this.bodyAvailableTextures = new ComboBox(mCursor);
            AddWindow(bodyAvailableTextures);
            this.bodyAvailableTextures.ScaleX = 8f;
            this.bodyAvailableTextures.SetPositionTL(10f, 10.5f);
            this.bodyAvailableTextures.Visible = false;

            this.bodyNameToInclude = new TextBox(mCursor);
            AddWindow(bodyNameToInclude);
            this.bodyNameToInclude.ScaleX = 8f;
            this.bodyNameToInclude.SetPositionTL(10f, 10.5f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Joint Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 13f);

            this.jointSpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(jointSpriteSelectionMethod);
            this.jointSpriteSelectionMethod.ScaleX = 8f;
            this.jointSpriteSelectionMethod.SetPositionTL(10f, 15.5f);
            this.jointSpriteSelectionMethod.Text = "Name Includes";
            this.jointSpriteSelectionMethod.AddItem("Name Includes");
            this.jointSpriteSelectionMethod.AddItem("By Texture");
            this.jointSpriteSelectionMethod.AddItem("All Not Body");
            this.jointSpriteSelectionMethod.AddItem("All");
            this.jointSpriteSelectionMethod.ItemClick += new GuiMessage(this.jointSpriteSelectionMethodClicked);

            this.jointAvailableTextures = new ComboBox(mCursor);
            AddWindow(jointAvailableTextures);
            this.jointAvailableTextures.ScaleX = 8f;
            this.jointAvailableTextures.SetPositionTL(10f, 18f);
            this.jointAvailableTextures.Visible = false;

            this.jointNameToInclude = new TextBox(mCursor);
            AddWindow(jointNameToInclude);
            this.jointNameToInclude.ScaleX = 8f;
            this.jointNameToInclude.SetPositionTL(10f, 18f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Root Sprite:";
            tempTextDisplay.SetPositionTL(0.2f, 20);

            this.rootSpriteComboBox = new ComboBox(mCursor);
            AddWindow(rootSpriteComboBox);
            this.rootSpriteComboBox.ScaleX = 8f;
            this.rootSpriteComboBox.SetPositionTL(10f, 22.5f);
            this.rootSpriteComboBox.Text = "<No Root>";

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Sprite Visibility:";
            tempTextDisplay.SetPositionTL(0.2f, 25f);

            this.jointsVisible = new ToggleButton(mCursor);
            AddWindow(jointsVisible);
            this.jointsVisible.SetPositionTL(11f, 27f);
            this.jointsVisible.SetText("Joints Not Visible", "Joints Visible");
            this.jointsVisible.ScaleX = 7.5f;

            this.rootVisible = new ToggleButton(mCursor);
            AddWindow(rootVisible);
            this.rootVisible.SetPositionTL(11f, 29f);
            this.rootVisible.SetText("Root Not Visible", "Root Visible");
            this.rootVisible.ScaleX = 7.5f;

            this.okButton = new Button(mCursor);
            AddWindow(okButton);
            this.okButton.Text = "Save";
            this.okButton.ScaleX = 4.5f;
            this.okButton.ScaleY = 1.3f;
            this.okButton.SetPositionTL(5f, 32f);
            this.okButton.Click += new GuiMessage(this.saveButtonClick);

            this.cancelButton = new Button(mCursor);
            AddWindow(cancelButton);
            this.cancelButton.Text = "Cancel";
            this.cancelButton.ScaleX = 4.5f;
            this.cancelButton.ScaleY = 1.3f;
            this.cancelButton.SetPositionTL(16f, 32f);
            this.cancelButton.Click += new GuiMessage(this.cancelButtonClick);

            this.Visible = false;
        }
Пример #14
0
		void LoadNodeNetworkOk(Window callingWindow)
		{
			mNameOfNodeNetwork = ((FileWindow)callingWindow).Results[0];

			PropertyGrid<AxisFlippingSettings> axisFlippingSettings = GuiManager.AddPropertyGrid<AxisFlippingSettings>();
			axisFlippingSettings.HasCloseButton = true;
			axisFlippingSettings.SelectedObject = new AxisFlippingSettings();

			// when loading change the members
			axisFlippingSettings.SetMemberDisplayName("CopyYToZ", "CopyZToY");
			axisFlippingSettings.SetMemberDisplayName("FlipY", "Flip Y");
			axisFlippingSettings.SetMemberDisplayName("MakeYZero", "Set Z = 0");

			Button okButton = new Button(GuiManager.Cursor);
			okButton.Text = "Ok";
			okButton.ScaleX = 1.5f;
			okButton.Click += LoadNodeNetworkSettingsOk;
			okButton.Click += RemoveParentWindow;

			axisFlippingSettings.Closing += GuiManager.RemoveWindow;
			axisFlippingSettings.AddWindow(okButton);
		}
Пример #15
0
        void SaveNodeNetworkOk(Window callingWindow)
        {
            mNameOfNodeNetwork = ((FileWindow)callingWindow).Results[0];

            PropertyGrid<AxisFlippingSettings> axisFlippingSettings = new PropertyGrid<AxisFlippingSettings>(GuiManager.Cursor);
            axisFlippingSettings.HasCloseButton = false;
            axisFlippingSettings.Name = "Save Options:";
            GuiManager.AddDominantWindow(axisFlippingSettings);
            axisFlippingSettings.HasCloseButton = true;
            axisFlippingSettings.SelectedObject = new AxisFlippingSettings();

            Button okButton = new Button(GuiManager.Cursor);
            okButton.Text = "Save";
            okButton.ScaleX = 3f;
            okButton.ScaleY = 2;
            okButton.Click += SaveNodeNetworkSettingsOk;
            okButton.Click += RemoveParentWindow;

            axisFlippingSettings.Closing += GuiManager.RemoveWindow;
            axisFlippingSettings.AddWindow(okButton);

        }
Пример #16
0
        private void CreateButtons()
        {
            #region Consts used in button creation

            const float buttonScaleX = 2.0f;
            const float buttonScaleY = 1.5f;
            const float distanceBetweenButtons = .5f;
            const float buttonY = 5;

            #endregion

            int buttonsAddedSoFar = 0;

            #region To Start
            mToStart = new Button(mCursor);
            AddWindow(mToStart);
            mToStart.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\ToStartButton.png", FlatRedBallServices.GlobalContentManager), 
                null);
            mToStart.ScaleX = buttonScaleX;
            mToStart.ScaleY = buttonScaleY;
            mToStart.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX);
            mToStart.Y = buttonY;
            mToStart.Click += ToStartClick;
            buttonsAddedSoFar++;
            #endregion

            #region Play 

            mPlay = new ToggleButton(mCursor);
            AddWindow(mPlay);
            mPlay.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\PlayButton.png", FlatRedBallServices.GlobalContentManager), 
                null);
            mPlay.ScaleX = buttonScaleX;
            mPlay.ScaleY = buttonScaleY;
            mPlay.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX);
            mPlay.Y = buttonY;
            mPlay.Click += PlayClick;
            buttonsAddedSoFar++;

            #endregion

            #region Pause

            mPause = new ToggleButton(mCursor);
            AddWindow(mPause);
            mPause.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\PauseButton.png", FlatRedBallServices.GlobalContentManager),
                null);
            mPause.ScaleX = buttonScaleX;
            mPause.ScaleY = buttonScaleY;
            mPause.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX);
            mPause.Y = buttonY;
            mPause.Click += PauseClick;
            buttonsAddedSoFar++;

            #endregion

            mStop = new Button(mCursor);
            AddWindow(mStop);
            mStop.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\StopButton.png", FlatRedBallServices.GlobalContentManager),
                null);
            mStop.ScaleX = buttonScaleX;
            mStop.ScaleY = buttonScaleY;
            mStop.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX);
            mStop.Y = buttonY;
            mStop.Click += StopClick;
            buttonsAddedSoFar++;

            mLoadSong = new Button(mCursor);
            AddWindow(mLoadSong);
            mLoadSong.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\EjectButton.png", FlatRedBallServices.GlobalContentManager),
                null);
            mLoadSong.ScaleX = buttonScaleX;
            mLoadSong.ScaleY = buttonScaleY;
            mLoadSong.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX);
            mLoadSong.Y = buttonY;
            mLoadSong.Click += OpenSongWindow;
            buttonsAddedSoFar++;
        }
Пример #17
0
        /// <summary>
        /// Creates a new TimeLine;
        /// </summary>
        /// <param name="cursor">The Cursor that will interact with the TimeLine.</param>
        #endregion
        public TimeLine(Cursor cursor) : 
            base(cursor)
		{
			mMinimumValue = 0;
			mMaximumValue = double.PositiveInfinity;;
			mStart = 0;
			mValueWidth = 100;

            mScaleX = 10;
            mScaleY = 1.5f;

            positionBar = new Button(mCursor);
            AddWindow(positionBar);

			positionBar.ScaleX = .5f;
			positionBar.ScaleY = 1;
			positionBar.Dragging += new GuiMessage(PositionBarDrag);
			positionBar.SetPositionTL(0, ScaleY);

            positionBar.overlayTL = new FlatRedBall.Math.Geometry.Point(0, 225 / 256.0f);
            positionBar.overlayTR = new FlatRedBall.Math.Geometry.Point(1 / 256.0f, 225 / 256.0f);
            positionBar.overlayBL = new FlatRedBall.Math.Geometry.Point(1 / 256.0f, 226 / 256.0f);
            positionBar.overlayBR = new FlatRedBall.Math.Geometry.Point(0, 226 / 256.0f);

            positionBar.Name = "TimeLine position bar";

	
			SetBarToValue();

			this.Click += new GuiMessage(ClickEvent);
        }
Пример #18
0
        public ComboBox(Cursor cursor) : base(cursor)
        {
            #region Create the TextBox (mSelectionDisplay)
            mSelectionDisplay = new TextBox(mCursor);
            AddWindow(mSelectionDisplay);
			mSelectionDisplay.TakingInput = false;
            mSelectionDisplay.fixedLength = false;
            //mStretchListBoxToContentWidth = true;
            #endregion

            #region Create drop-down button

            mDropDownButton = new Button(mCursor);
            AddWindow(mDropDownButton);
            // Not sure why this is here.  Commented out July 31 2007
			//dropDownButton.mSprite.RotationZ = (float)System.Math.PI;
            mDropDownButton.ScaleX = .9f;
            
			mDropDownButton.Click += new GuiMessage(OnDropDownButtonClick);

            #endregion

            this.ScaleY = 1.4f;
			SelectedObject = null;
            this.ScaleX = 4;

            mListBox = new ListBox(mCursor);
            AddWindow(mListBox);
			this.RemoveWindow(mListBox); // just a quick way to have a list box initialized for us, but not keep it on this window
			mListBox.SetPositionTL(ScaleX, ScaleY + 2);
            mListBox.Visible = false;
			mListBox.ScrollBarVisible = false;
			mListBox.Click += new GuiMessage(OnListBoxClicked);


            MouseWheelScroll += OnMouseWheelScroll;
            mSelectionDisplay.MouseWheelScroll += OnMouseWheelScroll;
            mDropDownButton.MouseWheelScroll += OnMouseWheelScroll;
            mSelectionDisplay.LosingFocus += RaiseTextChange;
		}
Пример #19
0
        public Button AddButton()
        {
            Button button = new Button(mCursor);
            AddWindow(button);
            button.ScaleX = button.ScaleY = mChildrenButtonScale;
            SetPositionForNewUIElement(button);

            mButtons.Add(button);

            UpdateDimensions();

            return button;
        }
Пример #20
0
        /// <summary>
		/// Creates a new FileWindow.
		/// </summary>
		/// <remarks>
		/// By default, the save name TextBox is invisible making this a text box for loading.  Call
		/// SetToSave to make the box appear.
		/// </remarks>
		/// <param name="InpMan"></param>
		/// <param name="SprMan"></param>
		internal FileWindow(Cursor cursor) : 
            base(cursor)
        {
            #region Create the "settings" directory
            if (System.IO.Directory.Exists(ApplicationFolderForThisProgram + "settings") == false)
                System.IO.Directory.CreateDirectory(ApplicationFolderForThisProgram + "settings");
            #endregion

            #region Set "this" properties

            this.HasMoveBar = true;
			this.Closing += new GuiMessage(OnFileWindowClose);
			mScaleX = 20;
			mScaleY = 20;

            this.Resizable = true;
            this.Resizing += new GuiMessage(SetGUIPosition);
            this.OkClick += new GuiMessage(AddFileToRecent);
            this.Closing += OnClose;
            MinimumScaleX = 13;
            MinimumScaleY = 16;

            #endregion

            mFileTypes = new List<string>();

            #region Create the Texture display button

            mTextureDisplayButton = new Button(mCursor);
            AddWindow(mTextureDisplayButton);
            mTextureDisplayButton.ScaleY = 4;
            mTextureDisplayButton.ScaleX = 4;
            mTextureDisplayButton.Click += ShowChildTextureDisplayWindow;

            #endregion

            #region Create the Bookmark button

            mBookmarkToggleButton = new ToggleButton(mCursor);
            AddWindow(mBookmarkToggleButton);
            mBookmarkToggleButton.ScaleX = mBookmarkToggleButton.ScaleY = 1.3f;
            mBookmarkToggleButton.SetPositionTL(.5f + mBookmarkToggleButton.ScaleX, .5f + mBookmarkToggleButton.ScaleY);
            mBookmarkToggleButton.Click += BookmarkButtonClick;
            mBookmarkToggleButton.SetOverlayTextures(
                9, 3);

            #endregion

            #region CurrentDirectoryDisplay Combo Box
            mCurrentDirectoryDisplay = new ComboBox(mCursor);
            base.AddWindow(mCurrentDirectoryDisplay);
            mCurrentDirectoryDisplay.ItemClick += ChangeSelectedDirectory;
            mCurrentDirectoryDisplay.TextChange += ChangeSelectedDirectory;
            mCurrentDirectoryDisplay.AllowTypingInTextBox = true;
            ResetCurrentDirectoryComboBox();

            #endregion

            #region Create the ListBox

            mListBox = new ListBox(mCursor);
            AddWindow(mListBox);

            mListBox.SortingStyle = ListBoxBase.Sorting.None;
			mListBox.Highlight += new GuiMessage(OnListBoxClick);
			mListBox.StrongSelect += new GuiMessage(OnListBoxStrongSelect);
			mListBox.EscapeRelease += new GuiMessage(CloseFileWindow);
            mListBox.CurrentToolTipOption = ListBoxBase.ToolTipOption.CursorOver;

            #endregion

            #region Create the Ok Button

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
            mOkButton.Text = "Ok";
			mOkButton.Click += new GuiMessage(OkButtonClick);

            #endregion

            #region Create the Cancel button

            mCancelButton = new Button(mCursor);
            AddWindow(mCancelButton);
            mCancelButton.Text = "Cancel";
            mCancelButton.Click += OnCancelClick;

            #endregion

            #region Create the Load Directory Button

            loadDirectory = new Button(mCursor);
            AddWindow(loadDirectory);

            loadDirectory.Text = "Load Dir";
			loadDirectory.Click += new GuiMessage(LoadDirClick);
            loadDirectory.Visible = false;

            #endregion

            //#region Create the "Add" button

            //addButton = new Button(mCursor);
            //AddWindow(addButton);
            //addButton.ScaleX = 4;
            //addButton.ScaleY = 1.5f;
            //addButton.Text = "Add";
            //addButton.Click += new GuiMessage(AddButtonClick);
            //addButton.Visible = false;

            //#endregion

            #region Create the Up Directory button

            mUpDirectory = new Button(mCursor);
            AddWindow(mUpDirectory);

#if FRB_MDX
            // This is always null in the new engines - not sure how this button gets its texture.
			mUpDirectory.SetOverlayTextures(GuiManager.mUpDirectory, null);
#endif
			mUpDirectory.ScaleY = 1;
			mUpDirectory.ScaleX = 1;
            mUpDirectory.Text = "Up One Directory";
            
            mUpDirectory.overlayTL = new FlatRedBall.Math.Geometry.Point(0.38281250, 0.6445312500);
            mUpDirectory.overlayTR = new FlatRedBall.Math.Geometry.Point(0.42968750, 0.6445312500);
            mUpDirectory.overlayBL = new FlatRedBall.Math.Geometry.Point(0.38281250, 0.687500000);
            mUpDirectory.overlayBR = new FlatRedBall.Math.Geometry.Point(0.42968750, 0.687500000);

            mUpDirectory.Click += this.UpOneDirectoryClick;

            #endregion

            mCreateNewDirectory = new Button(mCursor);
            base.AddWindow(mCreateNewDirectory);
            mCreateNewDirectory.SetOverlayTextures(5, 3);
            mCreateNewDirectory.ScaleX = 1;
            mCreateNewDirectory.ScaleY = 1;
            mCreateNewDirectory.Text = "Create New\nDirectory";
            mCreateNewDirectory.Click += AddDirectoryClick;

            saveName = new TextBox(mCursor);
            AddWindow(saveName);
			saveName.ScaleY = 1.4f;
            saveName.Visible = false;
            saveName.fixedLength = false;
			saveName.EnterPressed += new GuiMessage(OnSaveNameEnter);
			saveName.EscapeRelease += new GuiMessage(CloseFileWindow);

            Name = "Loading File";

//			displayTextureLoadedBefore = false;


            mShowFileHierarchy = new ToggleButton(mCursor);
            AddWindow(mShowFileHierarchy);
			mShowFileHierarchy.SetPositionTL(7.0f, 4.5f);
			mShowFileHierarchy.ScaleX = 5.5f;
			mShowFileHierarchy.Text = "File Hierarchy";
            mShowFileHierarchy.SetOneAlwaysDown(true);
			mShowFileHierarchy.Click += new GuiMessage(OnFileHierarchyClick);

            mAllRelativeToggleButton = new ToggleButton(mCursor);
            AddWindow(mAllRelativeToggleButton);
			mAllRelativeToggleButton.SetPositionTL(7.0f, 6.5f);
			mAllRelativeToggleButton.ScaleX = 5.5f;
			mAllRelativeToggleButton.Text = "All Relative";
			mAllRelativeToggleButton.Click += new GuiMessage(OnAllRelativeClick);
			mAllRelativeToggleButton.SetOneAlwaysDown(true);
			mAllRelativeToggleButton.AddToRadioGroup(mShowFileHierarchy);

            mShowRecent = new ToggleButton(mCursor);
            AddWindow(mShowRecent);

            mShowRecent.SetPositionTL(19, 4.5f);
            mShowRecent.ScaleX = 5.5f;
            mShowRecent.Text = "Recent Files";
            mShowRecent.Click += new GuiMessage(OnShowRecent);
            mShowRecent.SetOneAlwaysDown(true);
            mShowRecent.AddToRadioGroup(mShowFileHierarchy);

            // go here!!!
			mShowFileHierarchy.Press();

            mFileTypeBox = new ComboBox(mCursor);
            AddWindow(mFileTypeBox);
            mFileTypeBox.ItemClick += OnFileTypeChange;

#if XBOX360 || WINDOWS_PHONE || MONODROID
            SetDirectory();

#else
            SetDirectory(FileManager.MyDocuments);
#endif


            SetGUIPosition(null);

            
            LoadBookmarks();
        }
        public KeyframeListSelectionWindow(Cursor cursor)
            : base(cursor)
        {
            #region This properties
            this.ScaleX = 10;
            this.ScaleY = 5;
            this.HasMoveBar = true;
            #endregion

            mObjectSelectionComboBox = this.AddComboBox();
            mObjectSelectionComboBox.ScaleX = this.ScaleX - 1;
            mObjectSelectionComboBox.X = ScaleX;
            mObjectSelectionComboBox.Y = 2;
            mObjectSelectionComboBox.ItemClick += SelectObject;

            mKeyframeListSelectionComboBox = this.AddComboBox();
            mKeyframeListSelectionComboBox.ScaleX = this.ScaleX - 1;
            mKeyframeListSelectionComboBox.X = ScaleX;
            mKeyframeListSelectionComboBox.Y = 5;
            mKeyframeListSelectionComboBox.ItemClick += SelectKeyframe;

            mOkButton = AddButton();
            mOkButton.Text = "Ok";
            mOkButton.X = 5.0f;
            mOkButton.ScaleX = 4.5f;
            mOkButton.Click += OnOkClick;
            mOkButton.Y = 8;
            mOkButton.Enabled = false;

            mCancelButton = AddButton();
            mCancelButton.Text = "Cancel";
            mCancelButton.X = 2 * this.ScaleX - 5.0f ;
            mCancelButton.ScaleX = 4.5f;
            mCancelButton.Y = 8;
            // Cancel closes the window.  Don't add this event to OK because it will be removed in the 
            // ok event.  The reason it's done that way is so that this Window's events aren't cleared.
            mCancelButton.Click += GuiManager.RemoveParentOfWindow; 

        }
        public ModelAnimationControlWindow(PositionedModel model)
            : base(GuiManager.Cursor)
        {
            // Set Window properties
            HasMoveBar = true;
            Resizable = true;
            HasCloseButton = true;
            
            // Set scaling
            ScaleX = 20f;

            // Add combo boxes
            mCurrentAnimation = new ComboBox(mCursor);
            AddWindow(mCurrentAnimation);

            mBlendAnimation = new ComboBox(mCursor);
            AddWindow(mBlendAnimation);

            mCurrentAnimation.ItemClick += new GuiMessage(mCurrentAnimation_ItemClick);
            mBlendAnimation.ItemClick += new GuiMessage(mBlendAnimation_ItemClick);

            // Add text
            mCurrentAnimationText = new TextDisplay(mCursor);
            AddWindow(mCurrentAnimationText);

            mBlendAnimationText = new TextDisplay(mCursor);
            AddWindow(mBlendAnimationText);

            mCurrentAnimationText.Text = "Current Animation";
            mBlendAnimationText.Text = "Blend Animation";

            // Blend controller
            mBlendController = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendController);
            mBlendController.ScaleX = 18f;
            mBlendController.MinimumValue = 0.0;
            mBlendController.MaximumValue = 1.0;
            mBlendController.Start = 0.0;
            mBlendController.ValueWidth = 1.0;
            mBlendController.VerticalBarIncrement = 0.1;
            mBlendController.CurrentValue = 0.0;
            mBlendController.GuiChange += new GuiMessage(mBlendController_onGUIChange);

            // Animation timings
            mAnimationTime = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mAnimationTime);
            mAnimationTime.ScaleX = 9f;
            mAnimationTime.VerticalBarIncrement = 0.2;
            mAnimationTime.SmallVerticalBarIncrement = 0.1;
            mAnimationTime.ValueWidth = 1;
            mAnimationTime.GuiChange += new GuiMessage(mAnimationTime_onGUIChange);

            mBlendTime = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendTime);
            mBlendTime.ScaleX = 9f;
            mBlendTime.VerticalBarIncrement = 0.2;
            mBlendTime.SmallVerticalBarIncrement = 0.1;
            mBlendTime.ValueWidth = 1;
            mBlendTime.GuiChange += new GuiMessage(mBlendTime_onGUIChange);

            // Animation speeds
            mAnimationSpeed = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mAnimationSpeed);
            mAnimationSpeed.ScaleX = 9f;
            mAnimationSpeed.MinimumValue = 0.0;
            mAnimationSpeed.MaximumValue = 2.0;
            mAnimationSpeed.Start = 0.0;
            mAnimationSpeed.ValueWidth = 2.0;
            mAnimationSpeed.VerticalBarIncrement = 0.5;
            mAnimationSpeed.SmallVerticalBarIncrement = 0.1;
            mAnimationSpeed.CurrentValue = 1.0;
            mAnimationSpeed.GuiChange += new GuiMessage(mAnimationSpeed_onGUIChange);

            mBlendSpeed = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendSpeed);
            mBlendSpeed.ScaleX = 9f;
            mBlendSpeed.MinimumValue = 0.0;
            mBlendSpeed.MaximumValue = 2.0;
            mBlendSpeed.Start = 0.0;
            mBlendSpeed.ValueWidth = 2.0;
            mBlendSpeed.VerticalBarIncrement = 0.5;
            mBlendSpeed.SmallVerticalBarIncrement = 0.1;
            mBlendSpeed.CurrentValue = 1.0;
            mBlendSpeed.GuiChange += new GuiMessage(mBlendSpeed_onGUIChange);

            mAnimationStopStart = new Button(GuiManager.Cursor);
            this.AddWindow(mAnimationStopStart);
            mAnimationStopStart.ScaleX = 5f;
            mAnimationStopStart.Text = "Stop";
            mAnimationStopStart.Click += new GuiMessage(mAnimationStopStart_Click);

            // Set scaling
            mCurrentAnimation.ScaleX = 9f;
            mBlendAnimation.ScaleX = 9f;
            mCurrentAnimationText.ScaleY = 1f;// mCurrentAnimation.ScaleY;
            mCurrentAnimationText.ScaleX = mCurrentAnimation.ScaleX;
            mBlendAnimationText.ScaleY = 1f;// mBlendAnimation.ScaleY;
            mBlendAnimationText.ScaleX = mBlendAnimation.ScaleX;

            ScaleY = mCurrentAnimationText.ScaleY + mCurrentAnimation.ScaleY +
                2f * mBlendController.ScaleY + 2f * mAnimationTime.ScaleY +
                2f * mAnimationSpeed.ScaleY + 2f * mAnimationStopStart.ScaleY +
                .5f;
            ScaleX = (mCurrentAnimation.ScaleX + mBlendAnimation.ScaleX) + 4.5f / 2f;

            PositionUIElements();

            Resizing += new GuiMessage(AnimationEditor_Resizing);

            // Add model
            PositionedModel = model;
        }
Пример #23
0
        public OkCancelWindow(Cursor cursor) : base(cursor)
		{


            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
			mOkButton.ScaleY = 1.2f;
            mOkButton.Text = "Ok";
			mOkButton.Click += new GuiMessage(OkButtonClicked);

            cancelButton = new Button(mCursor);
            AddWindow(cancelButton);
			cancelButton.ScaleY = 1.2f;
            cancelButton.Text = "Cancel";
			cancelButton.Click += new GuiMessage(CancelButtonClicked);
        }
Пример #24
0
        public ToolsWindow()
            : base()
        {
            #region Set managers and UI references
            this.messages = GuiData.messages;
            this.sesgMan = GameData.sesgMan;
            #endregion

            #region Set "this" properties
            base.SetPositionTL(106f, 5.8f);
            base.HasCloseButton = true;
            #endregion

            #region Move Button
            this.MoveButton = AddToggleButton();
            this.MoveButton.Text = "Move";
            this.MoveButton.SetOverlayTextures(2, 0);
            #endregion

            #region Scale Button
            this.ScaleButton = AddToggleButton();
            this.ScaleButton.Text = "Scale";
            this.MoveButton.AddToRadioGroup(this.ScaleButton);
            this.ScaleButton.SetOverlayTextures(1, 0);
            #endregion

            #region Rotate Button
            this.RotateButton = AddToggleButton();
            this.RotateButton.Text = "Rotate";
            this.MoveButton.AddToRadioGroup(this.RotateButton);
            this.RotateButton.SetOverlayTextures(0, 0);
            #endregion

            #region Attach Sprite

            this.attachSprite = base.AddToggleButton();
            this.attachSprite.Text = "Attach";
            this.MoveButton.AddToRadioGroup(this.attachSprite);
            this.attachSprite.SetOverlayTextures(7, 0);

            #endregion

            #region Detach Sprite

            this.detachSpriteButton = AddButton();
            this.detachSpriteButton.Text = "Detach";
            this.detachSpriteButton.Enabled = false;
            this.detachSpriteButton.SetOverlayTextures(10, 0);
            this.detachSpriteButton.Click += new GuiMessage(this.detachSprite);

            #endregion

            #region SetRootAsControlPoint
            this.setRootAsControlPoint = AddButton();
            this.setRootAsControlPoint.Text = "Set Root As Control Point";
            this.setRootAsControlPoint.Enabled = false;
            this.setRootAsControlPoint.SetOverlayTextures(12, 2);
            this.setRootAsControlPoint.Click += new GuiMessage(this.SetRootAsControlPointClick);
            #endregion

            #region Duplicate Objects

            this.mDuplicateObject = AddButton();
            this.mDuplicateObject.Text = "Duplicate";
            this.mDuplicateObject.SetOverlayTextures(9, 0);
            this.mDuplicateObject.Click += new GuiMessage(this.CopyCurrentObjects);

            #endregion

            #region Convert to SpriteGrid
            this.convertToSpriteGridButton = AddButton();
            this.convertToSpriteGridButton.Text = "Convert Sprite to SpriteGrid";
            this.convertToSpriteGridButton.SetOverlayTextures(2, 1);
            this.convertToSpriteGridButton.Enabled = false;
            this.convertToSpriteGridButton.Click += new GuiMessage(SpriteGridGuiMessages.ConvertToSpriteGridButtonClick);
            #endregion

            #region Convert to SpriteFrame

            this.convertToSpriteFrame = AddButton();
            this.convertToSpriteFrame.Text = "Convert Sprite to SpriteFrame";
            this.convertToSpriteFrame.SetOverlayTextures(1, 3);
            this.convertToSpriteFrame.Enabled = false;
            this.convertToSpriteFrame.Click += new GuiMessage(GameData.sfMan.ConvertToSpriteFrameClick);

            #endregion

            #region Paint Button
            this.paintButton = AddToggleButton();
            this.paintButton.Text = "Paint";
            this.paintButton.SetOverlayTextures(5, 1);
            this.MoveButton.AddToRadioGroup(this.paintButton);
            this.paintButton.Click += new GuiMessage(this.PaintButtonClicked);

            #endregion

            #region Current Texture Display

            this.currentTextureDisplay = AddButton();
            this.currentTextureDisplay.Text = "";
            this.currentTextureDisplay.Click += new GuiMessage(FileButtonWindow.openFileWindowLoadTexture);

            #endregion

            #region eyedropper

            this.eyedropper = AddToggleButton();
            this.eyedropper.Text = "Eyedropper Tool";
            this.eyedropper.SetOverlayTextures(8, 1);
            this.MoveButton.AddToRadioGroup(this.eyedropper);

            #endregion

            #region Brush size

            this.brushSize = new ComboBox(mCursor);
            AddWindow(brushSize);
            this.brushSize.SetPositionTL(4.2f, 12.5f);
            this.brushSize.ScaleY = 1.3f;
            this.brushSize.ScaleX = 3.8f;
            this.brushSize.AddItem("1X1");
            this.brushSize.AddItem("3X3");
            this.brushSize.AddItem("5X5");
            this.brushSize.Text = "1X1";
            this.brushSize.ExpandOnTextBoxClick = true;

            #endregion

            this.constrainDimensions = base.AddToggleButton();
            this.constrainDimensions.SetPositionTL(constrainDimensions.X, 15.5f);
            this.constrainDimensions.Text = "Constrain Dim.";
            this.constrainDimensions.SetOverlayTextures(5, 0);

            #region Group/Hierarchy Button
            this.groupHierarchyControlButton = base.AddToggleButton();
            this.groupHierarchyControlButton.SetText("Group Control", "Hierarchy Control");
            this.groupHierarchyControlButton.SetOverlayTextures(3, 0, 4, 0);
            #endregion


            this.mSnapSprite = base.AddToggleButton();
            this.mSnapSprite.Text = "Sprite Snapping";
            this.mSnapSprite.SetOverlayTextures(6, 0);

            #region DownZFreeRotateButton

            this.mDownZFreeRotateButton = base.AddToggleButton();


            mDownZFreeRotateButton.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Content\DownZ.png", FlatRedBallServices.GlobalContentManager),
                FlatRedBallServices.Load<Texture2D>(@"Content\FreeRotation.png", FlatRedBallServices.GlobalContentManager));
            

            #endregion

            this.MinimumScaleX = this.ScaleX;
            this.MinimumScaleY = this.ScaleY;
        }
Пример #25
0
        public EmitterListBoxWindow(GuiMessages messages) : base(GuiManager.Cursor)
		{
			#region this Properties
			GuiManager.AddWindow(this);
			SetPositionTL(95.3f, 17.6167374f);
			ScaleX = 15;
			ScaleY = 12;

            MinimumScaleX = 12.5f;
            MinimumScaleY = 7;

			HasCloseButton = true;
			mMoveBar = true;
			mName = "Emitters";
            Resizable = true;
            Resizing += PositionAndScaleChildrenWindows;
			#endregion		

            mListDisplayWindow = new ListDisplayWindow(mCursor);
            this.AddWindow(mListDisplayWindow);
            mListDisplayWindow.DrawOuterWindow = false;
            mListDisplayWindow.ListBox.Highlight += new GuiMessage(messages.EmitterArrayListBoxClick);
            mListDisplayWindow.AllowCopy = true;
            mListDisplayWindow.AfterItemsPasted += new GuiMessage(mListDisplayWindow_AfterItemsPasted);
            mListDisplayWindow.ListBox.FocusUpdate += FocusUpdate;
            mListDisplayWindow.AllowReordering = true;

            addEmitter = new Button(mCursor);
            AddWindow(addEmitter);
			addEmitter.Text = "Add Emitter";
			addEmitter.Click += new GuiMessage(addEmitterClick);

            deleteEmitter = new Button(mCursor);
            AddWindow(deleteEmitter);
			deleteEmitter.Text = "Delete Emitter";
			deleteEmitter.Click += new GuiMessage(DeleteEmitterClick);

            PositionAndScaleChildrenWindows(null);
        }
Пример #26
0
        private static void ShowAssemblyPropertyGrid(Window callingWindow)
        {
            PropertyGrid<Assembly> propertyGrid = callingWindow as PropertyGrid<Assembly>;

            //EditorData.EditorLogic.CurrentAssembly = propertyGrid.SelectedObject;

            Button showTypes = new Button(GuiManager.Cursor);
            showTypes.Text = "Show Types";
            showTypes.ScaleX = 5;
            showTypes.Click += ClickShowAssemblyTypes;

            propertyGrid.AddWindow(showTypes);
        }
Пример #27
0
        void ScaleAllPolygons(Window callingWindow)
        {
            Window polyScaleWindow = GuiManager.AddWindow();
            polyScaleWindow.Name = "Scale All Polygons";
            polyScaleWindow.ScaleX = 10f;
            polyScaleWindow.ScaleY = 4f;
            polyScaleWindow.HasMoveBar = true;
            polyScaleWindow.HasCloseButton = true;

            UpDown scaleBox = new UpDown(mCursor);
            polyScaleWindow.AddWindow(scaleBox);
            scaleBox.Name = "scale";
            scaleBox.CurrentValue = 1f;
            scaleBox.ScaleX = 9f;
            scaleBox.X = 10f;
            scaleBox.Y = Window.MoveBarHeight;

            Button okButton = new Button(mCursor);
            polyScaleWindow.AddWindow(okButton);
            okButton.Text = "Set Scale";
            okButton.ScaleX = 9f;
            okButton.X = 10f;
            okButton.Y = scaleBox.Y + scaleBox.ScaleY * 2f;
            okButton.Click += ScalePolygonsOK;
        }
Пример #28
0
        public FileTextBox(Cursor cursor)
            : base(cursor)
        {
            mTextBox = new TextBox(mCursor);
            AddWindow(mTextBox);
            mTextBox.fixedLength = false;

            mButton = new Button(mCursor);
            AddWindow(mButton);
            mButton.Text = "...";
            mButton.ScaleX = .9f;
            mButton.Click += OpenFileWindow;

            this.ScaleY = 1.4f;

            ScaleX = 8;
        }
Пример #29
0
        private static ListDisplayWindow CreateListDisplayWindowForObject(object objectToCreateWindowFor)
        {
            ListDisplayWindow listDisplayWindow = new ListDisplayWindow(GuiManager.Cursor);
            GuiManager.AddWindow(listDisplayWindow);
            listDisplayWindow.HasMoveBar = true;
            listDisplayWindow.HasCloseButton = true;
            listDisplayWindow.Resizable = true;
            listDisplayWindow.ListShowing = mObjectToSerialize as IEnumerable;
            listDisplayWindow.Closing += GuiManager.RemoveWindow;

//            listDisplayWindow.EnableAddingToList();

            Button saveButton = new Button(GuiManager.Cursor);
            saveButton.Text = "Save Object as XML";
            saveButton.ScaleX = 9f;
            saveButton.Click += XmlSeralizeObject;
            listDisplayWindow.AddWindow(saveButton);

            Button loadButton = new Button(GuiManager.Cursor);
            loadButton.Text = "Load Object from XML";
            loadButton.ScaleX = 9f;
            loadButton.Click += XmlDeserializeObject;
            listDisplayWindow.AddWindow(loadButton);



            listDisplayWindow.MinimumScaleX = 10;

            return listDisplayWindow;
        }
        public TextureCoordinatesSelectionWindow() : 
            base(GuiManager.Cursor)
        {
            // Victor says:  This class USED to
            // add itself to the GuiManager.  This
            // is no longer recommended as it makes
            // windows not as reusable.  Therefore, I
            // removed the automatic adding to the GuiManager.
            // This might break your code if you're using this,
            // so if your TextureCoordinatesSelectionWindow isn't
            // showing up, you might want to make sure you're adding
            // it to the GuiManager.

            #region Create "this" and add it to the GuiManager
            HasMoveBar = true;
            ScaleY = 12.5f;
            ScaleX = 11.4f;

            Resizable = true;
            MinimumScaleX = ScaleX;
            MinimumScaleY = ScaleY;

            this.Resizing += OnWindowResize;
            #endregion

            #region Create the texture display area

            mTextureDisplayArea = new Window(mCursor);
            AddWindow(mTextureDisplayArea);

            mTextureDisplayArea.DrawBorders = false;
            mTextureDisplayArea.Push += OnWindowPush;
            mTextureDisplayArea.Dragging += OnWindowDrag;
            mTextureDisplayArea.Click += OnWindowClick;
            mTextureDisplayArea.RollingOver += this.OnRollOver;
            mTextureDisplayArea.DoubleClick += OnWindowDoubleClick;

            mTextureDisplayArea.MouseWheelScroll += MouseWheelZoom;

            mTextureDisplayArea.SecondaryClick += RightClickMenu;

            #endregion

            mSelectedArea = new Window(mCursor);
            mTextureDisplayArea.AddWindow(mSelectedArea);
            mSelectedArea.ScaleX = 3;
            mSelectedArea.ScaleY = 3;
            mSelectedArea.BaseTexture = 
                FlatRedBallServices.Load<Texture2D>("genGfx/targetBox.bmp", GuiManager.InternalGuiContentManagerName);
            mSelectedArea.Enabled = false; // so it doesn't block input from the this (the parent Window)
            mSelectedArea.DrawBorders = false;
            mSelectedArea.Alpha = 127;

            mAddToListButton = new Button(mCursor);
            AddWindow(mAddToListButton);
            mAddToListButton.Text = "Add To List";
            mAddToListButton.Visible = false;

            #region Pixel Perfect ToggleButton and ComboBoxes

            mPixelPerfect = new ToggleButton(mCursor);
            AddWindow(mPixelPerfect);

            mPixelPerfect.ScaleX = 5;
            mPixelPerfect.SetText("Free", "Snapping");
            mPixelPerfect.Press();
            mPixelPerfect.Click += PixelPerfectClick;

            mMinimumXSelection = new ComboBox(mCursor);
            AddWindow(mMinimumXSelection);
            mMinimumXSelection.ScaleX = 3;
            mMinimumXSelection.AddItem("1");
            mMinimumXSelection.AddItem("4");
            mMinimumXSelection.AddItem("8");
            mMinimumXSelection.AddItem("16");
            mMinimumXSelection.AddItem("32");
            mMinimumXSelection.Text = "1";

            mMinimumYSelection = new ComboBox(mCursor);
            AddWindow(mMinimumYSelection);
            mMinimumYSelection.ScaleX = 3;
            mMinimumYSelection.AddItem("1");
            mMinimumYSelection.AddItem("4");
            mMinimumYSelection.AddItem("8");
            mMinimumYSelection.AddItem("16");
            mMinimumYSelection.AddItem("32");
            mMinimumYSelection.Text = "1";

            #endregion

            #region Create the ScrollBars
            mVerticalScrollBar = new ScrollBar(mCursor);
            AddWindow(mVerticalScrollBar);
            mVerticalScrollBar.UpButtonClick += AdjustToVerticalScrollBar;
            mVerticalScrollBar.DownButtonClick += AdjustToVerticalScrollBar;
            mVerticalScrollBar.PositionBarMove += AdjustToVerticalScrollBar;

            mHorizontalScrollBar = new ScrollBar(mCursor);
            AddWindow(mHorizontalScrollBar);
            mHorizontalScrollBar.UpButtonClick += AdjustToVerticalScrollBar;
            mHorizontalScrollBar.DownButtonClick += AdjustToVerticalScrollBar;
            mHorizontalScrollBar.PositionBarMove += AdjustToVerticalScrollBar;
            mHorizontalScrollBar.Alignment = ScrollBar.ScrollBarAlignment.Horizontal;
            mHorizontalScrollBar.ScaleY = 1;
            #endregion

            OnWindowResize(this);
        }