Aggiunto SpecialPanel per eseguire script lua
This commit is contained in:
@@ -36,7 +36,9 @@ Module ConstGen
|
||||
Public Const CONF_DIR As String = "Config"
|
||||
' Sottodirettorio delle risorse
|
||||
Public Const RES_DIR As String = "Resources"
|
||||
' Sottodirettorio temporaneo
|
||||
' Sottodirettorio degli scripts lua
|
||||
Public Const SCRIPT_DIR As String = "Scripts"
|
||||
' Sottodirettorio temporaneo
|
||||
Public Const TEMP_DIR As String = "Temp"
|
||||
' Sottodirettorio di default per il salvataggio con nome
|
||||
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
||||
|
||||
@@ -105,6 +105,9 @@ Module ConstIni
|
||||
Public Const K_LAUNCHER As String = "Launcher"
|
||||
Public Const K_LASTPROJECT As String = "LastProject"
|
||||
|
||||
Public Const S_SPECIAL As String = "Special"
|
||||
Public Const K_SPECIALENABLE As String = "SpecialEnable"
|
||||
|
||||
'-------------------------------------------------------------------------
|
||||
Public Const DEFAULT_INI_FILE_NAME As String = "Default.ini"
|
||||
|
||||
|
||||
@@ -227,6 +227,10 @@
|
||||
<DependentUpon>SelectPartV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\SelectPartVM.vb" />
|
||||
<Compile Include="ProjectManager\SpecialPanelV.xaml.vb">
|
||||
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\SpecialPanelVM.vb" />
|
||||
<Compile Include="RegexFunction.vb" />
|
||||
<Compile Include="ReportInfo\ReportCompo.vb" />
|
||||
<Compile Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml.vb">
|
||||
@@ -371,6 +375,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProjectManager\SpecialPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<EgtDOORCreator:AssemblyPageVM x:Key="AssemblyPageVM"/>
|
||||
<EgtDOORCreator:HardwarePageVM x:Key="HardwarePageVM"/>
|
||||
<EgtDOORCreator:DimensioningPanelVM x:Key="DimensioningPanelVM"/>
|
||||
<EgtDOORCreator:SpecialPanelVM x:Key="SpecialPanelVM"/>
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
||||
|
||||
+20
@@ -63,6 +63,10 @@ Friend Module IniFile
|
||||
Friend m_sEgtCam5EXEPath As String = String.Empty
|
||||
' Path LuaLibs Dir
|
||||
Friend m_sLuaLibsDir As String = String.Empty
|
||||
' Path ResourcesRoot
|
||||
Friend m_sResourcesRoot As String = String.Empty
|
||||
' Path ScriptsRoot
|
||||
Friend m_sScriptsRoot As String = String.Empty
|
||||
|
||||
' EgtDoorCreator.ini
|
||||
Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language
|
||||
@@ -487,4 +491,20 @@ Friend Module IniFile
|
||||
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sDoorsDirPath & "\MTables\GeometryNameList.ini")
|
||||
End Function
|
||||
|
||||
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadButtonItem As ButtonItem) As Boolean
|
||||
ReadButtonItem = Nothing
|
||||
Dim sVal As String = String.Empty
|
||||
GetMainPrivateProfileString(sSection, sKey, "", sVal)
|
||||
If String.IsNullOrWhiteSpace(sVal) Then Return False
|
||||
Dim sItems() As String = sVal.Split(","c)
|
||||
If sItems.Count() >= 1 Then
|
||||
Dim sLuaPath As String = sItems(0)
|
||||
Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
|
||||
Dim sToolTip As String = If(sItems.Count() >= 3, sItems(2), "")
|
||||
ReadButtonItem = New ButtonItem(sLuaPath, sImagePath, sToolTip)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -30,6 +30,10 @@ Friend Class MainWindowModel
|
||||
IniFile.m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' Impostazione direttorio per file temporanei
|
||||
IniFile.m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
|
||||
' Impostazione direttorio per risorse programma
|
||||
IniFile.m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
' Impostazione direttorio scripts lua
|
||||
IniFile.m_sScriptsRoot = m_sDataRoot & "\" & SCRIPT_DIR
|
||||
' Impostazione direttorio Ini file
|
||||
IniFile.m_sIniFile = IniFile.m_sConfigDir & "\" & INI_FILE_NAME
|
||||
' Impostazione path Ini file
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
Private m_refOptionsVM As OptionsVM
|
||||
|
||||
Private m_refSpecialPanelVM As SpecialPanelVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
@@ -148,6 +150,12 @@
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
|
||||
Get
|
||||
Return m_refSpecialPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
@@ -252,6 +260,11 @@
|
||||
Return Not IsNothing(m_refHardwareHelpSceneHostV)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSpecialPanelVM(SpecialPanelVM As SpecialPanelVM) As Boolean
|
||||
m_refSpecialPanelVM = SpecialPanelVM
|
||||
Return Not IsNothing(m_refSpecialPanelVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.7.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.7.3.2")>
|
||||
<Assembly: AssemblyVersion("2.7.3.3")>
|
||||
<Assembly: AssemblyFileVersion("2.7.3.3")>
|
||||
|
||||
@@ -7,6 +7,9 @@ Friend Module OptionModule
|
||||
' flag per modalità di visualizzazione file (solo lettura)
|
||||
Friend ReadOnlyDDF As Boolean = False
|
||||
|
||||
' gestione bottoni nella barra SpecialPanel
|
||||
Friend IsActiveSpecialPanel As Boolean = False
|
||||
|
||||
' flag per forzare l'aggiornamento delle dimensioni anta dei file DDT
|
||||
Friend AdjustDDT As Boolean = False
|
||||
Friend FileNameFromArgs As String = String.Empty
|
||||
@@ -777,6 +780,9 @@ Friend Module OptionModule
|
||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, "0", BottomOverMaterialAss)
|
||||
Utility.ConvertCompoConfig(BottomOverMaterialAss, 100)
|
||||
m_BottomOverMaterialAssembly = BottomOverMaterialAss
|
||||
' Visualizzazione SpecialPanel
|
||||
Dim btDummy As ButtonItem = Nothing
|
||||
IsActiveSpecialPanel = GetMainPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0 AndAlso GetPrivateProfileButton(S_SPECIAL, K_BUTTON & "1", "", btDummy)
|
||||
|
||||
' Lista messaggi per launcher
|
||||
m_OptionLauncherList.Add(EgtMsg(50206)) 'Open Window
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
<UserControl x:Class="ProjectManagerV"
|
||||
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:DOORCreator="clr-namespace:EgtDOORCreator" >
|
||||
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding EnableProjectManager}" Height="32">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding NewProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||
</Button>
|
||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding DeleteProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
||||
Focusable="False"
|
||||
ContextMenuService.Placement="Bottom"
|
||||
Tag="{Binding}">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand,
|
||||
RelativeSource={RelativeSource Mode=FindAncestor,
|
||||
AncestorType=ContextMenu}}"/>
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
|
||||
@@ -44,74 +45,77 @@
|
||||
</Button>
|
||||
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityTemplate}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityEgtCAM}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/EgtCAM5.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding PrintCommand}" ToolTip="{Binding PrintToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding RefreshDirCommand}" ToolTip="{Binding RefreshDirToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding RefreshDirCommand}" ToolTip="{Binding RefreshDirToolTip}" Focusable="False">
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<!--Hardware-->
|
||||
<!--<Button Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}" Focusable="False"
|
||||
<!--Hardware-->
|
||||
<!--<Button Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}" Focusable="False"
|
||||
Visibility="{Binding DisableHM}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/InstrumentPanel/Hardware.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>-->
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityCreateAssembly}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False"
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False"
|
||||
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
|
||||
<DOORCreator:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"/>
|
||||
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--Door-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<!--Door-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
ToolTip="{Binding DoorToolTip}"
|
||||
IsChecked="{Binding DoorIsChecked}"
|
||||
Content="{Binding DoorToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
<!--Hardware-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
</RadioButton>
|
||||
<!--Hardware-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}"
|
||||
Content="{Binding HardwareToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<UserControl x:Class="SpecialPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:EgtDOORCreator"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Visibility="{Binding SpecialPanelVisibility}">
|
||||
<StackPanel Orientation="Horizontal" Height="32">
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}">
|
||||
<Image Source="{Binding ImagePath}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class SpecialPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,121 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class SpecialPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_ButtonList As New List(Of ButtonItem)
|
||||
Public ReadOnly Property ButtonList As List(Of ButtonItem)
|
||||
Get
|
||||
Return m_ButtonList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SpecialPanelVisibility As Visibility
|
||||
Public ReadOnly Property SpecialPanelVisibility As Visibility
|
||||
Get
|
||||
Return m_SpecialPanelVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSpecialPanelVisibility(bValue As Boolean)
|
||||
m_SpecialPanelVisibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(SpecialPanelVisibility))
|
||||
End Sub
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefSpecialPanelVM(Me)
|
||||
' se attivo, inizializzo i bottoni leggendoli da file ini
|
||||
If OptionModule.IsActiveSpecialPanel Then
|
||||
Dim BtnIndex As Integer = 1
|
||||
Dim CurrBtn As ButtonItem = Nothing
|
||||
While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)
|
||||
m_ButtonList.Add(CurrBtn)
|
||||
BtnIndex += 1
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ButtonItem
|
||||
Inherits VMBase
|
||||
|
||||
Private m_sImagePath As String
|
||||
Public ReadOnly Property ImagePath As String
|
||||
Get
|
||||
Return m_sImagePath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sLuaCmdPath As String
|
||||
|
||||
Private m_sToolTip As String
|
||||
Public ReadOnly Property ToolTip As String
|
||||
Get
|
||||
Return m_sToolTip
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_Btn_Visibility As Visibility
|
||||
Public ReadOnly Property Btn_Visibility As Visibility
|
||||
Get
|
||||
Return m_Btn_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_Btn_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property Btn_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_Btn_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdLuaExec As ICommand
|
||||
|
||||
Sub New(sLuaCmdPath As String, sImagePath As String, sToolTip As String)
|
||||
' creo il percorso del file
|
||||
m_sImagePath = IniFile.m_sResourcesRoot & "\" & sImagePath
|
||||
If Not File.Exists(m_sImagePath) Then
|
||||
EgtOutLog("File '" & m_sImagePath & "' does not exist.")
|
||||
End If
|
||||
m_sLuaCmdPath = IniFile.m_sScriptsRoot & "\" & sLuaCmdPath
|
||||
m_sToolTip = sToolTip
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "LuaExecCommand"
|
||||
|
||||
Public ReadOnly Property LuaExecCommand As ICommand
|
||||
Get
|
||||
If m_cmdLuaExec Is Nothing Then
|
||||
m_cmdLuaExec = New Command(AddressOf LuaExec)
|
||||
End If
|
||||
Return m_cmdLuaExec
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub LuaExec(ByVal param As Object)
|
||||
If Not File.Exists(m_sLuaCmdPath) Then
|
||||
EgtOutLog("File '" & m_sLuaCmdPath & "' does not exists.")
|
||||
Return
|
||||
End If
|
||||
If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then
|
||||
EgtOutLog("File '" & m_sLuaCmdPath & "' has not '.lua' extension.")
|
||||
Return
|
||||
End If
|
||||
Dim bOk As Boolean = EgtLuaExecFile(m_sLuaCmdPath)
|
||||
If Not bOk Then
|
||||
EgtOutLog("File '" & m_sLuaCmdPath & "' has not been excute.")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' LuaExecCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user