EgtCAM5 :

- Cambiati nomi classi e file.
This commit is contained in:
Emmanuele Sassi
2018-04-10 17:08:35 +00:00
parent 4e2801a1c4
commit a4b5cd4834
144 changed files with 517 additions and 521 deletions
@@ -0,0 +1,16 @@
<UserControl x:Class="InfoExpanderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5.EgtCAM5">
<Expander IsExpanded="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<TextBlock Text="{Binding PropertiesMsg}"/>
</Expander.Header>
<UniformGrid>
<TextBox Text="{Binding InfoBox}" MaxHeight="100" IsReadOnly="True" HorizontalScrollBarVisibility="Auto"/>
</UniformGrid>
</Expander>
</UserControl>
@@ -0,0 +1,3 @@
Public Class InfoExpanderView
End Class
@@ -0,0 +1,86 @@
Imports EgtUILib
Namespace EgtCAM5
Public Class InfoExpanderViewModel
Inherits ViewModelBase
#Region "Messages"
Public ReadOnly Property PropertiesMsg As String
Get
Return EgtMsg(MSG_DRAWOPTION + 1)
End Get
End Property
#End Region
Private m_IsExpanded As Boolean
Public Property IsEnabled As Boolean
Get
Return m_IsExpanded
End Get
Set(value As Boolean)
If value <> m_IsExpanded Then
m_IsExpanded = value
OnPropertyChanged("IsEnabled")
End If
End Set
End Property
Private m_InfoBox As String
Public Property InfoBox As String
Get
Return m_InfoBox
End Get
Set(value As String)
If value <> m_InfoBox Then
m_InfoBox = value
If value <> String.Empty Then
IsEnabled = True
Else
IsEnabled = False
End If
OnPropertyChanged("InfoBox")
End If
End Set
End Property
Sub New()
Application.Msn.Register(Application.UPDATEOBJDATAINOBJTREE, Sub(Id As Integer)
UpdateObjDataInObjTree(Id)
End Sub)
Application.Msn.Register(Application.SETINFOBOX, Sub(sString As String)
InfoBox = sString
End Sub)
End Sub
Private Sub UpdateObjDataInObjTree(ByVal nId As Integer)
' recupero il tipo del nuovo oggetto
Dim nType As Integer = EgtGetType(nId)
' stampa dei dati dell'oggetto
Dim sDump As String = String.Empty
If nType = GDB_TY.NONE Then
InfoBox = String.Empty
ElseIf nType = GDB_TY.GROUP Then
If EgtGroupDump(nId, sDump) Then
InfoBox = sDump
IsEnabled = True
Else
InfoBox = String.Empty
IsEnabled = False
End If
Else
If EgtGeoObjDump(nId, sDump) Then
InfoBox = sDump
IsEnabled = True
Else
InfoBox = String.Empty
IsEnabled = False
End If
End If
End Sub
End Class
End Namespace