Compare commits

...

5 Commits

Author SHA1 Message Date
Nicola Pievani 55ef0b7fcb Merge branch 'master' into Features/Conferma_Ciclo_Start 2021-05-27 19:41:53 +02:00
Nicola Pievani 4ded60f9f7 Merge branch 'Features/Conferma_Ciclo_Start' into develop 2021-05-13 17:25:43 +02:00
Nicola Pievani 9e830bf2a5 Finestra conferma Ciclo Start 2021-05-13 17:23:56 +02:00
Nicola Pievani 1c84885a44 Miglioramento grafica 2021-05-13 17:21:53 +02:00
Nicola Pievani f2694511e5 Modalità di avvio in OptioPage 2021-05-13 14:25:20 +02:00
10 changed files with 296 additions and 72 deletions
+7
View File
@@ -190,6 +190,9 @@
<DependentUpon>CadCutPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="CAM\CamAuto.vb" />
<Compile Include="Project\CicloStartWD.xaml.vb">
<DependentUpon>CicloStartWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\StartLauncheWDr.xaml.vb">
<DependentUpon>StartLauncheWDr.xaml</DependentUpon>
</Compile>
@@ -414,6 +417,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\CicloStartWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\StartLauncheWDr.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
+10 -1
View File
@@ -921,7 +921,16 @@
<TextBlock Text="{Binding Name}" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" />
</DataTemplate>
<!--DataTemplate testo ed immagine-->
<DataTemplate x:Key="FileNameLsBxItem">
<DockPanel>
<TextBlock Text="{Binding GraphicName}" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
DockPanel.Dock="Left" Width="130"/>
<TextBlock Text="{Binding sDate}" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
DockPanel.Dock="Right" />
</DockPanel>
</DataTemplate>
<!--DataTemplate testo ed immagine-->
<DataTemplate x:Key="DataTemplateItem">
<Grid >
<Grid.ColumnDefinitions>
+44 -18
View File
@@ -537,28 +537,54 @@
</GroupBox>
<!--Selezione il tipo di avvio del programma-->
<GroupBox Name="StartLauncherGpBx"
Grid.Column="3" Grid.RowSpan="3" Grid.ColumnSpan="1"
Style="{DynamicResource OmagCut_GroupBox}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<ComboBox Name="StartLauncherCmBx" Grid.Column="1" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</GroupBox>
<GroupBox Name="FeedbackGpBx"
Grid.Column="4" Grid.RowSpan="3" Grid.ColumnSpan="1"
Style="{DynamicResource OmagCut_GroupBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Button Name="FeedbackBtn"
Grid.Row="1" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource SendImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Button Name="FeedbackBtn"
Grid.Row="1" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource SendImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</GroupBox>
+13 -1
View File
@@ -9,6 +9,8 @@ Public Class OptionsPageUC
Private UnitsList() As String = {"inch", "mm"}
Private ThemesList() As String = {"Classic", "Dark"}
Private StartLauncherList() As String = {"Last Project", "New Project", "Open Folder", "Show Window"}
Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Associazione della lista linguaggi alla combobox
@@ -28,6 +30,11 @@ Public Class OptionsPageUC
ThemesCmBx.SelectedIndex = GetPrivateProfileInt(S_GENERAL, K_THEME, 0, m_MainWindow.GetIniFile())
Themes_StartUp()
' Carico la lista con il tipo di avvio
StartLauncherCmBx.ItemsSource = StartLauncherList
' 0-New, 1-Last, 2-Open, 3-Window
StartLauncherCmBx.SelectedIndex = GetPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0, m_MainWindow.GetIniFile())
' Rendo invisibile il GroupBox dei Temi la versione corrente
' ThemesGpBx.Visibility = Windows.Visibility.Collapsed
@@ -102,7 +109,7 @@ Public Class OptionsPageUC
ToleranceEMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 21)
AffondamentoMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 27)
LarghezzaMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 28)
StartLauncherGpBx.Header = "Avvio Programma"
End Sub
Private Sub UpdateSlabDxf()
@@ -304,6 +311,11 @@ Public Class OptionsPageUC
WritePrivateProfileString(S_GENERAL, K_MESSAGES, m_MainWindow.m_CurrLanguage.LanguageName, m_MainWindow.GetIniFile())
End Sub
Private Sub StartLauncherCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles StartLauncherCmBx.SelectionChanged
Dim nIndex As Integer = StartLauncherCmBx.SelectedIndex
WritePrivateProfileString(S_GENERAL, K_AUTOLOADLASTPROJ, StartLauncherCmBx.SelectedIndex, m_MainWindow.GetIniFile())
End Sub
Private Sub UnitsOfMeasureCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles UnitsOfMeasureCmBx.SelectionChanged
Dim bMM As Boolean = (UnitsOfMeasureCmBx.SelectedIndex <> 0)
EgtSetUiUnits(bMM)
+50
View File
@@ -0,0 +1,50 @@
<Window x:Class="CicloStartWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="SaveNameWD" Height="200" Width="426.5" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
<Grid x:Name="SaveNameGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<TextBlock Name="CicloStartTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+38
View File
@@ -0,0 +1,38 @@
Imports EgtUILib
Imports EgtWPFLib
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Class CicloStartWD
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Public Sub New(Owner As Window)
Me.Owner = Owner
InitializeComponent()
End Sub
' inizializzo la finestra
Private Sub StartLauncherWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' posiziono la fistra in centro alla pagina
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
' imopposto il messaggio di avvio
CicloStartTxbl.Text = "Avvio Ciclo-Start"
End Sub
' creo un progetto nuovo
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
Me.Close()
End Sub
' Ultimo progetto
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
' Aspetto e lo avvio
System.Threading.Thread.Sleep(300)
' avvio il ciclo start della macchina
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
Me.Close()
End Sub
End Class
+18 -16
View File
@@ -173,11 +173,6 @@ Public Class CurrentProjectPageUC
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir())
m_bFirst = False
' ------------------ SELEZIONE AVVIO -----------------------------
'' apro la finstra di selezione di avvio del programma
'StartProgram()
' ------------------ SELEZIONE AVVIO -----------------------------
' Se richiesto, carico ultimo progetto
Dim bAutoLoadLast As Boolean = GetPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0, m_MainWindow.GetIniFile()) <> 0
If bAutoLoadLast Then
@@ -227,16 +222,20 @@ Public Class CurrentProjectPageUC
End Sub
Public Sub StartProgram()
' leggo il tipo di avvio del programma: 0-New, 1-Last, 2-Open, 3-Window
Dim nStart As Integer = GetPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0, m_MainWindow.GetIniFile())
Dim MyStartLancherWD As New StartLauncherWD(m_MainWindow)
MyStartLancherWD.ShowDialog()
' mostro la finestra di avvio solo se configirato (= 3)
If nStart = 3 Then
MyStartLancherWD.ShowDialog()
Else
MyStartLancherWD.CurrSelection = nStart
End If
' Se richiesto, carico ultimo progetto
Dim bAutoLoadLast As Boolean = GetPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0, m_MainWindow.GetIniFile()) <> 0
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
' se ultimo progetto
If MyStartLancherWD.CurrSelection = 2 Then
bAutoLoadLast = True
' se ultimo progetto (= 0)
If MyStartLancherWD.CurrSelection = 0 Then
' Stampo il numero di progetto con 4 decimali: 12 -> "0012"
Dim sPath As String = m_MainWindow.GetSaveDir() & "\" & m_nCurrProj.ToString("D4") & ".nge"
' provo ad aprire l'ultimo progetto modificato
@@ -249,8 +248,8 @@ Public Class CurrentProjectPageUC
End If
EgtResetModified()
' apro il file selezionato all'avvio
ElseIf MyStartLancherWD.CurrSelection = 3 Then
' seleziono file da finestra di avvio (= 4)
ElseIf MyStartLancherWD.CurrSelection = 4 Then
If Not LoadProject(MyStartLancherWD.SelPath, False) Then
' altrimenti apro un nuovo progetto
NewProject()
@@ -260,9 +259,8 @@ Public Class CurrentProjectPageUC
End If
EgtResetModified()
' se nuovo progetto o naviga direttorio
' se nuovo progetto (= 1) o naviga direttorio (= 2)
ElseIf MyStartLancherWD.CurrSelection = 1 Or MyStartLancherWD.CurrSelection = 0 Then
bAutoLoadLast = False
NewProject()
End If
@@ -588,6 +586,8 @@ Public Class CurrentProjectPageUC
SetProjectMaterial()
' Eseguo
If Not SaveFile(sPath) Then Return False
' aggiungo il file all'elenco dei file recenti
m_MruFiles.Add(sPath)
' Dichiaro progetto non modificato
EgtResetModified()
' Salvo eventuale VeinMatching
@@ -641,6 +641,8 @@ Public Class CurrentProjectPageUC
If Not SaveFile(sPath) Then
Return False
End If
' aggiungo il file all'elenco dei file recenti
m_MruFiles.Add(sPath)
' Dichiaro progetto non modificato
EgtResetModified()
Return True
+17 -5
View File
@@ -299,7 +299,6 @@ Public Class ProjectMgrUC
ptMid.z = (ptEnd.z + ptStart.z) / 2 + dDiam / 2
'--------------------------- Imposto la posizione della macchina ----------------------------
' Recupero la posizione macchina
Dim dL1, dL2, dL3, dR1, dR2 As Double
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
@@ -446,8 +445,18 @@ Public Class ProjectMgrUC
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SIMPLESTATISTICS) And nPhaseRestart = 0 Then
m_MainWindow.ExecSentProgScript(False)
''-------------------Avvio il Ciclo-Start-------------------------
'Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
'MyCicloStartWD.ShowDialog()
''-------------------Avvio il Ciclo-Start-------------------------
End If
End If
'-------------------Avvio il Ciclo-Start-------------------------
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
MyCicloStartWD.ShowDialog()
'-------------------Avvio il Ciclo-Start-------------------------
' Altrimenti linea di produzione
Else
' Verifico non sia già stato trasmesso
@@ -490,12 +499,12 @@ Public Class ProjectMgrUC
GetPrivateProfileInt(S_RAWPART, K_SLABID, 0, m_MainWindow.GetIniFile()) <> 0)
If bSlabId Then
Dim sBlock As String = ""
GetPrivateProfileString( S_RAWPART, K_BLOCKNAME, "", sBlock, m_MainWindow.GetIniFile())
Dim nSlabNbr As Integer = GetPrivateProfileInt( S_RAWPART, K_SLABNBR, 0, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_RAWPART, K_BLOCKNAME, "", sBlock, m_MainWindow.GetIniFile())
Dim nSlabNbr As Integer = GetPrivateProfileInt(S_RAWPART, K_SLABNBR, 0, m_MainWindow.GetIniFile())
nSlabNbr += 1
Dim sSlabNbr As String = nSlabNbr.ToString()
WritePrivateProfileString( S_RAWPART, K_SLABNBR, sSlabNbr, m_MainWindow.GetIniFile())
Utility.SetBlockAndSlabNbr( sBlock, sSlabNbr)
WritePrivateProfileString(S_RAWPART, K_SLABNBR, sSlabNbr, m_MainWindow.GetIniFile())
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
End If
' Salvo il progetto
m_CurrProjPage.SaveProject()
@@ -523,6 +532,7 @@ Public Class ProjectMgrUC
If AskTransm.m_nPressedBtn <> 1 Then Return
End If
End If
' Se non collegato alla macchina
If Not m_MainWindow.m_bNCLink Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90316)) 'Non connesso alla macchina
@@ -537,6 +547,7 @@ Public Class ProjectMgrUC
m_MainWindow.ExecSentProgScript(False, bAlreadySent)
Return
End If
' Leggo variabile relativa al programma 1 (standard E80021)
m_CurrNcComm.m_CN.n_DReadELS_handle = 0
m_CurrNcComm.m_CN.ReadEls_Add_Parameter(m_CurrMachine.sVarProg1, 1)
@@ -610,6 +621,7 @@ Public Class ProjectMgrUC
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90318)) 'La macchina non accetta il programma CN
End If
End If
#End If
End Sub
+26 -23
View File
@@ -4,7 +4,7 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="SaveNameWD" Height="300" Width="426.5" ShowInTaskbar="False">
Title="SaveNameWD" Height="350" Width="426.5" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
<Grid x:Name="SaveNameGrid">
@@ -14,19 +14,21 @@
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
</Grid.RowDefinitions>
<!--Messaggio di tipo di avvio-->
<!--Messaggio: Selezione modalità di avvio-->
<TextBlock Name="SlectLauncherTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
@@ -39,32 +41,33 @@
</Grid.ColumnDefinitions>
<!--apri folder progetti-->
<Button Name="OpenFolder" Grid.Column="0" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
ToolTip="OpenFolder">
<Image Source="{DynamicResource ZoomWinImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--nuovo progetto-->
<Button Name="NewProject" Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
ToolTip="New Project">
<Image Source="{DynamicResource CsvNewImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--ultimo progetto-->
<Button Name="LastProject" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
<Button Name="LastProject" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"
ToolTip="LastProject">
<Image Source="{DynamicResource CsvOpenImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--nuovo progetto-->
<Button Name="NewProject" Grid.Column="2" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"
ToolTip="New Project">
<Image Source="{DynamicResource CsvNewImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--apri folder progetti-->
<Button Name="OpenFolder" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"
ToolTip="OpenFolder">
<Image Source="{DynamicResource ZoomWinImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
<UniformGrid Grid.Column="1" Grid.Row="5">
<TextBlock Name="FileName" Grid.Column="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<TextBlock Name="DataFile" Grid.Column="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
</UniformGrid>
<!--lista degli ultimi file aperti-->
<ListBox Name="FilesLsBx" Grid.Column="1" Grid.Row="5"
SelectionMode="Extended">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
</Style>
</ListBox.ItemContainerStyle>
<ListBox Name="FilesLsBx" Grid.Column="1" Grid.Row="7" ItemTemplate="{DynamicResource FileNameLsBxItem}"
SelectionMode="Extended">
</ListBox>
+73 -8
View File
@@ -1,21 +1,30 @@
Imports EgtUILib
Imports EgtWPFLib
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Public Class StartLauncherWD
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
' lista dei file recenti da visualizzare
Private m_RecentFileList As New ObservableCollection(Of FileNameLsBxItem)
Public Enum MODE_LAUNCHER As Integer
OpenFolder = 0
NewProject = 1
LastProject = 2
SelectedProject = 3
Public Enum MODE_LAUNCHER
LastProject
OpenFolder
NewProject
ShowWindow
SelectedProject
End Enum
Private m_CurrSelection As MODE_LAUNCHER
Public ReadOnly Property CurrSelection As MODE_LAUNCHER
Public Property CurrSelection As MODE_LAUNCHER
Get
Return m_CurrSelection
End Get
Set(value As MODE_LAUNCHER)
m_CurrSelection = value
End Set
End Property
Private m_SelPath As String = String.Empty
@@ -30,15 +39,70 @@ Public Class StartLauncherWD
InitializeComponent()
End Sub
'--------------------------- lista dei file recenti -----------------------------------------------------------------------
Private Class FileNameLsBxItem
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private m_sDate As String
Private m_sName As String
Public Property sDate As String
Get
Return m_sDate
End Get
Set(value As String)
m_sDate = value
End Set
End Property
Public Property Name As String
Get
Return m_sName
End Get
Set(value As String)
If value <> m_sName Then
m_sName = value
NotifyPropertyChanged("Name")
End If
End Set
End Property
Public ReadOnly Property GraphicName As String
Get
' recupero il nome del file con estensione, altrimenti -> Path.GetFileNameWithoutExtension(m_sName)
Return Path.GetFileNameWithoutExtension(m_sName)
End Get
End Property
Sub New(Name As String, dDate As Date)
Me.m_sName = Name
Me.m_sDate = dDate.ToString
End Sub
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
'--------------------------- lista dei file recenti -----------------------------------------------------------------------
' inizializzo la finestra
Private Sub StartLauncherWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
FilesLsBx.ItemsSource = m_RecentFileList
' carico la liste dei file recenti
FilesLsBx.ItemsSource = m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.FileNames
For Each ItemFile In m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.FileNames
m_RecentFileList.Add(New FileNameLsBxItem(ItemFile, File.GetLastAccessTime(ItemFile)))
Next
' posiziono la fistra in centro alla pagina
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
' imopposto il messaggio di avvio
SlectLauncherTxbl.Text = "Seleziona modalità di avvio"
FileName.Text = "Progetti recenti"
DataFile.Text = "Ultima apertura"
End Sub
' lancio l'apertura della pagina dei progetti
@@ -68,7 +132,8 @@ Public Class StartLauncherWD
' quando viene rilasciato il mouse
Private Sub SelectProject_MouseUp(sender As Object, e As RoutedEventArgs) Handles FilesLsBx.MouseDoubleClick, FilesLsBx.TouchUp
m_SelPath = FilesLsBx.SelectedItem
' recupero il nome selezionato
m_SelPath = FilesLsBx.SelectedItem.Name
m_CurrSelection = MODE_LAUNCHER.SelectedProject
EgtZoom(ZM.ALL)
Me.Close()