Made 3D views editable while printing (if not the embedded view).

Made the eeprom windows have the correct tab stops.
This commit is contained in:
larsbrubaker 2014-07-02 13:28:51 -07:00
parent 264590b78d
commit b75ae71d24
5 changed files with 69 additions and 13 deletions

View file

@ -166,6 +166,18 @@ namespace MatterHackers.MatterControl
UiThread.RunOnIdle(OnIdle);
}
public override int TabIndex
{
get
{
return base.TabIndex;
}
set
{
actuallNumberEdit.TabIndex = value;
}
}
void InternalTextEditWidget_EditComplete(object sender, EventArgs e)
{
timeSinceLastTextChanged.Stop();

View file

@ -85,6 +85,8 @@ namespace MatterHackers.MatterControl.EeProm
double maxWidthOfLeftStuff = 0;
List<GuiWidget> leftStuffToSize = new List<GuiWidget>();
int currentTabIndex = 0;
public EePromMarlinWidget()
: base(700, 480)
{
@ -265,30 +267,45 @@ namespace MatterHackers.MatterControl.EeProm
leftStuffToSize.Add(holder);
row.AddChild(holder);
row.AddChild(CreateTextField(field1Label));
row.AddChild(CreateMHNumEdit(ref field1));
{
row.AddChild(CreateTextField(field1Label));
GuiWidget nextTabIndex = CreateMHNumEdit(ref field1);
nextTabIndex.TabIndex = GetNextTabIndex();
row.AddChild(nextTabIndex);
}
if (field2Label != null)
{
row.AddChild(CreateTextField(field2Label));
row.AddChild(CreateMHNumEdit(ref field2));
GuiWidget nextTabIndex = CreateMHNumEdit(ref field2);
nextTabIndex.TabIndex = GetNextTabIndex();
row.AddChild(nextTabIndex);
}
if (field3Label != null)
{
row.AddChild(CreateTextField(field3Label));
row.AddChild(CreateMHNumEdit(ref field3));
GuiWidget nextTabIndex = CreateMHNumEdit(ref field3);
nextTabIndex.TabIndex = GetNextTabIndex();
row.AddChild(nextTabIndex);
}
if (field4Label != null)
{
row.AddChild(CreateTextField(field4Label));
row.AddChild(CreateMHNumEdit(ref field4));
GuiWidget nextTabIndex = CreateMHNumEdit(ref field4);
nextTabIndex.TabIndex = GetNextTabIndex();
row.AddChild(nextTabIndex);
}
return row;
}
private int GetNextTabIndex()
{
return currentTabIndex++;
}
private static void CreateSpacer(FlowLayoutWidget buttonBar)
{
GuiWidget spacer = new GuiWidget(1, 1);

View file

@ -178,6 +178,7 @@ namespace MatterHackers.MatterControl.EeProm
}
}
int currentTabIndex = 0;
void AddItemToUi(object state)
{
EePromRepetierParameter newSetting = state as EePromRepetierParameter;
@ -197,6 +198,7 @@ namespace MatterHackers.MatterControl.EeProm
double currentValue;
double.TryParse(newSetting.Value, out currentValue);
MHNumberEdit valueEdit = new MHNumberEdit(currentValue, pixelWidth: 80, allowNegatives: true, allowDecimals: true);
valueEdit.TabIndex = currentTabIndex++;
valueEdit.VAnchor = Agg.UI.VAnchor.ParentCenter;
valueEdit.ActuallNumberEdit.EditComplete += (sender, e) =>
{

View file

@ -62,6 +62,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public class View3DTransformPart : PartPreview3DWidget
{
public WindowType windowType { get; set; }
FlowLayoutWidget viewOptionContainer;
FlowLayoutWidget rotateOptionContainer;
FlowLayoutWidget scaleOptionContainer;
@ -252,6 +254,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public View3DTransformPart(PrintItemWrapper printItemWrapper, Vector3 viewerVolume, MeshViewerWidget.BedShape bedShape, WindowType windowType, AutoRotate autoRotate)
{
this.windowType = windowType;
autoRotateEnabled = (autoRotate == AutoRotate.Enabled);
MeshExtraData = new List<PlatingMeshData>();
MeshExtraData.Add(new PlatingMeshData());
@ -461,16 +464,23 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
void SetEditControlsBasedOnPrinterState(object sender, EventArgs e)
{
switch (PrinterConnectionAndCommunication.Instance.CommunicationState)
if (windowType == WindowType.Embeded)
{
case PrinterConnectionAndCommunication.CommunicationStates.Printing:
case PrinterConnectionAndCommunication.CommunicationStates.Paused:
LockEditControls();
break;
switch (PrinterConnectionAndCommunication.Instance.CommunicationState)
{
case PrinterConnectionAndCommunication.CommunicationStates.Printing:
case PrinterConnectionAndCommunication.CommunicationStates.Paused:
LockEditControls();
break;
default:
UnlockEditControls();
break;
default:
UnlockEditControls();
break;
}
}
else
{
UnlockEditControls();
}
}

View file

@ -2493,3 +2493,18 @@ Translated:Go To Status
English:View Status
Translated:View Status
English:Description
Translated:Description
English:Value
Translated:Value
English:Save To EEPROM
Translated:Save To EEPROM
English:Firmware EEPROM Settings
Translated:Firmware EEPROM Settings
English:Save to EEPROM
Translated:Save to EEPROM