AddToRadioGroup() public méthode

public AddToRadioGroup ( ToggleButton buttonToAdd ) : void
buttonToAdd ToggleButton
Résultat void
Exemple #1
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
		}
Exemple #2
0
        public ToolsWindow()
            : base()
        {
            this.mMoveButton = AddToggleButton(Keys.M);
            this.mMoveButton.Text = "Move";
            this.mMoveButton.SetOverlayTextures(2, 0);

            Texture2D findPathTexture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\FindPathTo.png", "Global");

            mFindPathToNodeButton = AddToggleButton(Keys.F);
            mFindPathToNodeButton.Text = "Find Path To Node";
            mFindPathToNodeButton.SetOverlayTextures(findPathTexture, null);
            mFindPathToNodeButton.Push += FindPathToNodeButtonPress;
            
            mMoveButton.AddToRadioGroup(mFindPathToNodeButton);


        }
Exemple #3
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();
        }
Exemple #4
0
        public ToolsWindow()
            : base()
        {
            #region Move button

            this.mMoveButton = AddToggleButton(Keys.M);
            this.mMoveButton.Text = "Move";
            this.mMoveButton.SetOverlayTextures(2, 0);

            #endregion

            #region Scale button

            this.mScaleButton = AddToggleButton(Keys.X);
            this.mScaleButton.Text = "Scale";
            this.mMoveButton.AddToRadioGroup(this.mScaleButton);
            this.mScaleButton.SetOverlayTextures(1, 0);

            #endregion

            #region Rotate Btton

            this.mRotateButton = AddToggleButton(Keys.R);
            this.mRotateButton.Text = "Rotate";
            this.mMoveButton.AddToRadioGroup(this.mRotateButton);
            this.mRotateButton.SetOverlayTextures(0, 0);

            #endregion

            #region Add Point to current Polygon

            mAddPointButton = AddToggleButton(Keys.A);
            mAddPointButton.Text = "Add Point";
            mMoveButton.AddToRadioGroup(mAddPointButton);
            mAddPointButton.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Assets\UI\AddPoint.png"), null);

            #endregion

            #region Draw Polygon

            mDrawPolygonToggleButton = AddToggleButton();
            mDrawPolygonToggleButton.Text = "Draw new Polygon";
            mMoveButton.AddToRadioGroup(mDrawPolygonToggleButton);
            mDrawPolygonToggleButton.SetOverlayTextures(
                FlatRedBallServices.Load<Texture2D>(@"Assets\UI\DrawPolygon.png"), null);


            #endregion

            this.X = SpriteManager.Camera.XEdge * 2 - this.ScaleX;
            this.Y = 9.0f;
        }