OmagCut :
- gestione flag booleani nei componenti.
This commit is contained in:
+11
-11
@@ -53,58 +53,58 @@
|
||||
<Label Name="Label1" Grid.Row="1" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox1" Grid.Column="1" Grid.Row="1" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label2" Grid.Row="2" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox2" Grid.Column="1" Grid.Row="2" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right" />
|
||||
<Label Name="Label3" Grid.Row="3" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox3" Grid.Column="1" Grid.Row="3" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label4" Grid.Row="4" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox4" Grid.Column="1" Grid.Row="4" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label5" Grid.Row="5" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox5" Grid.Column="1" Grid.Row="5" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label6" Grid.Row="6" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox6" Grid.Column="1" Grid.Row="6" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label7" Grid.Row="7" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox7" Grid.Column="1" Grid.Row="7" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label8" Grid.Row="8" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox8" Grid.Column="1" Grid.Row="8" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label9" Grid.Row="9" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox9" Grid.Column="1" Grid.Row="9" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
<Label Name="Label10" Grid.Row="10" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="20"/>
|
||||
<TextBox Name="TextBox10" Grid.Column="1" Grid.Row="10" Style="{StaticResource NumericKeyboard}"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
|
||||
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="90"
|
||||
TextAlignment="Right"/>
|
||||
|
||||
<Button Name="AddBtn" Grid.Row="12" FontSize="15" />
|
||||
<Button Name="CancelBtn" Grid.Column="1" Grid.Row="12" FontSize="15" />
|
||||
|
||||
<TextBlock Name="MessageLabel" Grid.Row="13" Grid.ColumnSpan="2" FontSize="15" VerticalAlignment="Center"
|
||||
<TextBlock Name="MessageLabel" Grid.Row="13" Grid.ColumnSpan="2" FontSize="20" VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Center"/>
|
||||
|
||||
<Button Name="BackBtn" Grid.Column="1" Grid.Row="14" FontSize="15" >
|
||||
|
||||
+44
-12
@@ -253,16 +253,16 @@ Public Class DrawPageUC
|
||||
' aggiorno le variabili
|
||||
For i As Integer = 1 To nShow
|
||||
Dim j As Integer = nHide + i
|
||||
' interpreto il valore, se non riesco ripristino default
|
||||
' interpreto il valore, se non riesco ripristino default
|
||||
If Not m_CVars(i - 1).FromString(GetValueEdit(j).Text) Then
|
||||
GetValueEdit(j).Text = m_CVars(i - 1).ToString()
|
||||
End If
|
||||
' aggiorno la corrispondente variabile lua
|
||||
If Not m_CVars(i - 1).ToLua() Then
|
||||
Dim sErr As String = String.Empty
|
||||
EgtLuaGetLastError(sErr)
|
||||
EgtOutLog(sErr)
|
||||
End If
|
||||
' aggiorno la corrispondente variabile lua
|
||||
If Not m_CVars(i - 1).ToLua() Then
|
||||
Dim sErr As String = String.Empty
|
||||
EgtLuaGetLastError(sErr)
|
||||
EgtOutLog(sErr)
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
@@ -468,9 +468,9 @@ Public Class DrawPageUC
|
||||
Case 2 ' intero
|
||||
Return m_nVal.ToString()
|
||||
Case 3 ' lunghezza
|
||||
Return EgtToUiUnits(m_dVal).ToString("F0", CultureInfo.InvariantCulture)
|
||||
Return DoubleToString(EgtToUiUnits(m_dVal), 4)
|
||||
Case 4 ' double
|
||||
Return m_dVal.ToString("F0", CultureInfo.InvariantCulture)
|
||||
Return DoubleToString(m_dVal, 4)
|
||||
Case 5 ' stringa
|
||||
Return m_sVal
|
||||
End Select
|
||||
@@ -487,19 +487,19 @@ Public Class DrawPageUC
|
||||
End If
|
||||
Case 2 ' intero
|
||||
Dim dVal As Double
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
If StringToDouble(sVal, dVal) Then
|
||||
m_nVal = CInt(dVal)
|
||||
Return True
|
||||
End If
|
||||
Case 3 ' lunghezza
|
||||
Dim dVal As Double
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
If StringToDouble(sVal, dVal) Then
|
||||
m_dVal = EgtFromUiUnits(dVal)
|
||||
Return True
|
||||
End If
|
||||
Case 4 ' double
|
||||
Dim dVal As Double
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
If StringToDouble(sVal, dVal) Then
|
||||
m_dVal = dVal
|
||||
Return True
|
||||
End If
|
||||
@@ -547,4 +547,36 @@ Public Class DrawPageUC
|
||||
|
||||
End Class
|
||||
|
||||
Private Sub TextBox9_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles TextBox9.PreviewMouseDown
|
||||
' Indice variabile associata al bottone
|
||||
Dim nI As Integer = GetDefinedVarCount() - (NUM_VAR - 9) - 1
|
||||
' Recupero tipo della variabile associata
|
||||
If m_CVars(nI).m_nType = 1 Then
|
||||
If TextBox9.Text = "False" Then
|
||||
TextBox9.Text = "True"
|
||||
Else
|
||||
TextBox9.Text = "False"
|
||||
End If
|
||||
e.Handled = True
|
||||
Else
|
||||
e.Handled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TextBox10_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles TextBox10.PreviewMouseDown
|
||||
' Indice variabile associata al bottone
|
||||
Dim nI As Integer = GetDefinedVarCount() - (NUM_VAR - 10) - 1
|
||||
' Recupero tipo della variabile associata
|
||||
If m_CVars(nI).m_nType = 1 Then
|
||||
If TextBox10.Text = "False" Then
|
||||
TextBox10.Text = "True"
|
||||
Else
|
||||
TextBox10.Text = "False"
|
||||
End If
|
||||
e.Handled = True
|
||||
Else
|
||||
e.Handled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -5,7 +5,7 @@
|
||||
'Dim m_NumericKeyboardWD As NumericKeyboardWD
|
||||
|
||||
' Evento della TextBox con Style che permette di aprire in automatico la calcolatrice
|
||||
Private Sub PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Friend Sub PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim m_NumericKeyboardWD As New NumericKeyboardWD
|
||||
m_NumericKeyboardWD.Owner = m_MainWindow
|
||||
' Se presente recupero label associata alla TextBox selezionata per scrivere il titolo
|
||||
|
||||
Reference in New Issue
Block a user