UltimateZoneBuilder/Source/Core/Windows/CenterOnCoordinatesForm.cs
MaxED ab7d4b2054 Renamed "Save Screenshot (editing area only)" action to "Save Screenshot (active window)". It will now save a screenshot of currently active window, or editing area if no windows are open.
Added icons for "Save Screenshot" menu items.
Development: "Save Screenshot (active window)" action will work on a child Form only if it is inherited from DelayedForm.
2014-10-22 13:07:17 +00:00

34 lines
1.1 KiB
C#

using System;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Geometry;
namespace CodeImp.DoomBuilder.Windows
{
public partial class CenterOnCoordinatesForm : DelayedForm
{
private static Vector2D coordinates;
public Vector2D Coordinates { get { return coordinates; } }
public CenterOnCoordinatesForm()
{
InitializeComponent();
gotox.Text = coordinates.x.ToString();
gotoy.Text = coordinates.y.ToString();
}
private void accept_Click(object sender, EventArgs e)
{
coordinates.x = (float)Math.Round(General.Clamp(gotox.GetResult((int)coordinates.x), General.Map.FormatInterface.MinCoordinate, General.Map.FormatInterface.MaxCoordinate));
coordinates.y = (float)Math.Round(General.Clamp(gotoy.GetResult((int)coordinates.y), General.Map.FormatInterface.MinCoordinate, General.Map.FormatInterface.MaxCoordinate));
this.DialogResult = DialogResult.OK;
this.Close();
}
private void cancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}