Improved selected object editor panel

issue: MatterHackers/MCCentral#3536
Consider if Object3D items should have coupling to MatterControl
This commit is contained in:
Lars Brubaker 2018-06-07 18:16:16 -07:00
parent 01eeff3544
commit 91ff0d4a88
3 changed files with 37 additions and 15 deletions

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using System;
namespace MatterHackers.MatterControl.CustomWidgets
{
@ -49,6 +50,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.SpliterBarColor = theme.SplitterBackground;
}
public event EventHandler Resized;
public Color SpliterBarColor { get; set; }
public int SplitterHeight
@ -65,6 +67,11 @@ namespace MatterHackers.MatterControl.CustomWidgets
}
}
protected virtual void OnResized(EventArgs e)
{
this.Resized?.Invoke(this, e);
}
public override void OnDraw(Graphics2D graphics2D)
{
graphics2D.FillRectangle(LocalBounds.Left, LocalBounds.Bottom, LocalBounds.Right, LocalBounds.Bottom + this.SplitterHeight, this.SpliterBarColor);
@ -106,6 +113,13 @@ namespace MatterHackers.MatterControl.CustomWidgets
public override void OnMouseUp(MouseEventArgs mouseEvent)
{
var mouseUpY = TransformToScreenSpace(mouseEvent.Position).Y;
if (mouseDownOnBar
&& mouseUpY != mouseDownY)
{
OnResized(null);
}
mouseDownOnBar = false;
base.OnMouseUp(mouseEvent);
}