//public static void CreatePixelCoordinateUi(PropertyGrid propertyGrid, // string topProperty, string bottomProperty, string leftProperty, string rightProperty) //{ // UpDown throwaway; // CreatePixelCoordinateUi(propertyGrid, topProperty, bottomProperty, leftProperty, rightProperty, // out throwaway, out throwaway, out throwaway, out throwaway); //} public static void CreatePixelCoordinateUi(PropertyGrid propertyGrid, string topProperty, string bottomProperty, string leftProperty, string rightProperty, string category, out UpDown topPixel, out UpDown leftPixel, out UpDown heightPixel, out UpDown widthPixel) { propertyGrid.ExcludeMember(topProperty); propertyGrid.ExcludeMember(bottomProperty); propertyGrid.ExcludeMember(leftProperty); propertyGrid.ExcludeMember(rightProperty); leftPixel = new UpDown(GuiManager.Cursor); leftPixel.ScaleX = 7; leftPixel.Precision = 0; propertyGrid.AddWindow(leftPixel, category); propertyGrid.SetLabelForWindow(leftPixel, "Left Pixel"); topPixel = new UpDown(GuiManager.Cursor); topPixel.ScaleX = 7; topPixel.Precision = 0; propertyGrid.AddWindow(topPixel, category); propertyGrid.SetLabelForWindow(topPixel, "Top Pixel"); widthPixel = new UpDown(GuiManager.Cursor); widthPixel.ScaleX = 7; widthPixel.Precision = 0; propertyGrid.AddWindow(widthPixel, category); propertyGrid.SetLabelForWindow(widthPixel, "Pixel Width"); heightPixel = new UpDown(GuiManager.Cursor); heightPixel.ScaleX = 7; heightPixel.Precision = 0; propertyGrid.AddWindow(heightPixel, category); propertyGrid.SetLabelForWindow(heightPixel, "Pixel Height"); }
public CameraBoundsPropertyGrid(Camera camera) : base(GuiManager.Cursor) { #region Set "this" properties GuiManager.AddWindow(this); HasCloseButton = true; Name = "Camera Bounds"; this.SelectedObject = camera; this.ExcludeMember("NearClipPlane"); this.ExcludeMember("FarClipPlane"); RemoveCategory("Clip Plane"); #endregion #region SetMemberChangeEvent to update the bounds on any UI change SetMemberChangeEvent("X", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("Y", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("Z", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("Orthogonal", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("FieldOfView", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("AspectRatio", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("OrthogonalWidth", new GuiMessage(UpdateBoundsEvent)); SetMemberChangeEvent("OrthogonalHeight", new GuiMessage(UpdateBoundsEvent)); UsePixelCoordinatesClick += UpdateBoundsEvent; #endregion #region Create the camera bounds mCameraBounds = new EditorObjects.CameraBounds(camera); mCameraBounds.Visible = true; #endregion //mBoundsOptions = new ComboBox(mCursor); //mBoundsOptions.ScaleX = 7; //this.AddWindow(mBoundsOptions, "Size"); //mBoundsOptions.AddItem("Default 2D"); //mBoundsOptions.AddItem("Default 3D"); //SetLabelForWindow(mBoundsOptions, "Setting"); IncludeMember("Orthogonal", "Size"); IncludeMember("OrthogonalWidth", "Size"); IncludeMember("OrthogonalHeight", "Size"); IncludeMember("FieldOfView", "Size"); IncludeMember("AspectRatio", "Size"); ShowDestinationRectangle(true); ShowCameraConfigurations("Size"); IncludeMember("X", "Position"); IncludeMember("Y", "Position"); IncludeMember("Z", "Position"); mTargetZUpDown = new UpDown(mCursor); this.AddWindow(mTargetZUpDown, "Position"); this.SetLabelForWindow(mTargetZUpDown, "Target Z"); mTargetZUpDown.ValueChanged += new GuiMessage(ChangeTargetZ); RemoveCategory("Uncategorized"); UpdateBounds(); }
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; }
public Vector3Display(Cursor cursor) : base(cursor) { float border = .5f; this.ScaleX = 6f; this.ScaleY = 3.5f; #region Create the UpDowns and set their static properties mXUpDown = new UpDown(mCursor); AddWindow(mXUpDown); mYUpDown = new UpDown(mCursor); AddWindow(mYUpDown); mZUpDown = new UpDown(mCursor); AddWindow(mZUpDown); mWUpDown = new UpDown(mCursor); AddWindow(mWUpDown); mXUpDown.Y = border + 1; mYUpDown.Y = border + 3; mZUpDown.Y = border + 5; mWUpDown.Y = border + 7; mXUpDown.ValueChanged += OnValueChanged; mYUpDown.ValueChanged += OnValueChanged; mZUpDown.ValueChanged += OnValueChanged; mWUpDown.ValueChanged += OnValueChanged; mXUpDown.LosingFocus += ComponentLosingFocus; mYUpDown.LosingFocus += ComponentLosingFocus; mZUpDown.LosingFocus += ComponentLosingFocus; mWUpDown.LosingFocus += ComponentLosingFocus; mXUpDown.AfterValueChanged += OnAfterValueChanged; mYUpDown.AfterValueChanged += OnAfterValueChanged; mZUpDown.AfterValueChanged += OnAfterValueChanged; mWUpDown.AfterValueChanged += OnAfterValueChanged; mXUpDown.FocusUpdate += OnFocusUpdateInternal; mYUpDown.FocusUpdate += OnFocusUpdateInternal; mZUpDown.FocusUpdate += OnFocusUpdateInternal; mWUpDown.FocusUpdate += OnFocusUpdateInternal; mXUpDown.GainFocus += OnGainFocusInternal; mYUpDown.GainFocus += OnGainFocusInternal; mZUpDown.GainFocus += OnGainFocusInternal; mWUpDown.GainFocus += OnGainFocusInternal; #endregion #region Create the TextDisplays and set their static properties mXDisplay = new TextDisplay(mCursor); AddWindow(mXDisplay); mYDisplay = new TextDisplay(mCursor); AddWindow(mYDisplay); mZDisplay = new TextDisplay(mCursor); AddWindow(mZDisplay); mWDisplay = new TextDisplay(mCursor); AddWindow(mWDisplay); mXDisplay.Text = "X:"; mYDisplay.Text = "Y:"; mZDisplay.Text = "Z:"; mWDisplay.Text = "W:"; mXDisplay.X = 0f; mYDisplay.X = 0f; mZDisplay.X = 0f; mWDisplay.X = 0f; mXDisplay.Y = mXUpDown.Y; mYDisplay.Y = mYUpDown.Y; mZDisplay.Y = mZUpDown.Y; mWDisplay.Y = mWUpDown.Y; #endregion float spaceForDisplay = 1; #region Set the UpDown ScaleX values mXUpDown.ScaleX = this.ScaleX - border - spaceForDisplay; mYUpDown.ScaleX = this.ScaleX - border - spaceForDisplay; mZUpDown.ScaleX = this.ScaleX - border - spaceForDisplay; mWUpDown.ScaleX = this.ScaleX - border - spaceForDisplay; #endregion mXUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX; mYUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX; mZUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX; mWUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX; NumberOfComponents = 3; }