Finestra selezione di avvio
This commit is contained in:
+26
-7
@@ -262,6 +262,8 @@ Class MainWindow
|
||||
End If
|
||||
' Impostazione direttorio di configurazione
|
||||
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' imposto nella libreria il riferimento del file config
|
||||
EgtWPFLib5.IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
|
||||
' Impostazione direttorio delle risorse
|
||||
m_sResourcesDir = m_sDataRoot & "\" & RES_DIR
|
||||
' Impostazione direttorio per file temporanei
|
||||
@@ -293,7 +295,7 @@ Class MainWindow
|
||||
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
|
||||
End If
|
||||
' Impostazione direttorio costruttori di utensili
|
||||
if GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir, m_sIniFile) = 0 Then
|
||||
If GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir, m_sIniFile) = 0 Then
|
||||
m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
|
||||
End If
|
||||
' Recupero nome macchina corrente
|
||||
@@ -316,10 +318,10 @@ Class MainWindow
|
||||
GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
EgtSetKey(sKey)
|
||||
Dim sNestKey As String = ""
|
||||
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||
EgtSetNestKey( sNestKey)
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||
EgtSetNestKey(sNestKey)
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace( sNestKey)
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2304, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2304, 1, m_nKeyOptions)
|
||||
@@ -383,9 +385,9 @@ Class MainWindow
|
||||
Me.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
||||
Me.Top = nTop
|
||||
Me.Left = nLeft
|
||||
Me.Height = If( nHeight = 0, 768, nHeight)
|
||||
Me.Width = If( nWidth = 0, 1366, nWidth)
|
||||
WindowState = If( nFlag = 1, WindowState.Maximized, WindowState.Normal)
|
||||
Me.Height = If(nHeight = 0, 768, nHeight)
|
||||
Me.Width = If(nWidth = 0, 1366, nWidth)
|
||||
WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
|
||||
m_dMWinScale = Math.Min(Me.Width / 1280, Me.Height / 832)
|
||||
' Info su opzioni chiave
|
||||
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString())
|
||||
@@ -430,6 +432,7 @@ Class MainWindow
|
||||
End If
|
||||
End If
|
||||
|
||||
' abilito il bottone per la gestione del comando di Check-Up-Start (posziona lama prelavorazione)
|
||||
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 Then
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
||||
Else
|
||||
@@ -555,8 +558,12 @@ Class MainWindow
|
||||
' Lancio timer per aggiornamento interfaccia
|
||||
m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
|
||||
m_IdleTimer.Start()
|
||||
|
||||
' inizilizzo
|
||||
End Sub
|
||||
|
||||
#Region "Selezione dei bottoni IN LAVORO, TAGLII DIRETTI, TAGLI CAD, CORNICI, MACCHINA, OPZIONI"
|
||||
|
||||
Private Sub WorkInProgressBtn_Click(sender As Object, e As RoutedEventArgs) Handles WorkInProgressBtn.Click
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
' disbilito Test
|
||||
@@ -874,6 +881,8 @@ Class MainWindow
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Selezione dei bottoni IN LAVORO, TAGLII DIRETTI, TAGLI CAD, CORNICI, MACCHINA, OPZIONI
|
||||
|
||||
Private Sub MainWindow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles Me.PreviewMouseDown
|
||||
' Se sto fotografando, impedisco tutte le operazioni
|
||||
If m_Camera.m_bBusy And Not m_CurrentProjectPageUC.m_SceneButtons.IsMouseOver Then
|
||||
@@ -977,6 +986,8 @@ Class MainWindow
|
||||
MainWindowExit()
|
||||
End Sub
|
||||
|
||||
#Region "Uscita dalle pagine RAW, CSV, SPLIT, SIMULATION, TAGLI DIRETTI, MACCHINA, MAINWINDOW"
|
||||
|
||||
Private Function ExitFromRaw() As Boolean
|
||||
' Se non sono in definizione grezzo tutto ok
|
||||
If m_ActivePage <> Pages.RawPart Then Return True
|
||||
@@ -1071,6 +1082,8 @@ Class MainWindow
|
||||
m_objMutex.Close()
|
||||
End Sub
|
||||
|
||||
#End Region ' Uscita dalle pagine RAW, CSV, SPLIT, SIMULATION, TAGLI DIRETTI, MACCHINA, MAINWINDOW
|
||||
|
||||
Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
||||
' Verifico presenza del collegamento al CN
|
||||
m_bNCLink = (GetPrivateProfileInt(S_GENERAL, K_CNLINK, 0, m_sIniFile) <> 0) And
|
||||
@@ -1081,6 +1094,11 @@ Class MainWindow
|
||||
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
||||
m_ProdLineTimer.Start()
|
||||
End If
|
||||
|
||||
' seleziono il tipo di avvio
|
||||
m_CurrentProjectPageUC.StartProgram()
|
||||
' aggiorno la grafica
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Friend Sub EgtWPFInit()
|
||||
@@ -1844,6 +1862,7 @@ Class MainWindow
|
||||
If Not IsNothing(ProjectMgrUC.m_VeinMatchingWnd) Then ProjectMgrUC.m_VeinMatchingWnd.IsEnabled = IsEnabled
|
||||
End Sub
|
||||
|
||||
' spegne gli oggetti selezionati in fase di Check-Up-Start (bottone Test)
|
||||
Public Sub TestOff()
|
||||
' deseleziono gli oggetti e spengo il bottone
|
||||
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
||||
|
||||
@@ -190,6 +190,9 @@
|
||||
<DependentUpon>CadCutPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CAM\CamAuto.vb" />
|
||||
<Compile Include="Project\StartLauncheWDr.xaml.vb">
|
||||
<DependentUpon>StartLauncheWDr.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
||||
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -411,6 +414,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Project\StartLauncheWDr.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="RawPhoto\SlabIdWD.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports System.Windows.Interop
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class CurrentProjectPageUC
|
||||
' Dichiarazione eventi
|
||||
@@ -31,6 +32,8 @@ Public Class CurrentProjectPageUC
|
||||
FLATS = 1
|
||||
FRAMES = 2
|
||||
End Enum
|
||||
' elenco dei file di recente apertura
|
||||
Friend m_MruFiles As New MruList
|
||||
|
||||
Private Sub CurrentProjectPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -64,6 +67,8 @@ Public Class CurrentProjectPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub CurrentProjectPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
' Impostazioni MruLists: carico la lista degli ultimi file caricati/aperti
|
||||
m_MruFiles.Init(S_MRUFILES, 8)
|
||||
If m_bFirst Then
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
@@ -167,20 +172,30 @@ Public Class CurrentProjectPageUC
|
||||
' Inizializzo gestore lavorazioni
|
||||
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
|
||||
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
Dim sPath As String = m_MainWindow.GetSaveDir() & "\" & m_nCurrProj.ToString("D4") & ".nge"
|
||||
If Not LoadProject(sPath, False) Then
|
||||
NewProject()
|
||||
End If
|
||||
EgtResetModified()
|
||||
' Altrimenti ne imposto uno nuovo
|
||||
Else
|
||||
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
NewProject()
|
||||
End If
|
||||
'If bAutoLoadLast Then
|
||||
' m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
' Dim sPath As String = m_MainWindow.GetSaveDir() & "\" & m_nCurrProj.ToString("D4") & ".nge"
|
||||
' If Not LoadProject(sPath, False) Then
|
||||
' NewProject()
|
||||
' End If
|
||||
' EgtResetModified()
|
||||
' Altrimenti ne imposto uno nuovo
|
||||
'Else
|
||||
' m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
' NewProject()
|
||||
'End If
|
||||
|
||||
' creo nuovo progetto
|
||||
NewProject()
|
||||
|
||||
' Nascondo progress per fotografia
|
||||
PhotoProgress.Visibility = Windows.Visibility.Hidden
|
||||
' Carico sottopagina opportuna
|
||||
@@ -193,9 +208,11 @@ Public Class CurrentProjectPageUC
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
|
||||
m_MainWindow.FrameCutBtn.IsChecked = True
|
||||
End If
|
||||
|
||||
Else
|
||||
EgtSetCurrentContext(CurrentProjectScene.GetCtx())
|
||||
End If
|
||||
|
||||
' inibisco selezione diretta da Scene
|
||||
CurrentProjectScene.SetStatusNull()
|
||||
' Imposto dati progetto
|
||||
@@ -207,7 +224,60 @@ Public Class CurrentProjectPageUC
|
||||
' Visualizzo lama e lavorazione correnti
|
||||
ToolTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
End Sub
|
||||
|
||||
Public Sub StartProgram()
|
||||
Dim MyStartLancherWD As New StartLauncherWD(m_MainWindow)
|
||||
MyStartLancherWD.ShowDialog()
|
||||
|
||||
' 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
|
||||
|
||||
' 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
|
||||
If Not LoadProject(sPath, False) Then
|
||||
' altrimenti apro un nuovo progetto
|
||||
NewProject()
|
||||
Else
|
||||
' salvo il nome del file caricato
|
||||
m_MruFiles.Add(sPath)
|
||||
End If
|
||||
EgtResetModified()
|
||||
|
||||
' apro il file selezionato all'avvio
|
||||
ElseIf MyStartLancherWD.CurrSelection = 3 Then
|
||||
If Not LoadProject(MyStartLancherWD.SelPath, False) Then
|
||||
' altrimenti apro un nuovo progetto
|
||||
NewProject()
|
||||
Else
|
||||
' salvo il nome del file caricato
|
||||
m_MruFiles.Add(MyStartLancherWD.SelPath)
|
||||
End If
|
||||
EgtResetModified()
|
||||
|
||||
' se nuovo progetto o naviga direttorio
|
||||
ElseIf MyStartLancherWD.CurrSelection = 1 Or MyStartLancherWD.CurrSelection = 0 Then
|
||||
bAutoLoadLast = False
|
||||
NewProject()
|
||||
End If
|
||||
|
||||
'' Nascondo progress per fotografia
|
||||
'PhotoProgress.Visibility = Windows.Visibility.Hidden
|
||||
'' Carico sottopagina opportuna
|
||||
'If GetProjectType() <> PRJ_TYPE.FRAMES Then
|
||||
' CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||
' m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
' m_MainWindow.CadCutBtn.IsChecked = True
|
||||
'Else
|
||||
' CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
|
||||
' m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
|
||||
' m_MainWindow.FrameCutBtn.IsChecked = True
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseDownScene
|
||||
@@ -247,6 +317,7 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' apri nuovo progetto
|
||||
Friend Function NewProject(Optional nTabInd As Integer = 1,
|
||||
Optional bRetainParkedParts As Boolean = False) As Boolean
|
||||
' Salvo l'area totale dei pezzi
|
||||
@@ -369,6 +440,7 @@ Public Class CurrentProjectPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' carica ultimo progetto
|
||||
Friend Function LoadProject(ByVal sPath As String, Optional ByVal bUpdateIndex As Boolean = True) As Boolean
|
||||
' Se richiesto, imposto nuovo indice di progetto
|
||||
If bUpdateIndex Then
|
||||
@@ -464,6 +536,7 @@ Public Class CurrentProjectPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' salva progetto
|
||||
Friend Function SaveProject() As Boolean
|
||||
' Determino nome del progetto
|
||||
m_nCurrProj = Math.Abs(m_nCurrProj)
|
||||
|
||||
@@ -36,6 +36,7 @@ Public Class ProjectMgrUC
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_CurrMachine = m_MainWindow.m_CurrentMachine
|
||||
m_CurrNcComm = m_MainWindow.m_CNCommunication
|
||||
|
||||
' Se richiesto carico finestra per VeinMatching e ultimo intarsio
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) And
|
||||
GetPrivateProfileInt(S_VEINMATCHING, K_VEINMA_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||
@@ -155,6 +156,7 @@ Public Class ProjectMgrUC
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
If Not m_CurrProjPage.LoadProject(sCurrDir & "\" & sCurrFile) Then
|
||||
m_CurrProjPage.NewProject()
|
||||
m_CurrProjPage.m_MruFiles.Remove(sCurrDir & "\" & sCurrFile)
|
||||
Else
|
||||
' Verifico se file salvato con nome guardando il nome della cartella in cui si trova
|
||||
Dim sSaveNameDir As String = String.Empty
|
||||
@@ -171,6 +173,7 @@ Public Class ProjectMgrUC
|
||||
If sCurrDir <> m_MainWindow.GetSaveDir() And sCurrDir <> sSaveNameDir Then
|
||||
m_CurrProjPage.SetLoadPath(sCurrDir & "\" & sCurrFile)
|
||||
End If
|
||||
m_CurrProjPage.m_MruFiles.Add(sCurrDir & "\" & sCurrFile)
|
||||
End If
|
||||
' Verifico se andare nel CadCut o nel FrameCut
|
||||
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<Window x:Class="StartLauncherWD"
|
||||
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="300" 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.2*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Messaggio di tipo di avvio-->
|
||||
<TextBlock Name="SlectLauncherTxbl" 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="1*"/>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
</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}"
|
||||
ToolTip="LastProject">
|
||||
<Image Source="{DynamicResource CsvOpenImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--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>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
@@ -0,0 +1,77 @@
|
||||
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
|
||||
Reference in New Issue
Block a user