diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-12 17:56:24 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-12 17:56:24 +0200 |
| commit | de57858a147ece47a71e288660fbf85451e396b5 (patch) | |
| tree | 7a9f0cf07917a574d2954530117d26f97287c031 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | 12967bd645e92f7b08b8d323b93225e027ad69f0 (diff) | |
| download | Tango-de57858a147ece47a71e288660fbf85451e396b5.tar.gz Tango-de57858a147ece47a71e288660fbf85451e396b5.zip | |
Fixed issue with CMYK display on developer module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
3 files changed, 29 insertions, 4 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs new file mode 100644 index 000000000..292de5cb4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/OneToPercentConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Developer.Converters +{ + public class OneToPercentConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return System.Convert.ToDouble(value) * 100d; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return System.Convert.ToDouble(value) / 100d; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 43ebc515d..f076106bc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -103,6 +103,7 @@ <Compile Include="Converters\JobProgressToPositionConverter.cs" /> <Compile Include="Converters\JobToColumnDefinitionsConverter.cs" /> <Compile Include="Converters\ObjectsNotEqualToBooleanConveter.cs" /> + <Compile Include="Converters\OneToPercentConverter.cs" /> <Compile Include="Converters\SegmentLengthToWidthConverter.cs" /> <Compile Include="Converters\SegmentToBrushConverter.cs" /> <Compile Include="Converters\SegmentToBrushConverterMulti.cs" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index cd5cdb8a2..f53fd003e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -57,6 +57,7 @@ <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" /> <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" /> <converters:NumberToFileSizeConverter x:Key="NumberToFileSizeConverter"/> + <localConverters:OneToPercentConverter x:Key="OneToPercentConverter"/> <SolidColorBrush x:Key="SideBarBackground" Color="White"> @@ -1180,7 +1181,7 @@ <Setter.Value> <StackPanel Orientation="Horizontal"> <ContentControl Style="{StaticResource numberBorder}" Foreground="Cyan" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -1188,7 +1189,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="Magenta" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -1196,7 +1197,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="Yellow" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -1204,7 +1205,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="Black" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> |
