Gestione On/Off tagli con doppio click

This commit is contained in:
Nicola Pievani
2024-07-31 10:05:03 +02:00
parent aca43262cf
commit 6224b1e40b
6 changed files with 34 additions and 8 deletions
+2 -2
View File
@@ -228,8 +228,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2606, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2606, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2607, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2607, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
' Inizializzazione generale di EgtInterface
+2 -2
View File
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.6.6.3")>
<Assembly: AssemblyFileVersion("2.6.6.3")>
<Assembly: AssemblyVersion("2.6.8.1")>
<Assembly: AssemblyFileVersion("2.6.8.1")>
+9
View File
@@ -102,12 +102,14 @@ Public Class MySceneHostVM
Public Overrides Sub InitSceneEvents()
AddHandler MainScene.OnMouseDownScene, AddressOf OnMouseDownScene
'AddHandler OnMouseDownScene_DoubleClick_1, AddressOf OnMouseDownScene_DoubleClick
AddHandler MainScene.OnMouseMoveScene, AddressOf OnMouseMoveScene
AddHandler MainScene.OnMouseUpScene, AddressOf OnMouseUpScene
AddHandler MainScene.KeyDown, AddressOf OnKeyDownScene
AddHandler MainScene.OnCursorPos, AddressOf OnCursorPos
AddHandler MainScene.OnShowDistance, AddressOf OnShowDistance
AddHandler MainScene.OnChangedSnapPointType, AddressOf OnChangedSnapPointType
End Sub
Private Sub PreInitializeScene()
@@ -809,6 +811,13 @@ Public Class MySceneHostVM
Private Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or Not MainScene.IsStatusNull() Then Return
If e.Clicks > 1 Then
Select Case OmagOFFICEMap.refOptionPanelVM.SelItem
Case OptionPanelVM.Tabs.MACHINING
OmagOFFICEMap.refMachiningTabVM.OnMouseDownScene_DoubleClick(sender, e)
Case OptionPanelVM.Tabs.SIMUL
End Select
End If
' Chiamo l'opportuno gestore
Select Case OmagOFFICEMap.refOptionPanelVM.SelItem
Case OptionPanelVM.Tabs.RAWPART
@@ -334,6 +334,12 @@ Public Class MachiningTabVM
End If
End Sub
Friend Sub OnMouseDownScene_DoubleClick(sender As Object, e As Windows.Forms.MouseEventArgs)
If m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.OnMouseDownScene_DoubleClick(sender, e)
End If
End Sub
#End Region ' EVENTS
End Class
+9 -4
View File
@@ -21,8 +21,12 @@
<Image Margin="1" Height="20" Width="20"
Source="{Binding SourceImg}">
</Image>
<TextBlock Margin="1" Text="{Binding Name}">
</TextBlock>
<TextBlock Margin="1" Text="{Binding Name}"/>
<StackPanel.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
Command="{Binding Path=DataContext.OnOffCommand,
RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor }}"/>
</StackPanel.InputBindings>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -40,6 +44,7 @@
</DataTrigger>
</Style.Triggers>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
@@ -504,7 +509,7 @@
Style="{StaticResource ImgButton}"/>
</StackPanel>
</Button>
</StackPanel>
</UniformGrid>
@@ -552,7 +557,7 @@
</Button>
</StackPanel>
<StackPanel Margin="1,0,0,0">
<Button ToolTip="{Binding ModifEndMsg}"
Style="{StaticResource Split_Button_Img}"
+6
View File
@@ -3040,6 +3040,12 @@ Public Class SplitModeVM
Return bOk
End Function
Friend Sub OnMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs)
OnMouseDownScene(sender, e)
If m_nSelected = GDB_ID.NULL Then Return
OnOff(Nothing)
End Sub
Friend Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Se tasto premuoto allora attivo la selezione multipla da Scena
Dim bKeyCtrlPressed = (Keyboard.Modifiers And ModifierKeys.Control) > 0