-inserimento toppanelbutton
This commit is contained in:
@@ -2,9 +2,13 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class SceneButtonVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public Shared m_nIndexList As Integer = 0
|
||||
Public Shared m_nIndexListConverter As Integer = 0
|
||||
|
||||
Private m_TopListBtn As New List(Of SceneBtn)
|
||||
Public Property TopListBtn As List(Of SceneBtn)
|
||||
Get
|
||||
@@ -55,11 +59,14 @@ Public Class SceneButtonVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TopPanelVM As TopPanelVM
|
||||
Friend ReadOnly Property TopPanelVM As TopPanelVM
|
||||
Private m_TopPanelListGroupBtn As New List(Of GroupSceneBtn)
|
||||
Public Property TopPanelListGroupBtn As List(Of GroupSceneBtn)
|
||||
Get
|
||||
Return m_TopPanelVM
|
||||
Return m_TopPanelListGroupBtn
|
||||
End Get
|
||||
Set(value As List(Of GroupSceneBtn))
|
||||
m_TopPanelListGroupBtn = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
@@ -67,7 +74,9 @@ Public Class SceneButtonVM
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
Map.SetRefSceneButtonVM(Me)
|
||||
LoadButtons()
|
||||
LoadGroupButtons()
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -85,6 +94,17 @@ Public Class SceneButtonVM
|
||||
SetButtonsLocation(BOTTOMCENTERLIST_BTN, m_BottomCenterListBtn)
|
||||
End Sub
|
||||
|
||||
Private Sub LoadGroupButtons()
|
||||
Dim Index As Integer = 1
|
||||
Dim SubTitle As String = String.Empty
|
||||
Dim sKeyTitle As String = TOPPANELLIST_BTN & "_" & Index.ToString()
|
||||
While GetMainPrivateProfileString(sKeyTitle, "SubTitle", "", SubTitle) > 0
|
||||
SetGroupButtonsLocation(sKeyTitle, m_TopPanelListGroupBtn)
|
||||
Index += 1
|
||||
sKeyTitle = TOPPANELLIST_BTN & "_" & Index.ToString()
|
||||
End While
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che permette di posizionare i bottoni letti da file ini
|
||||
''' </summary>
|
||||
@@ -116,6 +136,14 @@ Public Class SceneButtonVM
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub SetGroupButtonsLocation(PositionList As String, ListGroupBtn As List(Of GroupSceneBtn))
|
||||
Dim LocalListSceneBtn As New List(Of SceneBtn)
|
||||
Dim SubTitle As String = String.Empty
|
||||
SetButtonsLocation(PositionList, LocalListSceneBtn)
|
||||
GetMainPrivateProfileString(PositionList, "SubTitle", "", SubTitle)
|
||||
ListGroupBtn.Add(New GroupSceneBtn(LocalListSceneBtn, SubTitle))
|
||||
End Sub
|
||||
|
||||
Public Function IsTgBtnChecked(Flag As String) As Boolean
|
||||
' cerco il bottone con il flag richiesto
|
||||
Dim Btn As _ToggleButton = m_BottomListBtn.FirstOrDefault(Function(x) x.Flag = Flag)
|
||||
@@ -151,6 +179,43 @@ Public Class SceneButtonVM
|
||||
|
||||
End Class
|
||||
|
||||
Public Class GroupSceneBtn
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SubTitle As String
|
||||
Public Property SubTitle As String
|
||||
Get
|
||||
Return m_SubTitle
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SubTitle = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TopPanelListBtn As New List(Of SceneBtn)
|
||||
Public Property TopPanelListBtn As List(Of SceneBtn)
|
||||
Get
|
||||
Return m_TopPanelListBtn
|
||||
End Get
|
||||
Set(value As List(Of SceneBtn))
|
||||
m_TopPanelListBtn = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(TopPanelListBtn As List(Of SceneBtn), sSubTitle As String)
|
||||
m_TopPanelListBtn = TopPanelListBtn
|
||||
m_SubTitle = sSubTitle
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SceneBtn
|
||||
Inherits VMBase
|
||||
|
||||
@@ -414,4 +479,20 @@ Module SceneCmd
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
End Module
|
||||
End Module
|
||||
|
||||
Public Class SplitConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim dValue As Double = CDbl(value)
|
||||
Dim dParam As Double = Map.refSceneButtonVM.TopPanelListGroupBtn(SceneButtonVM.m_nIndexListConverter).TopPanelListBtn.Count
|
||||
SceneButtonVM.m_nIndexListConverter += 1
|
||||
Return (Math.Floor(dParam / 2) + 1) * 35
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user