Modifiche per far funzionare correttamente EgtKeyboard e EgtCalculator nel Db Waterjet di OmagCUT
This commit is contained in:
@@ -21,8 +21,25 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<!--<RowDefinition Height="1*"/>-->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--<Grid x:Name="TitleGrid" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.25*"/>
|
||||
<ColumnDefinition Width="4.5*"/>
|
||||
<ColumnDefinition Width="0.25*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition x:Name="TitleRow" Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox x:Name="ValueTxBx" Grid.Column="1" Grid.Row="1" TextAlignment="Right"
|
||||
FontSize="{DynamicResource EgtKeyboard_FontSize}"/>
|
||||
|
||||
</Grid>-->
|
||||
|
||||
<Grid Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -248,6 +248,18 @@ Public Class EgtKeyboard
|
||||
' m_SourceTxBx.SelectAll()
|
||||
'End Sub
|
||||
|
||||
' Private Sub EgtKeyboard_Loaded(sender As Object, e As EventArgs) Handles EgtKeyboard.Loaded
|
||||
' 'm_sErrorString = EgtMsg(MSG_EGTCALCULATOR + 1)
|
||||
' If Not IsNothing(m_SourceTxBx) Then
|
||||
' Dim SourceTxBx As TextBox = m_SourceTxBx
|
||||
' ValueTxBx.Text = SourceTxBx.Text
|
||||
' ValueTxBx.Focus()
|
||||
' ValueTxBx.SelectAll()
|
||||
' Else
|
||||
' 'ValueTxBx.Text = DoubleToString(m_dStartValue, 3)
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
Private Sub EgtKeyboard_Unloaded(sender As Object, e As EventArgs) Handles EgtKeyboard.Unloaded
|
||||
|
||||
End Sub
|
||||
@@ -455,6 +467,7 @@ Public Class EgtKeyboard
|
||||
.RoutedEvent = TextInputEvent
|
||||
}
|
||||
InputManager.Current.ProcessInput(EventArgs)
|
||||
'ValueTxBx.Text = DirectCast(m_SourceTxBx, TextBox).Text
|
||||
End Sub
|
||||
|
||||
Private Sub CharacterBtn_Click(sender As Object, e As RoutedEventArgs) Handles qBtn.Click, wBtn.Click, eBtn.Click, rBtn.Click, tBtn.Click, yBtn.Click, uBtn.Click, iBtn.Click, oBtn.Click, pBtn.Click, aBtn.Click, sBtn.Click, dBtn.Click, fBtn.Click,
|
||||
@@ -667,6 +680,7 @@ Public Class EgtKeyboard
|
||||
.RoutedEvent = Keyboard.KeyDownEvent
|
||||
}
|
||||
InputManager.Current.ProcessInput(eventArgs)
|
||||
'ValueTxBx.Text = DirectCast(m_SourceTxBx, TextBox).Text
|
||||
End Sub
|
||||
|
||||
Private Sub SpaceBtn_Click(sender As Object, e As RoutedEventArgs) Handles SpaceBtn.Click
|
||||
@@ -675,6 +689,7 @@ Public Class EgtKeyboard
|
||||
.RoutedEvent = Keyboard.KeyDownEvent
|
||||
}
|
||||
InputManager.Current.ProcessInput(eventArgs)
|
||||
'ValueTxBx.Text = DirectCast(m_SourceTxBx, TextBox).Text
|
||||
End Sub
|
||||
|
||||
Private Sub CancBtn_Click(sender As Object, e As RoutedEventArgs) Handles CancBtn.Click
|
||||
@@ -683,11 +698,13 @@ Public Class EgtKeyboard
|
||||
.RoutedEvent = Keyboard.KeyDownEvent
|
||||
}
|
||||
InputManager.Current.ProcessInput(eventArgs)
|
||||
'ValueTxBx.Text = DirectCast(m_SourceTxBx, TextBox).Text
|
||||
End Sub
|
||||
|
||||
Private Sub ClearBtn_Click(sender As Object, e As RoutedEventArgs) Handles ClearBtn.Click
|
||||
DirectCast(m_SourceTxBx, TextBox).Text = String.Empty
|
||||
m_SourceTxBx.Focus()
|
||||
'ValueTxBx.Text = DirectCast(m_SourceTxBx, TextBox).Text
|
||||
End Sub
|
||||
|
||||
Private Sub EnterBtn_Click(sender As Object, e As RoutedEventArgs) Handles Enter1Btn.Click, Enter2Btn.Click
|
||||
|
||||
+21
-1
@@ -13,6 +13,7 @@
|
||||
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class EgtTextBox
|
||||
Inherits TextBox
|
||||
@@ -106,6 +107,15 @@ Public Class EgtTextBox
|
||||
|
||||
Public Shared ReadOnly KeyboardPositionProperty As DependencyProperty = DependencyProperty.Register("KeyboardPosition", GetType(Positions), GetType(EgtTextBox), New PropertyMetadata(Positions.Bottom))
|
||||
|
||||
Public Property KeyboardPosition As Positions
|
||||
Get
|
||||
Return DirectCast(GetValue(KeyboardPositionProperty), Positions)
|
||||
End Get
|
||||
Set(value As Positions)
|
||||
SetValue(KeyboardPositionProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared Function GetKeyboardPosition(element As UIElement) As Positions
|
||||
Return DirectCast(element.GetValue(KeyboardPositionProperty), Positions)
|
||||
End Function
|
||||
@@ -152,6 +162,11 @@ Public Class EgtTextBox
|
||||
If Not EgtWPFLib.EgtKeyboard.GetbIsActive() Then
|
||||
Dim Owner As FrameworkElement = TxBx
|
||||
While Not TypeOf Owner Is Window
|
||||
If IsNothing(Owner) Then
|
||||
EgtOutLog("Forzata assegnazione finestra principale")
|
||||
Owner = MainWindow
|
||||
Exit While
|
||||
End If
|
||||
Owner = Owner.Parent
|
||||
End While
|
||||
m_Owner = Owner
|
||||
@@ -170,6 +185,11 @@ Public Class EgtTextBox
|
||||
If Not EgtWPFLib.EgtCalculator.GetbIsActive Then
|
||||
Dim Owner As FrameworkElement = TxBx
|
||||
While Not TypeOf Owner Is Window
|
||||
If IsNothing(Owner) Then
|
||||
EgtOutLog("Forzata assegnazione finestra principale")
|
||||
Owner = MainWindow
|
||||
Exit While
|
||||
End If
|
||||
Owner = Owner.Parent
|
||||
End While
|
||||
m_Owner = Owner
|
||||
@@ -192,7 +212,7 @@ Public Class EgtTextBox
|
||||
Public Function placeKeyboardPopup(ByVal popupSize As Size, ByVal targetSize As Size, ByVal offset As Point) As CustomPopupPlacement()
|
||||
|
||||
Dim BottomPlacement As New CustomPopupPlacement(New Point(-m_Keyboard.ActualWidth / 2 + Me.ActualWidth / 2, Me.ActualHeight + EgtTextBox.OFFSET), PopupPrimaryAxis.Horizontal)
|
||||
Dim TopPlacement As New CustomPopupPlacement(New Point(-m_Keyboard.ActualWidth / 2 + Me.ActualWidth / 2, -m_Keyboard.ActualHeight - EgtTextBox.OFFSET), PopupPrimaryAxis.Horizontal)
|
||||
Dim TopPlacement As New CustomPopupPlacement(New Point(-m_Keyboard.ActualWidth / 2 + Me.ActualWidth / 2, -m_Keyboard.ActualHeight + EgtTextBox.OFFSET - 2 * Me.ActualHeight), PopupPrimaryAxis.Horizontal)
|
||||
Dim LeftPlacement As New CustomPopupPlacement(New Point(-m_Keyboard.ActualWidth - EgtTextBox.OFFSET, -m_Keyboard.ActualHeight / 2 + Me.ActualHeight / 2), PopupPrimaryAxis.Vertical)
|
||||
Dim RightPlacement As New CustomPopupPlacement(New Point(Me.ActualWidth + EgtTextBox.OFFSET, -m_Keyboard.ActualHeight / 2 + Me.ActualHeight / 2), PopupPrimaryAxis.Vertical)
|
||||
|
||||
|
||||
+10
@@ -38,6 +38,16 @@ Public Module Utility
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private m_MainWindow As Window
|
||||
Public Property MainWindow As Window
|
||||
Get
|
||||
Return m_MainWindow
|
||||
End Get
|
||||
Set(value As Window)
|
||||
m_MainWindow = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "<!--EgtPopup-->"
|
||||
|
||||
Public Class WinApi
|
||||
|
||||
Reference in New Issue
Block a user