Made better messaging around advanced

added 316L scaling
made a new back button
This commit is contained in:
Lars Brubaker 2021-05-07 11:29:59 -07:00
parent 6b030b8a28
commit 66a4a92e66
12 changed files with 91 additions and 22 deletions

View file

@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
this.CloseChildren();
var upbutton = new IconButton(StaticData.Instance.LoadIcon(Path.Combine("Library", "upfolder_20.png"), 20, 20, theme.InvertIcons), theme)
var upbutton = new IconButton(StaticData.Instance.LoadIcon(Path.Combine("Library", "back.png"), 20, 20, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Fit | VAnchor.Center,
Enabled = currentContainer.Parent != null,

View file

@ -175,6 +175,10 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
public bool Advanced { get; set; } = false;
[ReadOnly(true)]
[DisplayName("")] // clear the display name so this text will be the full width of the editor
public string EasyModeMessage { get; set; } = "You can switch to Advanced mode to get more align options.";
[SectionStart("X Axis"), DisplayName("Align")]
[EnumDisplay(IconPaths = new string[] { "424.png", "align_left.png", "align_center_x.png", "align_right.png", "align_origin.png" }, InvertIcons = true)]
public Align XAlign { get; set; } = Align.None;
@ -401,6 +405,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
change.SetRowVisible(nameof(YOffset), () => Advanced);
change.SetRowVisible(nameof(ZAlignTo), () => Advanced);
change.SetRowVisible(nameof(ZOffset), () => Advanced);
change.SetRowVisible(nameof(EasyModeMessage), () => !Advanced);
}
private static bool IsSet(FaceAlign variableToCheck, FaceAlign faceToCheckFor, FaceAlign faceToAssertNot)

View file

@ -205,7 +205,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
}
}
public bool ScaleLocked => LockProportions && ScaleType == ScaleTypes.Custom;
public bool ScaleLocked => LockProportions;
private void FixIfLockedProportions(int index, double newScale)
{
@ -214,8 +214,11 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
ScaleRatio[index] = newScale;
if (ScaleType != ScaleTypes.Custom)
{
ScaleType = ScaleTypes.Custom;
Invalidate(new InvalidateArgs(null, InvalidateType.DisplayValues));
// WIP: switch back to custom scaling (as we are no longer on a fixed scaling)
// needs to:
// - create an undo point for the switch
// - update the properties control to show the right drop down
// - show all the settings
}
if (LockProportions)
@ -224,6 +227,8 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
ScaleRatio[(index + 2) % 3] = ScaleRatio[index];
Invalidate(new InvalidateArgs(null, InvalidateType.DisplayValues));
}
Rebuild();
}
}
@ -299,11 +304,13 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
case ScaleTypes.Ultrafuse_316L:
ScaleRatio = new Vector3(1.1982, 1.1982, 1.261);
Rebuild();
Invalidate(new InvalidateArgs(null, InvalidateType.DisplayValues));
return;
}
ScaleRatio = new Vector3(scale, scale, scale);
Rebuild();
Invalidate(new InvalidateArgs(null, InvalidateType.DisplayValues));
}
else if (change.Changed == nameof(LockProportions))
{

View file

@ -92,6 +92,7 @@ namespace MatterHackers.MatterControl.DesignTools
public bool Advanced { get; set; } = false;
[ReadOnly(true)]
[DisplayName("")] // clear the display name so this text will be the full width of the editor
public string EasyModeMessage { get; set; } = "You can switch to Advanced mode to get more twist options.";
[Description("Allows for the repositioning of the rotation origin")]

View file

@ -130,6 +130,10 @@ namespace MatterHackers.MatterControl.DesignTools
public bool Advanced { get; set; } = false;
[ReadOnly(true)]
[DisplayName("")] // clear the display name so this text will be the full width of the editor
public string EasyModeMessage { get; set; } = "You can switch to Advanced mode to get more cylinder options.";
[MaxDecimalPlaces(2)]
public double StartingAngle { get; set; } = 0;
@ -215,6 +219,8 @@ namespace MatterHackers.MatterControl.DesignTools
{
endingAngleWidget.Visible = Advanced;
}
change.SetRowVisible(nameof(EasyModeMessage), () => !Advanced);
}
public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer)

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.VertexSource;
@ -82,6 +83,10 @@ namespace MatterHackers.MatterControl.DesignTools
public bool Advanced { get; set; } = false;
[ReadOnly(true)]
[DisplayName("")] // clear the display name so this text will be the full width of the editor
public string EasyModeMessage { get; set; } = "You can switch to Advanced mode to get more ring options.";
[MaxDecimalPlaces(2)]
public double StartingAngle { get; set; } = 0;
@ -150,6 +155,7 @@ namespace MatterHackers.MatterControl.DesignTools
{
change.SetRowVisible(nameof(StartingAngle), () => Advanced);
change.SetRowVisible(nameof(EndingAngle), () => Advanced);
change.SetRowVisible(nameof(EasyModeMessage), () => !Advanced);
}
public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer)

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.VertexSource;
@ -81,6 +82,10 @@ namespace MatterHackers.MatterControl.DesignTools
public bool Advanced { get; set; } = false;
[ReadOnly(true)]
[DisplayName("")] // clear the display name so this text will be the full width of the editor
public string EasyModeMessage { get; set; } = "You can switch to Advanced mode to get more sphere options.";
[MaxDecimalPlaces(2)]
public double StartingAngle { get; set; } = 0;
@ -178,6 +183,7 @@ namespace MatterHackers.MatterControl.DesignTools
change.SetRowVisible(nameof(StartingAngle), () => Advanced);
change.SetRowVisible(nameof(EndingAngle), () => Advanced);
change.SetRowVisible(nameof(LatitudeSides), () => Advanced);
change.SetRowVisible(nameof(EasyModeMessage), () => !Advanced);
}
public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer)

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.VertexSource;
@ -67,6 +68,10 @@ namespace MatterHackers.MatterControl.DesignTools
public bool Advanced { get; set; } = false;
[ReadOnly(true)]
[DisplayName("")] // clear the display name so this text will be the full width of the editor
public string EasyModeMessage { get; set; } = "You can switch to Advanced mode to get more torus options.";
[MaxDecimalPlaces(2)]
public double StartingAngle { get; set; } = 0;
@ -157,6 +162,7 @@ namespace MatterHackers.MatterControl.DesignTools
change.SetRowVisible(nameof(EndingAngle), () => Advanced);
change.SetRowVisible(nameof(RingSides), () => Advanced);
change.SetRowVisible(nameof(RingPhaseAngle), () => Advanced);
change.SetRowVisible(nameof(EasyModeMessage), () => !Advanced);
}
public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer)

