Fixed the number edit not to grow on Android. Made it's VAnchor always ParentCenter

Made the logic to test if a part should be centered on the bed be if it was output by MatterControl
Some other white space changes
This commit is contained in:
larsbrubaker 2015-01-25 17:54:26 -08:00
parent 8c36377e32
commit 0b3bbc136b
7 changed files with 37 additions and 9 deletions

View file

@ -23,7 +23,7 @@ namespace MatterHackers.MatterControl
: base(Agg.UI.FlowDirection.LeftToRight)
{
this.Margin = new BorderDouble(3, 0);
this.VAnchor |= VAnchor.ParentBottomTop;
this.VAnchor = VAnchor.ParentCenter;
clickableValueContainer = new ClickWidget();
clickableValueContainer.VAnchor = VAnchor.ParentBottomTop;
@ -70,7 +70,7 @@ namespace MatterHackers.MatterControl
setButton.Margin = new BorderDouble(left: 6);
setButton.Visible = false;
numberInputField.ActuallNumberEdit.EnterPressed += new KeyEventHandler(ActuallNumberEdit_EnterPressed);
numberInputField.ActuallNumberEdit.EnterPressed += new KeyEventHandler(ActuallNumberEdit_EnterPressed);
numberInputField.KeyDown += (sender, e) =>
{

View file

@ -659,7 +659,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// parts themselves. For now, simply mock that determination to allow testing of the proposed change and convey
// when we would want to autocenter (i.e. autocenter when part was loaded outside of the new closed loop system)
MeshVisualizer.MeshViewerWidget.CenterPartAfterLoad centerOnBed = MeshViewerWidget.CenterPartAfterLoad.DO;
if (printItemWrapper.FileLocation.Contains(ApplicationDataStorage.Instance.ApplicationLibraryDataPath))
if (PartShouldBeCentered(printItemWrapper))
{
centerOnBed = MeshViewerWidget.CenterPartAfterLoad.DONT;
}
@ -672,6 +672,33 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
partHasBeenEdited = false;
}
private static bool PartShouldBeCentered(PrintItemWrapper printItemWrapper)
{
if (printItemWrapper.FileLocation.Contains(ApplicationDataStorage.Instance.ApplicationLibraryDataPath))
{
if (File.Exists(printItemWrapper.FileLocation))
{
using (Stream uncompressedFileStream = File.OpenRead(printItemWrapper.FileLocation))
{
using (Stream fileStream = AmfProcessing.GetCompressedStreamIfRequired(uncompressedFileStream))
{
// read up the first 32k and make sure it says the file was created my MatterControl
int bufferSize = 32000;
byte[] buffer = new byte[bufferSize];
int numBytesRead = fileStream.Read(buffer, 0, bufferSize);
string startingContent = System.Text.Encoding.UTF8.GetString(buffer);
if (startingContent.Contains("MatterControl"))
{
return false;
}
}
}
}
}
return true;
}
void ExitEditingAndSaveIfRequired(bool response)
{
if (response == true)

View file

@ -79,7 +79,6 @@ namespace MatterHackers.MatterControl.PrinterControls
SetDisplayAttributes();
fanSpeedDisplay = new EditableNumberDisplay(textImageButtonFactory, "{0}%".FormatWith(PrinterConnectionAndCommunication.Instance.FanSpeed0To255.ToString()), "100%");
fanSpeedDisplay.VAnchor = VAnchor.ParentCenter;
fanSpeedDisplay.EditComplete += (sender, e) =>
{
PrinterConnectionAndCommunication.Instance.FanSpeed0To255 = (int)(fanSpeedDisplay.GetValue() * 255.5 / 100);

View file

@ -20,7 +20,6 @@ namespace MatterHackers.MatterControl.PrinterControls
{
public class TemperatureControls : ControlWidgetBase
{
public List<DisableableWidget> ExtruderWidgetContainers = new List<DisableableWidget>();
public DisableableWidget BedTemperatureControlWidget;
@ -55,7 +54,6 @@ namespace MatterHackers.MatterControl.PrinterControls
mainContainer.AddChild(extruderTemperatureControlWidget);
mainContainer.AddChild(new HorizontalLine(separatorLineColor));
ExtruderWidgetContainers.Add(extruderTemperatureControlWidget);
}
}
else

View file

@ -61,7 +61,6 @@ namespace MatterHackers.MatterControl
TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory();
static public RootedObjectEventHandler AddPluginControls = new RootedObjectEventHandler();
public ManualPrinterControls()
{

View file

@ -186,8 +186,7 @@ namespace MatterHackers.MatterControl
// put in the target temperature controls
temperatureIndicator.AddChild(GetTargetTemperatureDisplay());
FlowLayoutWidget helperTextWidget = GetHelpTextWidget();
FlowLayoutWidget helperTextWidget = GetHelpTextWidget();
GuiWidget hspacer = new GuiWidget();
hspacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;

View file

@ -3092,3 +3092,9 @@ Translated:Specify if your printer has the ability to do print leveling directly
English:Has Hardware Leveling
Translated:Has Hardware Leveling
English:The Fill Density must be between 0 and 1 inclusive.
Translated:The Fill Density must be between 0 and 1 inclusive.
English:Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Infill'
Translated:Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Infill'