Files
EgtCAM5/ProjectPage/ProjectView.xaml.vb
T
Emmanuele Sassi 0851ba19d0 EgtCAM5 :
- Implementato uso della EgtSaveFileDialog da EgtWPFLib5.
- Abbozzata gestione dei file per GunStock.
- Aggiunta virtualizzazione dell'albero dei layer.
- Corretta visualizzazione pallini colorati nell'albero dei layer.
- Miglioramenti nel salvataggio delle MTable e selezione di quella corrente.
- Aggiunto colore Egaltech1 in IniFile per poterlo usare da codice.
2016-10-25 18:05:06 +00:00

106 lines
6.5 KiB
VB.net

Imports EgtWPFLib5.EgtFloating
Public Class ProjectView
Private m_bDoors As Boolean = False
Private m_bGunStock As Boolean = False
Private Sub UserControl_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
DoorsPanel.Visibility = Visibility.Collapsed
MachGroupPanel.Visibility = Visibility.Collapsed
GunStockPanel.Visibility = Visibility.Collapsed
End Sub
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
ShowPanel.IsFloating = False
ViewPanel.IsFloating = False
InstrumentPanel.IsFloating = False
GridPanel.IsFloating = False
DbPanel.IsFloating = False
ExecutePanel.IsFloating = False
DoorsPanel.IsFloating = False
DrawPanel.IsFloating = False
OptionPanel.IsFloating = False
MachGroupPanel.IsFloating = False
GunStockPanel.IsFloating = False
If GetPrivateProfileFloatingWinPos(S_GENERAL, "ShowPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(ShowPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "ViewPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(ViewPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "InstrumentPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(InstrumentPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "GridPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(GridPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "DoorsPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(DoorsPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "GunStockPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(DoorsPanel, 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
m_bDoors = IniFile.IsActiveDoors()
m_bGunStock = IsActiveGunStock()
Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
ShowPanel.Visibility = Visibility.Visible
ViewPanel.Visibility = Visibility.Visible
InstrumentPanel.Visibility = Visibility.Visible
GridPanel.Visibility = Visibility.Visible
DbPanel.Visibility = Visibility.Visible
ExecutePanel.Visibility = Visibility.Visible
DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
GunStockPanel.Visibility = If(m_bGunStock, Visibility.Visible, Visibility.Collapsed)
DrawPanel.Visibility = Visibility.Visible
OptionPanel.Visibility = Visibility.Visible
MachGroupPanel.Visibility = Visibility.Collapsed
End Sub)
Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub()
ShowPanel.Visibility = Visibility.Visible
ViewPanel.Visibility = Visibility.Visible
InstrumentPanel.Visibility = Visibility.Visible
GridPanel.Visibility = Visibility.Visible
DbPanel.Visibility = Visibility.Visible
ExecutePanel.Visibility = Visibility.Collapsed
DoorsPanel.Visibility = Visibility.Collapsed
GunStockPanel.Visibility = Visibility.Collapsed
DrawPanel.Visibility = Visibility.Collapsed
OptionPanel.Visibility = Visibility.Visible
MachGroupPanel.Visibility = If(IniFile.m_bMachiningGroup, Visibility.Visible, Visibility.Collapsed)
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