Add support for themed text/number edit fields

This commit is contained in:
John Lewin 2018-10-14 20:05:37 -07:00
parent 151e753db2
commit 34708054ee
44 changed files with 598 additions and 108 deletions

View file

@ -34,13 +34,19 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public abstract class NumberField : UIField
{
protected MHNumberEdit numberEdit;
private ThemeConfig theme;
protected bool AllowNegatives { get; set; } = true;
protected bool AllowDecimals { get; set; } = true;
public NumberField(ThemeConfig theme)
{
this.theme = theme;
}
public override void Initialize(int tabIndex)
{
numberEdit = new MHNumberEdit(0, pixelWidth: ControlWidth, allowDecimals: this.AllowDecimals, allowNegatives: this.AllowNegatives, tabIndex: tabIndex)
numberEdit = new MHNumberEdit(0, theme, pixelWidth: ControlWidth, allowDecimals: this.AllowDecimals, allowNegatives: this.AllowNegatives, tabIndex: tabIndex)
{
ToolTipText = this.HelpText,
SelectAllOnFocus = true,