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"; }
/// <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 TimeControlWindow() : base(GuiManager.Cursor) { GuiManager.AddWindow(this); SetPositionTL(11.5f, 72.6f); ScaleX = 11.5f; ScaleY = 1.95f; HasMoveBar = true; Name = "Time Controls"; toStartButton = AddButton(); toStartButton.SetPositionTL(1.9f, 1.9f); toStartButton.ScaleX = 1.5f; toStartButton.ScaleY = 1.5f; toStartButton.SetOverlayTextures(10, 1); toStartButton.Text = "To Start of Instruction Set"; toStartButton.Click += new GuiMessage(ToStartPushed); stopButton = AddButton(); stopButton.SetPositionTL(11.5f, 1.9f); stopButton.ScaleX = 1.5f; stopButton.ScaleY = 1.5f; stopButton.SetOverlayTextures(11, 1); stopButton.Text = "Stop"; stopButton.Click += new GuiMessage(StopPushed); playButton = AddToggleButton(); playButton.SetPositionTL(14.7f, 1.9f); playButton.ScaleX = 1.5f; playButton.ScaleY = 1.5f; playButton.SetOverlayTextures(9, 1); playButton.Text = "Play"; playButton.Click += new GuiMessage(PlayPushed); mCycleButton = AddToggleButton(); mCycleButton.SetPositionTL(17.9f, 1.9f); mCycleButton.ScaleX = 1.5f; mCycleButton.ScaleY = 1.5f; mCycleButton.SetOverlayTextures(8, 3); mCycleButton.SetText("Cycle Off", "Cycle On"); }
private static void ShowSpriteRigOptionsFileWindow(Window callingWindow) { FileWindow tempFileWindow = GuiManager.AddFileWindow(); tempFileWindow.Filter = "XML SpriteRig (*.srgx)|*.srgx"; tempFileWindow.CurrentFileType = "srgx"; tempFileWindow.SetToSave(); tempFileWindow.OkClick += new GuiMessage(saveSpriteRig); ToggleButton relativeToggle = new ToggleButton(GuiManager.Cursor); tempFileWindow.AddWindow(relativeToggle); relativeToggle.Name = "scnRelativeAssets"; relativeToggle.SetText("Not .scn-relative assets", ".scn-relative assets"); relativeToggle.ScaleX = 9f; relativeToggle.SetPositionTL(22.5f, 6.5f); if (mAssetsRelativeToSpriteRig) { relativeToggle.Press(); } else { relativeToggle.Unpress(); } }
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); }