78 lines
2.5 KiB
VB.net
78 lines
2.5 KiB
VB.net
Imports EgtUILib
|
|
Imports EgtWPFLib
|
|
Public Class StartLauncherWD
|
|
|
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
|
|
Public Enum MODE_LAUNCHER As Integer
|
|
OpenFolder = 0
|
|
NewProject = 1
|
|
LastProject = 2
|
|
SelectedProject = 3
|
|
End Enum
|
|
|
|
Private m_CurrSelection As MODE_LAUNCHER
|
|
Public ReadOnly Property CurrSelection As MODE_LAUNCHER
|
|
Get
|
|
Return m_CurrSelection
|
|
End Get
|
|
End Property
|
|
|
|
Private m_SelPath As String = String.Empty
|
|
Public ReadOnly Property SelPath As String
|
|
Get
|
|
Return m_SelPath
|
|
End Get
|
|
End Property
|
|
|
|
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
|
|
' carico la liste dei file recenti
|
|
FilesLsBx.ItemsSource = m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.FileNames
|
|
' 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"
|
|
End Sub
|
|
|
|
' lancio l'apertura della pagina dei progetti
|
|
Private Sub OpenFolder_Click(sender As Object, e As RoutedEventArgs) Handles OpenFolder.Click
|
|
m_CurrSelection = MODE_LAUNCHER.OpenFolder
|
|
m_MainWindow.m_PrevActivePage = m_MainWindow.m_ActivePage
|
|
' Passo alla pagina di apertura con preview
|
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_OpenPage)
|
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Open
|
|
Me.Close()
|
|
End Sub
|
|
|
|
' creo un progetto nuovo
|
|
Private Sub NewProject_Click(sender As Object, e As RoutedEventArgs) Handles NewProject.Click
|
|
m_CurrSelection = MODE_LAUNCHER.NewProject
|
|
EgtZoom(ZM.ALL)
|
|
Me.Close()
|
|
End Sub
|
|
|
|
' Ultimo progetto
|
|
Private Sub LastProject_Click(sender As Object, e As RoutedEventArgs) Handles LastProject.Click
|
|
m_CurrSelection = MODE_LAUNCHER.LastProject
|
|
EgtZoom(ZM.ALL)
|
|
Me.Close()
|
|
End Sub
|
|
|
|
' quando viene rilasciato il mouse
|
|
Private Sub SelectProject_MouseUp(sender As Object, e As RoutedEventArgs) Handles FilesLsBx.MouseDoubleClick, FilesLsBx.TouchUp
|
|
m_SelPath = FilesLsBx.SelectedItem
|
|
m_CurrSelection = MODE_LAUNCHER.SelectedProject
|
|
EgtZoom(ZM.ALL)
|
|
Me.Close()
|
|
End Sub
|
|
|
|
End Class
|