Files
EgtCAM5/ProjectPage/ProjectView.xaml.vb
T
Emmanuele Sassi 35eda772d0 EgtCAM5 + EgtWPFLib5 1.6t1 :
- Aggiunti controlli Floating (prima versione).
2016-08-29 07:31:52 +00:00

56 lines
2.8 KiB
VB.net

Imports EgtWPFLib5.EgtFloating
Public Class ProjectView
Private Sub UserControl_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Leggo posizioni Floating window
Dim sState As String = String.Empty
Dim nIndex As Integer = -1
Dim nLeft As Integer = -1
Dim nTop As Integer = -1
GridViewPanel.IsFloating = False
DrawPanel.IsFloating = False
OptionPanel.IsFloating = False
If GetPrivateProfileFloatingWinPos(S_GENERAL, "GridViewPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(GridViewPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "DrawPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(DrawPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "OptionPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(OptionPanel, sState, nIndex, nLeft, nTop)
End If
Application.Msn.Register(Application.PROJECTPAGE_DRAWMODE, Sub()
GridViewPanel.Visibility = Visibility.Visible
DrawPanel.Visibility = Visibility.Visible
OptionPanel.Visibility = Visibility.Visible
End Sub)
Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
GridViewPanel.Visibility = Visibility.Visible
DrawPanel.Visibility = Visibility.Collapsed
OptionPanel.Visibility = Visibility.Visible
End Sub)
End Sub
Private Sub PanelPositioning(FloatingPanel As EgtFloatingPanel, sState As String, nIndex As Integer, nLeft As Integer, nTop As Integer)
Select Case sState
Case "TOP"
FloatingPanel.ChangePosition(TOPTRAY)
Case "BOTTOM"
FloatingPanel.ChangePosition(BOTTOMTRAY)
Case "LEFT"
FloatingPanel.ChangePosition(LEFTTRAY)
Case "RIGHT"
FloatingPanel.ChangePosition(RIGHTTRAY)
Case "FLOATING"
FloatingPanel.ChangePosition(New Point(nLeft, nTop))
End Select
End Sub
Private Sub UserControl_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Salvo le posizioni di tutti gli EgtPanel
End Sub
End Class