public ChatWindow(Cursor cursor) : base(cursor) { mListBox = new ListBox(mCursor); AddWindow(mListBox); mTextBox = new TextBox(mCursor); AddWindow(mTextBox); mTextBox.EnterPressed += TextBoxEnter; Resizing += ResizeEvent; ScaleX = 5; ScaleY = 5; }
// 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; }
private void CreateTextBox() { mSongLabel = new TextBox(mCursor); AddWindow(mSongLabel); mSongLabel.TakingInput = false; mSongLabel.ScaleX = 12; mSongLabel.X = 12.5f; mSongLabel.Y = 2; }
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; }
/// <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 void CreateTextBoxes() { this.SetScaleTL(10.5f, 6); mATextBox = new TextBox(mCursor); AddWindow(mATextBox); mRTextBox = new TextBox(mCursor); AddWindow(mRTextBox); mGTextBox = new TextBox(mCursor); AddWindow(mGTextBox); mBTextBox = new TextBox(mCursor); AddWindow(mBTextBox); mATextBox.Format = TextBox.FormatTypes.Decimal; mRTextBox.Format = TextBox.FormatTypes.Decimal; mGTextBox.Format = TextBox.FormatTypes.Decimal; mBTextBox.Format = TextBox.FormatTypes.Decimal; mATextBox.LosingFocus += new GuiMessage(OnTextBoxValueChange); mRTextBox.LosingFocus += new GuiMessage(OnTextBoxValueChange); mGTextBox.LosingFocus += new GuiMessage(OnTextBoxValueChange); mBTextBox.LosingFocus += new GuiMessage(OnTextBoxValueChange); float textBoxX = 17f; mATextBox.X = textBoxX; mRTextBox.X = textBoxX; mGTextBox.X = textBoxX; mBTextBox.X = textBoxX; float textBoxScaleX = 3; mATextBox.ScaleX = textBoxScaleX; mRTextBox.ScaleX = textBoxScaleX; mGTextBox.ScaleX = textBoxScaleX; mBTextBox.ScaleX = textBoxScaleX; mATextBox.Y = mASlider.Y; mRTextBox.Y = mRSlider.Y; mGTextBox.Y = mGSlider.Y; mBTextBox.Y = mBSlider.Y; }
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(); }
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; }
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 }
public UpDown(Cursor cursor) : base(cursor) { if (GuiManager.guiTexture == null) { throw new System.NullReferenceException("GuiTexture not set - cannot add UpDown"); } mScaleX = 4.2f; mScaleY = 1.3f; MaxValue = float.PositiveInfinity; MinValue = float.NegativeInfinity; mCurrentValue = 0; mChange = 0; Sensitivity = .1f; mUpDownButton = new Button(mCursor); AddWindow(mUpDownButton); mUpDownButton.SetPositionTL(ScaleX + 2.2f, ScaleY); mUpDownButton.ScaleX = .6f; mUpDownButton.ScaleY = 1; mUpDownButton.MouseWheelScroll += MouseWheelEvent; mTextBox = new TextBox(mCursor); AddWindow(mTextBox); mTextBox.SetPositionTL(ScaleX - 1.0f, ScaleY); mTextBox.ScaleX = 2.8f; mTextBox.Format = TextBox.FormatTypes.Decimal; mTextBox.Text = mCurrentValue.ToString(); mTextBox.MouseWheelScroll += MouseWheelEvent; SetInternalEvents(); //this.onLosingFocus += new GuiMessage(textBoxChangeValue); }