From 20f49c625cd32b95154db138ed7eeebbadd04bf7 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 1 Nov 2021 14:53:16 +0200 Subject: Color selection and Job sequence package. Redesign list control, move Color Selection View to dialogs, implement save. --- .../Tango.Touch/Controls/TouchNumericTextBox.cs | 24 +++-- .../Tango.Touch/Controls/TouchNumericTextBox.xaml | 10 +- .../Tango.Touch/Controls/TouchTextBox.xaml | 5 +- .../Visual_Studio/Tango.Touch/Resources/Fonts.xaml | 1 + .../Tango.Touch/Styles/TouchExpander.xaml | 107 +++++++++++++++++++++ .../Styles/TouchNumericUpDownControl.xaml | 98 +++++++++++++++++++ .../Visual_Studio/Tango.Touch/Tango.Touch.csproj | 10 +- .../Visual_Studio/Tango.Touch/Themes/Generic.xaml | 2 + .../TouchColorPickerCMYKControl.cs | 16 +-- 9 files changed, 250 insertions(+), 23 deletions(-) create mode 100644 Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml create mode 100644 Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml (limited to 'Software/Visual_Studio/Tango.Touch') diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 18fb0726f..ad185f1a3 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -117,7 +117,14 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty UpdateBindingOnlyWhenFocusedProperty = DependencyProperty.Register("UpdateBindingOnlyWhenFocused", typeof(bool), typeof(TouchNumericTextBox), new PropertyMetadata(false)); - + public virtual bool HasError + { + get + { + return Validation.GetHasError(this); + } + } + public override void OnApplyTemplate() { @@ -161,13 +168,16 @@ namespace Tango.Touch.Controls value = Math.Round(value, 0); } - if (value < Minimum) - { - value = Minimum; - } - else if (value > Maximum) + if (Maximum > Minimum) { - value = Maximum; + if (value < Minimum) + { + value = Minimum; + } + else if (value > Maximum) + { + value = Maximum; + } } } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml index d347480d6..f26e53e73 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml @@ -8,8 +8,8 @@ xmlns:local="clr-namespace:Tango.Touch.Controls"> - - + + @@ -40,8 +40,8 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" keyboard:KeyboardView.Container="{TemplateBinding KeyboardContainer}"> - - + + @@ -72,7 +72,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml index dcb52859e..c95c87782 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml @@ -8,7 +8,8 @@ xmlns:local="clr-namespace:Tango.Touch.Controls"> - + + @@ -39,7 +40,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml index df917b20e..f8db0094f 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml @@ -21,6 +21,7 @@ 22 23 + 23 21 26 diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml new file mode 100644 index 000000000..d61203e3b --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml new file mode 100644 index 000000000..f50e04742 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index d7a25aeff..ae5ac91e3 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -147,6 +147,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -480,7 +488,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index 132082d81..c2c6c0bc9 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -60,6 +60,8 @@ + + diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs index c32310897..39eab1984 100644 --- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs +++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs @@ -283,7 +283,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnCyanPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnCyanPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } @@ -300,7 +300,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnMagentaLabPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnMagentaLabPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } @@ -317,7 +317,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnYellowPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnYellowPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } private void OnYellowPropertyChanged(double oldValue, double newValue) @@ -333,7 +333,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnKeyPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnKeyPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } private void OnKeyPropertyChanged(double oldValue, double newValue) @@ -401,7 +401,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(e.NewValue / 100, _magentaColorSlider.ColorValue / 100, _yellowColorSlider.ColorValue / 100, _keyColorSlider.ColorValue / 100); //_cyanColorSlider.SelectedColor = SelectedColor; - Cyan = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Cyan = e.NewValue; _cyanColorSlider.SelectedColor = GetRelativeColor(_cyanColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _cyanColorSlider.MinValue, _cyanColorSlider.MaxValue)); @@ -423,7 +423,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(_cyanColorSlider.ColorValue / 100, e.NewValue / 100, _yellowColorSlider.ColorValue / 100, _keyColorSlider.ColorValue / 100); //_magentaColorSlider.SelectedColor = SelectedColor; - Magenta = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Magenta = e.NewValue; _magentaColorSlider.SelectedColor = GetRelativeColor(_magentaColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _magentaColorSlider.MinValue, _magentaColorSlider.MaxValue)); @@ -445,7 +445,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(_cyanColorSlider.ColorValue / 100, _magentaColorSlider.ColorValue / 100, e.NewValue / 100, _keyColorSlider.ColorValue / 100); //_yellowColorSlider.SelectedColor = SelectedColor; - Yellow = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Yellow = e.NewValue; _yellowColorSlider.SelectedColor = GetRelativeColor(_yellowColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _yellowColorSlider.MinValue, _yellowColorSlider.MaxValue)); @@ -467,7 +467,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(_cyanColorSlider.ColorValue / 100, _magentaColorSlider.ColorValue / 100, _yellowColorSlider.ColorValue / 100, e.NewValue / 100); //_keyColorSlider.SelectedColor = SelectedColor; - Key = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Key = e.NewValue; _keyColorSlider.SelectedColor = GetRelativeColor(_keyColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _keyColorSlider.MinValue, _keyColorSlider.MaxValue)); -- cgit v1.3.1