SarmaxWall :
- Aggiunti check per attivare e disattivare i ponti colla e tavole nella pagina opzioni.
This commit is contained in:
@@ -87,5 +87,6 @@ Module ConstIni
|
||||
Public Const K_LAYERTHICK As String = "LayerThickness"
|
||||
Public Const K_PLANKNUMONTOP As String = "PlankNumOnTop"
|
||||
Public Const K_TRANSMITTER As String = "Transmitter"
|
||||
Public Const K_GANTRIES As String = "Gantries"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -107,6 +107,32 @@
|
||||
|
||||
</Border>
|
||||
|
||||
<!-- Definizione della Grid per attivazione ponte tavole e colla -->
|
||||
<Border Grid.Column="2" Grid.Row="1" BorderThickness="1" BorderBrush="Black" CornerRadius="3"
|
||||
Margin="1">
|
||||
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Name="GantriesStateLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="15" FontWeight="Bold" />
|
||||
<CheckBox Name="GlueChBx" Grid.Column="1" Grid.Row="1" Height="40" Width="150"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock Name="GlueTxBl" FontSize="15" TextWrapping="Wrap" Margin="10,0,0,0"/>
|
||||
</CheckBox>
|
||||
<CheckBox Name="PlankChBx" Grid.Column="1" Grid.Row="2" Height="40" Width="150"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock Name="PlankTxBl" FontSize="15" TextWrapping="Wrap" Margin="10,0,0,0"/>
|
||||
</CheckBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid per opzioni software -->
|
||||
|
||||
+35
-9
@@ -15,16 +15,19 @@ Public Class OptionsPageUC
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
MachineOptionsLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 1) 'Machine options - Opzioni macchina
|
||||
GlueingParametersLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 2) 'Glueing parameters - Caratteristiche incollaggio
|
||||
ExtraRawPartXLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 3) 'Generate - Extra grezzo in X
|
||||
ExtraRawPartYLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 4) 'Send - Extra grezzo in Y
|
||||
ExtraGlueLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 5) 'Send - Extra colla
|
||||
ExtraRawPartXLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 3) 'X Extra Raw - Extra grezzo in X
|
||||
ExtraRawPartYLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 4) 'Y Extra Raw - Extra grezzo in Y
|
||||
ExtraGlueLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 5) 'Extra glue - Extra colla
|
||||
PlankParametersLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 6) 'Plank parameters - Caratteristiche tavole
|
||||
PlankWidthLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 7) 'Send - Larghezza tavola
|
||||
PlankNumForLayerLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 8) 'Send - N° tavole in un piano
|
||||
SoftwareOptionsLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 9) 'Software options - Opzioni software
|
||||
LanguageLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 10) 'Language selection - Selezione lingua
|
||||
LanguageMsgLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 11) 'The new language become the current one from the next software run - La nuova lingua diventerà corrente dal prossimo avvio del programma
|
||||
ProjectNumberLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 12) 'Language selection - Numero progetti da salvare
|
||||
PlankWidthLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 7) 'Plank width - Larghezza tavola
|
||||
PlankNumForLayerLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 8) 'Table count in a layer - N° tavole in un piano
|
||||
GantriesStateLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 9) '
|
||||
GlueTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 10) '
|
||||
PlankTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 11) '
|
||||
SoftwareOptionsLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 21) 'Software options - Opzioni software
|
||||
LanguageLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 22) 'Language selection - Selezione lingua
|
||||
LanguageMsgLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 23) 'The new language become the current one from the next software run - La nuova lingua diventerà corrente dal prossimo avvio del programma
|
||||
ProjectNumberLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 24) 'Language selection - Numero progetti da salvare
|
||||
|
||||
' Associo TextBox e Label
|
||||
Dim TempLabel1 As New Label
|
||||
@@ -60,6 +63,21 @@ Public Class OptionsPageUC
|
||||
PlankWidthTxBx.Text = dPlankWidth
|
||||
Dim nPlankNumForLayer As Integer = GetPrivateProfileInt(S_MACHINE, K_PLANKNUMINLAYER, 0, m_MainWindow.GetIniFile())
|
||||
PlankNumForLayerTxBx.Text = nPlankNumForLayer
|
||||
Dim nGantries As Integer = GetPrivateProfileInt(S_MACHINE, K_GANTRIES, 3, m_MainWindow.GetIniFile())
|
||||
Select Case nGantries
|
||||
Case 0
|
||||
GlueChBx.IsChecked = False
|
||||
PlankChBx.IsChecked = False
|
||||
Case 1
|
||||
GlueChBx.IsChecked = True
|
||||
PlankChBx.IsChecked = False
|
||||
Case 2
|
||||
GlueChBx.IsChecked = False
|
||||
PlankChBx.IsChecked = True
|
||||
Case Else
|
||||
GlueChBx.IsChecked = True
|
||||
PlankChBx.IsChecked = True
|
||||
End Select
|
||||
Dim nMaxProj As Integer = GetPrivateProfileInt(S_GENERAL, K_MAXPROJ, 10, m_MainWindow.GetIniFile())
|
||||
ProjectNumberTxBx.Text = nMaxProj
|
||||
End Sub
|
||||
@@ -80,6 +98,14 @@ Public Class OptionsPageUC
|
||||
WritePrivateProfileString(S_MACHINE, K_OFFSETGLUE, ExtraGlueTxBx.Text, m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_MACHINE, K_PLANKX, PlankWidthTxBx.Text, m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_MACHINE, K_PLANKNUMINLAYER, PlankNumForLayerTxBx.Text, m_MainWindow.GetIniFile())
|
||||
Dim nGantries As Integer = 0
|
||||
If GlueChBx.IsChecked Then
|
||||
nGantries += 1
|
||||
End If
|
||||
If PlankChBx.IsChecked Then
|
||||
nGantries += 2
|
||||
End If
|
||||
WritePrivateProfileString(S_MACHINE, K_GANTRIES, nGantries.ToString(), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_GENERAL, K_MESSAGES, m_MainWindow.m_CurrLanguage.LanguageName, m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_GENERAL, K_MAXPROJ, ProjectNumberTxBx.Text, m_MainWindow.GetIniFile())
|
||||
' Istruzioni per chiudere OptionsPageUC e aprire PlacePage UC
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SarmaxWall.ArithmeticConverterNameSpace"
|
||||
x:Class="SarmaxWallDictionary">
|
||||
|
||||
<!-- ** TOGGLEBUTTON ** -->
|
||||
@@ -151,4 +152,112 @@
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** CHECKBOX ** -->
|
||||
|
||||
<local:CheckboxConverter x:Key="converter"></local:CheckboxConverter>
|
||||
<Style TargetType="{x:Type CheckBox}">
|
||||
<Setter Property="FocusVisualStyle">
|
||||
<Setter.Value>
|
||||
<Style>
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="BorderBrush" Value="#FF707070"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type CheckBox}">
|
||||
<Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border x:Name="checkBoxBorder" Height="{Binding Path=ActualHeight, ElementName=templateRoot}" Width="{Binding Path=ActualHeight, ElementName=templateRoot}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<Grid x:Name="markGrid">
|
||||
<Path x:Name="optionMark" Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z" Fill="#FF212121" Margin="1" Opacity="0" Stretch="None" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Path.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform>
|
||||
<ScaleTransform.ScaleX>
|
||||
<MultiBinding Converter="{StaticResource converter}">
|
||||
<Binding ElementName="templateRoot" Path="ActualHeight"/>
|
||||
<Binding ElementName="optionMark" Path="ActualHeight"/>
|
||||
</MultiBinding>
|
||||
</ScaleTransform.ScaleX>
|
||||
<ScaleTransform.ScaleY>
|
||||
<MultiBinding Converter="{StaticResource converter}">
|
||||
<Binding ElementName="templateRoot" Path="ActualHeight"/>
|
||||
|
||||
<Binding ElementName="optionMark" Path="ActualHeight"/>
|
||||
</MultiBinding>
|
||||
</ScaleTransform.ScaleY>
|
||||
</ScaleTransform>
|
||||
</TransformGroup>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
<Rectangle x:Name="indeterminateMark" Fill="#FF212121" Margin="2" Opacity="0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasContent" Value="True">
|
||||
<Setter Property="FocusVisualStyle">
|
||||
<Setter.Value>
|
||||
<Style>
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Padding" Value="4,-1,0,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" TargetName="checkBoxBorder" Value="#FFF3F9FF"/>
|
||||
<Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="#FF5593FF"/>
|
||||
<Setter Property="Fill" TargetName="optionMark" Value="#FF212121"/>
|
||||
<Setter Property="Fill" TargetName="indeterminateMark" Value="#FF212121"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" TargetName="checkBoxBorder" Value="#FFE6E6E6"/>
|
||||
<Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="#FFBCBCBC"/>
|
||||
<Setter Property="Fill" TargetName="optionMark" Value="#FF707070"/>
|
||||
<Setter Property="Fill" TargetName="indeterminateMark" Value="#FF707070"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" TargetName="checkBoxBorder" Value="#FFD9ECFF"/>
|
||||
<Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="#FF3C77DD"/>
|
||||
<Setter Property="Fill" TargetName="optionMark" Value="#FF212121"/>
|
||||
<Setter Property="Fill" TargetName="indeterminateMark" Value="#FF212121"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Opacity" TargetName="optionMark" Value="1"/>
|
||||
<Setter Property="Opacity" TargetName="indeterminateMark" Value="0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="{x:Null}">
|
||||
<Setter Property="Opacity" TargetName="optionMark" Value="0"/>
|
||||
<Setter Property="Opacity" TargetName="indeterminateMark" Value="1"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -29,3 +29,42 @@
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Namespace ArithmeticConverterNameSpace
|
||||
|
||||
Public Class CheckboxConverter
|
||||
Implements IMultiValueConverter
|
||||
|
||||
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
|
||||
If values.Length <> 2 Then
|
||||
Throw New ArgumentException("There should be three values.")
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(values(0).ToString) Then
|
||||
values(0) = "0"
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(values(1).ToString()) Then
|
||||
values(2) = "0"
|
||||
End If
|
||||
|
||||
Dim x As Double
|
||||
If Not Double.TryParse(values(0).ToString(), x) Then
|
||||
Throw New ArgumentException("values[0] must parse to double")
|
||||
End If
|
||||
|
||||
Dim y As Double
|
||||
If Not Double.TryParse(values(1).ToString(), y) Then
|
||||
Throw New ArgumentException("values[0] must parse to double")
|
||||
End If
|
||||
|
||||
Return (x / y) - 1
|
||||
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user