-inserimento toppanelbutton
This commit is contained in:
+7
-7
@@ -12,13 +12,13 @@
|
||||
Protected Overrides Sub OnStartup(e As StartupEventArgs)
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
If e.Args.Count = 0 Then
|
||||
' creo finestra SplashScreen
|
||||
Dim SplashScreen As New SplashScreenV
|
||||
Me.MainWindow = SplashScreen
|
||||
Me.MainWindow.Show()
|
||||
Map.SetRefSplashScreen(SplashScreen)
|
||||
End If
|
||||
'If e.Args.Count = 0 Then
|
||||
' ' creo finestra SplashScreen
|
||||
' Dim SplashScreen As New SplashScreenV
|
||||
' Me.MainWindow = SplashScreen
|
||||
' Me.MainWindow.Show()
|
||||
' Map.SetRefSplashScreen(SplashScreen)
|
||||
'End If
|
||||
' Creo la View principale
|
||||
Me.MainWindow = New MainWindowV
|
||||
' Mostro la View principale
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
Public Const RIGHTLIST_BTN As String = "RightListBtn"
|
||||
Public Const BOTTOMLIST_BTN As String = "BottomListBtn"
|
||||
Public Const BOTTOMCENTERLIST_BTN As String = "BottomCenterListBtn"
|
||||
Public Const TOPPANELLIST_BTN As String = "TopPanelListBtn"
|
||||
|
||||
Public Const UTILITY_FOLDER As String = "Utility"
|
||||
|
||||
|
||||
@@ -21,6 +21,13 @@ Public Class MainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SceneButtonVM As SceneButtonVM
|
||||
Friend ReadOnly Property SceneButtonVM As SceneButtonVM
|
||||
Get
|
||||
Return m_SceneButtonVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione Comandi
|
||||
Private m_cmdAboutBox As ICommand
|
||||
Private m_cmdCloseApplication As ICommand
|
||||
@@ -36,6 +43,8 @@ Public Class MainWindowVM
|
||||
m_MainWindowM = New MainWindowM
|
||||
' Creo Option
|
||||
m_OptionWindowVM = New OptionWindowVM
|
||||
' Creo SceneButton
|
||||
m_SceneButtonVM = New SceneButtonVM
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
InitializeComponent()
|
||||
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
m_refSceneButtonVM = New SceneButtonVM()
|
||||
m_refSceneButtonVM = Map.refSceneButtonVM
|
||||
Map.SetRefSceneButtonVM(m_refSceneButtonVM)
|
||||
SolidManagerM.ManageUndoRedo()
|
||||
Me.DataContext = m_refSceneButtonVM
|
||||
|
||||
@@ -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
|
||||
@@ -30,6 +30,7 @@ Public Class SecondaryWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SceneButtonVM As SceneButtonVM
|
||||
Public ReadOnly Property sProjectPath As String
|
||||
Get
|
||||
Dim sFilePath As String = ""
|
||||
@@ -73,6 +74,7 @@ Public Class SecondaryWindowVM
|
||||
EgtResetModified()
|
||||
' segno su contatore splashscreen render finito
|
||||
m_WaitAfterRender = 1
|
||||
'
|
||||
End Sub
|
||||
|
||||
Private Sub SplashScreenTimer_Tick()
|
||||
|
||||
@@ -1,84 +1,44 @@
|
||||
<Grid x:Class="TopPanelButtonV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtStone3D="clr-namespace:EgtStone3D" Margin="15,-5,0,0"
|
||||
x:Name="GridTopPanelButton">
|
||||
<Grid.Resources>
|
||||
<EgtStone3D:SplitConverter x:Key="SplitConverter"/>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="1"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="30,0,2,0"/>
|
||||
<ItemsControl ItemsSource="{Binding TopPanelListBtn}"
|
||||
Style="{DynamicResource TopList_ItemsControl}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type EgtStone3D:_Button}">
|
||||
<Button ToolTip="{Binding Name}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Command="{Binding CmdBtn}"
|
||||
Style="{DynamicResource SceneButton}">
|
||||
<Image Source="{Binding Img}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type EgtStone3D:_ToggleButton}">
|
||||
<ToggleButton Command="{Binding CmdBtn}"
|
||||
IsChecked="{Binding IsChecked}"
|
||||
Style="{DynamicResource SceneToggleButton}">
|
||||
<Image Source="{Binding Img}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Content="2"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="30,3,2,0"/>
|
||||
|
||||
<Button Grid.Column="1"
|
||||
Content="3"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,0,2,0"/>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Content="4"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,3,2,0"/>
|
||||
|
||||
<Button Grid.Column="2"
|
||||
Content="5"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,0,2,0"/>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Content="6"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,3,2,0"/>
|
||||
|
||||
<Button Grid.Column="3"
|
||||
Content="7"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,0,2,0"/>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
Content="8"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,3,2,0"/>
|
||||
|
||||
<Button Grid.Column="4"
|
||||
Content="9"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,0,2,0"/>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Grid.Column="4"
|
||||
Content="10"
|
||||
Height="30"
|
||||
Width="30"
|
||||
Margin="0,3,2,0"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Margin="0,8,0,0"
|
||||
Grid.Column="2" Text="Prova"
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding SubTitle}"
|
||||
Style="{StaticResource TopPanel_TxBl}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
Public Class TopPanelButtonV
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SceneButtonVM As SceneButtonVM
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
|
||||
' La chiamata è richiesta dalla finestra di progettazione.
|
||||
InitializeComponent()
|
||||
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
m_SceneButtonVM = Map.refSceneButtonVM
|
||||
Me.DataContext = m_SceneButtonVM.TopPanelListGroupBtn(SceneButtonVM.m_nIndexList)
|
||||
SceneButtonVM.m_nIndexList += 1
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
|
||||
+23
-4
@@ -32,10 +32,29 @@
|
||||
<EgtStone3D:TopPanelViewProspectiveV Grid.Column="4" DataContext="{StaticResource TopPanelVM}"/>
|
||||
<Line Grid.Column="5"
|
||||
Style="{StaticResource TopPanel_Line}"/>
|
||||
<EgtStone3D:TopPanelButtonV Grid.Column="6" Margin="0,0,10,0"/>
|
||||
<Line Grid.Column="7"
|
||||
Style="{StaticResource TopPanel_Line}"/>
|
||||
<EgtStone3D:TopPanelButtonV Grid.Column="8" Margin="20,0,10,0"/>
|
||||
|
||||
<ItemsControl Grid.Column="6"
|
||||
ItemsSource="{Binding TopPanelListGroupBtn}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal"
|
||||
Width="500"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type EgtStone3D:GroupSceneBtn}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<EgtStone3D:TopPanelButtonV/>
|
||||
<Line Style="{StaticResource TopPanel_Line}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
|
||||
<!--<EgtStone3D:TopPanelButtonV Grid.Column="6" Margin="30,-10,0,0"/>-->
|
||||
<!--<Line Grid.Column="7"
|
||||
Style="{StaticResource TopPanel_Line}"/>-->
|
||||
<!--<EgtStone3D:TopPanelButton2V Grid.Column="8" Margin="30,-10,0,0"/>-->
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding Parametrico_Msg}">
|
||||
|
||||
@@ -125,6 +125,12 @@ Public Class TopPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TopPanelListGroupBtn As List(Of GroupSceneBtn)
|
||||
Get
|
||||
Return Map.refSceneButtonVM.TopPanelListGroupBtn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewFile_Msg
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<EgtStone3D:ViewPanelVM x:Key="ViewPanelVM"/>
|
||||
<EgtStone3D:ViewPanelProspectiveVM x:Key="ViewPanelProspectiveVM"/>
|
||||
<EgtStone3D:SVGVM x:Key="SVGVM"/>
|
||||
<EgtStone3D:SceneButtonVM x:Key="SceneButtonVM"/>
|
||||
|
||||
<!--#endregion-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user