View file

@ -670,12 +670,57 @@ namespace MatterHackers.MatterControl.DesignTools
{
if (readOnly)
{
rowContainer = new WrappedTextWidget(stringValue,
textColor: theme.TextColor,
pointSize: 10)
WrappedTextWidget wrappedTextWidget = null;
if (!string.IsNullOrEmpty(property.DisplayName))
{
Margin = 5
};
rowContainer = new GuiWidget()
{
HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Fit,
Margin = 9
};
var displayName = rowContainer.AddChild(new TextWidget(property.DisplayName,
textColor: theme.TextColor,
pointSize: 10)
{
VAnchor = VAnchor.Center,
});
var wrapContainer = new GuiWidget()
{
Margin = new BorderDouble(displayName.Width + displayName.Margin.Width + 15, 9, 9, 9),
HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Fit
};
wrappedTextWidget = new WrappedTextWidget(stringValue, textColor: theme.TextColor, pointSize: 10)
{
HAnchor = HAnchor.Stretch
};
wrappedTextWidget.TextWidget.HAnchor = HAnchor.Right;
wrapContainer.AddChild(wrappedTextWidget);
rowContainer.AddChild(wrapContainer);
}
else
{
rowContainer = wrappedTextWidget = new WrappedTextWidget(stringValue,
textColor: theme.TextColor,
pointSize: 10)
{
Margin = 9
};
}
void RefreshField(object s, InvalidateArgs e)
{
if (e.InvalidateType.HasFlag(InvalidateType.DisplayValues))
{
wrappedTextWidget.Text = property.Value.ToString();
}
}
object3D.Invalidated += RefreshField;
wrappedTextWidget.Closed += (s, e) => object3D.Invalidated -= RefreshField;
}
else // normal edit row
{
@ -776,18 +821,6 @@ namespace MatterHackers.MatterControl.DesignTools
}
};
void RefreshField(object s, InvalidateArgs e)
{
if (e.InvalidateType.HasFlag(InvalidateType.DisplayValues)
&& field.Content is MHDropDownList list
&& list.SelectedValue != property.Value.ToString())
{
propertyGridModifier?.UpdateControls(new PublicPropertyChange(context, property.PropertyInfo.Name));
}
}
object3D.Invalidated += RefreshField;
if (addToSettingsRow)
{
rowContainer = CreateSettingsRow(property, field, theme);

View file

@ -50,7 +50,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
{
public class LibraryWidget : GuiWidget
{
private readonly FlowLayoutWidget buttonPanel;
private readonly ILibraryContext libraryContext;
private readonly LibraryListView libraryView;

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B