Move common control size into base

This commit is contained in:
John Lewin 2017-10-01 10:38:36 -07:00
parent 56609532c9
commit 83e0dee7a9
3 changed files with 2 additions and 4 deletions

View file

@ -35,8 +35,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
protected MHNumberEdit numberEdit;
public static readonly int ControlWidth = (int)(60 * GuiWidget.DeviceScale + .5);
protected bool AllowNegatives { get; set; } = true;
protected bool AllowDecimals { get; set; } = true;

View file

@ -35,8 +35,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
protected MHTextEditWidget textEditWidget;
private readonly int ControlWidth = (int)(60 * GuiWidget.DeviceScale + .5);
public override void Initialize(int tabIndex)
{
textEditWidget = new MHTextEditWidget("", pixelWidth: ControlWidth, tabIndex: tabIndex)

View file

@ -36,6 +36,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
public event EventHandler<FieldChangedEventArgs> ValueChanged;
protected readonly int ControlWidth = (int)(60 * GuiWidget.DeviceScale + .5);
public void SetValue(string newValue, bool userInitiated)
{
string convertedValue = this.ConvertValue(newValue);