Menu will open with right click instead of space bar now, space bar will do fullscreen ss instead, right click can still cancel region drawing

This commit is contained in:
Jaex 2016-05-04 15:35:34 +03:00
parent d5c21ebdf2
commit b82ec96b95
3 changed files with 9 additions and 12 deletions

View file

@ -461,6 +461,7 @@ protected virtual void WriteTips(StringBuilder sb)
switch (AreaManager.CurrentShapeType)
{
case ShapeType.RegionRoundedRectangle:
case ShapeType.DrawingRoundedRectangle:
sb.AppendLine(Resources.RectangleRegion_WriteTips__Numpad___or____Change_rounded_rectangle_corner_radius);
break;
case ShapeType.RegionTriangle:

View file

@ -181,6 +181,9 @@ private void Surface_KeyUp(object sender, KeyEventArgs e)
case Keys.Escape:
Close(SurfaceResult.Close);
break;
case Keys.Space:
Close(SurfaceResult.Fullscreen);
break;
case Keys.Enter:
Close(SurfaceResult.Region);
break;

View file

@ -166,13 +166,6 @@ public AreaManager(RectangleRegionForm surface)
private void CreateContextMenu()
{
cmsContextMenu = new ContextMenuStrip();
cmsContextMenu.KeyDown += (sender, e) =>
{
if (e.KeyCode == Keys.Space)
{
cmsContextMenu.Close();
}
};
foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
{
@ -405,9 +398,6 @@ private void surface_KeyDown(object sender, KeyEventArgs e)
break;
}
break;
case Keys.Space:
cmsContextMenu.Show(Cursor.Position.X, Cursor.Position.Y);
break;
}
}
@ -595,12 +585,14 @@ private void surface_MouseUp(object sender, MouseEventArgs e)
}
else if (e.Button == MouseButtons.Right)
{
CancelRegionSelection();
if (IsCreating)
{
EndRegionSelection();
}
else
{
cmsContextMenu.Show(surface, e.Location);
}
}
}
@ -683,6 +675,7 @@ private void EndRegionSelection()
private void CancelRegionSelection()
{
// TODO
BaseShape shape = AreaIntersect();
if (shape != null)