OmagCUT :
- primo rilascio.
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
Imports System.Globalization
|
||||
|
||||
Public Class NumericKeyboardWD
|
||||
|
||||
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
|
||||
Public m_CurrentTxBx As TextBox
|
||||
Public m_CurrentLbl As String = String.Empty
|
||||
Dim m_bErrorState As Boolean = False
|
||||
|
||||
'Private Sub NumericKeyboardWD_Initialized(sender As Object, e As EventArgs)
|
||||
' Me.Owner = MainWindowUC
|
||||
'End Sub
|
||||
|
||||
Private Sub NumericKeyboardWD_IsVisibleChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
|
||||
If Me.IsVisible Then
|
||||
NumericKeyboardWDTextBox.Text = m_CurrentTxBx.Text
|
||||
NumericKeyboardWDTitle.Text = m_CurrentLbl
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub NumericKeyboardWD_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
MainWindowUC.Focus()
|
||||
End Sub
|
||||
|
||||
Private Sub NumericKeyboardWD_KeyDown(sender As Object, e As KeyEventArgs)
|
||||
If (e.Key = Key.Enter) Then
|
||||
Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Btn0WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "0"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn1WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "1"
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub Btn2WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "2"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn3WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "3"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn4WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "4"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn5WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "5"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn6WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "6"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn7WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "7"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn8WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "8"
|
||||
End Sub
|
||||
|
||||
Private Sub Btn9WD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "9"
|
||||
End Sub
|
||||
|
||||
Private Sub BtnDotWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "."
|
||||
End Sub
|
||||
|
||||
Private Sub BtnEvaluateWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
Evaluate()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnPlusWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "+"
|
||||
End Sub
|
||||
|
||||
Private Sub BtnMinusWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "-"
|
||||
End Sub
|
||||
|
||||
Private Sub BtnMultiplicationWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "*"
|
||||
End Sub
|
||||
|
||||
Private Sub BtnDivisionWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text &= "/"
|
||||
End Sub
|
||||
|
||||
Private Sub BtnDeleteWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text = NumericKeyboardWDTextBox.Text.Substring(0, NumericKeyboardWDTextBox.Text.Length - 1)
|
||||
End Sub
|
||||
|
||||
Private Sub BtnCancelWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text = String.Empty
|
||||
End Sub
|
||||
|
||||
Private Sub BtnExitWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
NumericKeyboardWDTextBox.Text = String.Empty
|
||||
Visibility = Windows.Visibility.Hidden
|
||||
End Sub
|
||||
|
||||
Private Sub BtnApplyWD_Click(sender As Object, e As RoutedEventArgs)
|
||||
Evaluate()
|
||||
If m_bErrorState Then
|
||||
Else
|
||||
m_CurrentTxBx.Text = NumericKeyboardWDTextBox.Text
|
||||
NumericKeyboardWDTextBox.Text = String.Empty
|
||||
Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Evaluate()
|
||||
Dim DoubleResult As Double = 0
|
||||
Dim bOk As Boolean = EgtUILib.EgtLuaEvalNumExpr(NumericKeyboardWDTextBox.Text, DoubleResult)
|
||||
If (bOk) Then
|
||||
NumericKeyboardWDTextBox.Text = DoubleResult.ToString(CultureInfo.InvariantCulture)
|
||||
If m_bErrorState Then
|
||||
m_bErrorState = False
|
||||
NumericKeyboardWDTitle.Text = m_CurrentLbl
|
||||
End If
|
||||
Else
|
||||
m_bErrorState = True
|
||||
NumericKeyboardWDTitle.Text &= " ESPRESSIONE ERRATA"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user