diff --git a/DrawImport/AlzFrontUC.xaml b/DrawImport/AlzFrontUC.xaml
new file mode 100644
index 0000000..8d6f67f
--- /dev/null
+++ b/DrawImport/AlzFrontUC.xaml
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DrawImport/AlzFrontUC.xaml.vb b/DrawImport/AlzFrontUC.xaml.vb
new file mode 100644
index 0000000..c75e05e
--- /dev/null
+++ b/DrawImport/AlzFrontUC.xaml.vb
@@ -0,0 +1,485 @@
+Imports EgtUILib
+
+Public Class AlzFrontUC
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
+ ' Riferimento alla pagina che ha aperto SideAngleUC
+ Private m_CallingPage As MainWindow.Pages
+
+ ' Gestione pagine
+ Private Const MAX_LINES As Integer = 10
+ ' lista dei lati, in cui indico il tipo di entità da associare
+ Private AlzFrontEntityList As New List(Of AlzFrontEntity)
+
+ ' numero di lati presenti nella figura
+ Private m_nCount As Integer = 0
+ ' numero di righe rese disponibili nella pagina -> m_nShow = min(m_nCount, MAX_LINE)
+ Private m_nShow As Integer = MAX_LINES
+
+ ' layer per inserire le descrizione dei lati
+ Private m_AlzLayer As Integer
+ Private m_Frontlayer As Integer
+ Private m_dBBoxRad As Double
+
+ Private Sub AlzFrontPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+
+ m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.AlzFront
+
+ ' numero di elemnti presenti nella lista SideAngle/DripEntity
+ m_nCount = 0
+ ' numero di righe rese disponibili nella pagina -> m_nShow = min(m_nCount, MAX_LINE)
+ m_nShow = 0
+
+ ' carico la lista dei lati della figura
+ InitSides()
+ ' aggiorno la visualizzazione delle TextBox e dei CheckBox
+ TxBlChBxView()
+
+ ' nascondo il bottone Back della pagina Draw
+ m_MainWindow.m_DrawPageUC.BackBtn.Visibility = Visibility.Hidden
+ m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
+ ' Abilito bottoni angoli di fianco e lavorazioni da sotto
+ m_MainWindow.m_DrawPageUC.SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
+ m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
+ m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = True
+ m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
+ Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
+
+ ' nome dei parametri condivisi
+ Parameter1TxBl.Text = "Altezza"
+ Parameter2TxBl.Text = "Delta angolo"
+
+ EgtZoom(ZM.ALL)
+ End Sub
+
+ ' carico la lista dei lati della figura corrente
+ Private Sub InitSides()
+ ' pulisco la lista dei lati
+ AlzFrontEntityList.Clear()
+ Dim PartId As Integer = GDB_ID.NULL
+ ' Id del loop eseterno
+ Dim LoopId As Integer = GDB_ID.NULL
+
+ ' Imposto contesto corrente
+ EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
+ ' Ricavo nome primo pezzo
+ PartId = EgtGetFirstPart()
+ ' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
+ LoopId = EgtGetFirstNameInGroup(EgtGetFirstPart(), NAME_OUTLOOP)
+
+ 'Determino se loop esterno o interno
+ Dim sLoopName As String = ""
+ Dim bOutLoop As Boolean = (EgtGetName(LoopId, sLoopName) AndAlso sLoopName = NAME_OUTLOOP)
+ ' Calcolo dimensione ingombro Loop
+ Dim ptMin, ptMax As Point3d
+ EgtGetBBoxGlob(LoopId, GDB_BB.STANDARD, ptMin, ptMax)
+ ' utilizzato per definire la dimensione dei caratteri delle label per i lati
+ m_dBBoxRad = 0.5 * Point3d.DistXY(ptMin, ptMax)
+
+ ' Creo layer per testi ALZATINE
+ m_AlzLayer = EgtGetFirstNameInGroup(PartId, "Alzatina")
+ If m_AlzLayer = GDB_ID.NULL And PartId <> GDB_ID.NULL Then
+ m_AlzLayer = EgtCreateGroup(PartId)
+ EgtSetName(m_AlzLayer, "Alzatina")
+ EgtSetColor(m_AlzLayer, New Color3d(0, 0, 0))
+ End If
+
+ ' Creo layer per testi FRONTALINI
+ m_Frontlayer = EgtGetFirstNameInGroup(PartId, "Frontalino")
+ If m_Frontlayer = GDB_ID.NULL And PartId <> GDB_ID.NULL Then
+ m_Frontlayer = EgtCreateGroup(PartId)
+ EgtSetName(m_Frontlayer, "Frontalino")
+ EgtSetColor(m_Frontlayer, New Color3d(0, 100, 0))
+ End If
+
+ ' Recupero Id della curva del Loop Esterno
+ Dim PrevLine As Integer = EgtGetLastInGroup(LoopId)
+ Dim CurrLine As Integer = EgtGetFirstInGroup(LoopId)
+ ' Creo indice per numerare le entità in ImportPage
+ Dim nEntityIndex As Integer = 1
+ Dim nOtherIndex As Integer = 1
+
+ ' Ciclo che verifica se possibile inclinare la curva corrente o inserire un gocciolatoio
+ While CurrLine <> GDB_ID.NULL
+ Dim NextLine As Integer = EgtGetNext(CurrLine)
+ If NextLine = GDB_ID.NULL Then NextLine = EgtGetFirstInGroup(LoopId)
+
+ If EgtGetType(CurrLine) = GDB_TY.CRV_LINE Then
+ ' Aggiungo il lato alla lista di quelli su cui è possibile mettere il gocciolatoio
+ Dim sNameCurrLine As String = String.Empty
+ EgtGetName(CurrLine, sNameCurrLine)
+ AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
+ nEntityIndex += 1
+ End If
+
+ PrevLine = CurrLine
+ CurrLine = EgtGetNext(CurrLine)
+ End While
+
+ ' Aggiorno numero di lati carciati
+ m_nCount = AlzFrontEntityList.Count()
+ ' Aggiorno numero item visualizzati nella pagina iniziale
+ m_nShow = Math.Min(m_nCount, MAX_LINES)
+
+ ' Se non ci sono lati su cui operare, messaggio utente
+ If LoopId <> GDB_ID.NULL Then
+ If m_nCount = 0 Then
+ If m_CallingPage = MainWindow.Pages.Draw Then
+ m_MainWindow.m_DrawPageUC.MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 7) ' Non ci sono lati modificabili
+ m_MainWindow.m_DrawPageUC.MessageBrd.Background = Application.Current.FindResource("OmagCut_Yellow")
+ Else
+ m_MainWindow.m_ImportPageUC.MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 7) ' Non ci sono lati modificabili
+ m_MainWindow.m_ImportPageUC.MessageBrd.Background = Application.Current.FindResource("OmagCut_Yellow")
+ End If
+ Else
+ If m_CallingPage = MainWindow.Pages.Draw Then
+ m_MainWindow.m_DrawPageUC.MessageTxBx.Text = ""
+ m_MainWindow.m_DrawPageUC.MessageBrd.Background = Brushes.Transparent
+ Else
+ m_MainWindow.m_ImportPageUC.MessageTxBx.Text = ""
+ m_MainWindow.m_ImportPageUC.MessageBrd.Background = Brushes.Transparent
+ End If
+ End If
+ End If
+
+ End Sub
+
+ ' Imposto la visibilità degli oggetti nella pagina: qui eseguo l'impaginazione
+ Private Sub TxBlChBxView()
+
+ If m_nCount = 0 Then
+ ' nascondo il nome delle colonne
+ SideAngleBl.Visibility = Windows.Visibility.Hidden
+ HeelBl.Visibility = Windows.Visibility.Hidden
+ Else
+ ' definisco il posizionamento del nome (Alz.) delle colonne all'interno della grigia
+ Grid.SetRow(SideAngleBl, MAX_LINES - m_nShow)
+ SideAngleBl.Text = "Alz."
+ SideAngleBl.Visibility = Windows.Visibility.Visible
+ ' definisco il posizionamento del nome (Front.) delle colonne all'interno della grigia
+ Grid.SetRow(HeelBl, MAX_LINES - m_nShow)
+ HeelBl.Text = "Front."
+ HeelBl.Visibility = Windows.Visibility.Visible
+ End If
+
+ ' Lati visibili
+ For nI As Integer = 1 To m_nShow
+ Dim Index As Integer = MAX_LINES - m_nShow + nI
+ ' definisco la visibilità della label
+ GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Visible
+ ' definisco il nome della label (se volessi associare direttamente il nome della linea dovrei riordinare la lista!)
+ GetTxBlFromIndex(Index).Text = "A" & nI.ToString
+
+ GetChBxFromIndex(Index).Visibility = Windows.Visibility.Visible
+ ' aggiungo i campi per allungare e accorciare i lati
+ GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
+ GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
+ Next
+
+ ' Lati nascosti: nascondo i lati partendo dall'alto (se ho 4 lati la prima TextBx disponibile è la settima -> 11-4 = 7 lati nascosti)
+ For Index As Integer = 1 To MAX_LINES - m_nShow
+ GetChBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
+ GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
+ GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
+ GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Hidden
+
+ Next
+ End Sub
+
+ ' Permette di aggiugere accanto alla linea passata
+ Friend Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double,
+ dBBoxRad As Double, bTextExt As Boolean, Optional bRot As Boolean = False) As Integer
+ ' Calcolo altezza testo
+ Dim dH As Double = 0.05 * dBBoxRad
+ ' Creo testo
+ Dim nText As Integer = EgtCreateTextAdv(TextLayer, Point3d.ORIG(), 0, sText, "", 500, False, dH, 1, 0, INS_POS.MC)
+ ' Calcolo posizionamento
+ ' BBox del testo e suo centro
+ Dim ptMinBBox As Point3d
+ Dim ptMaxBBox As Point3d
+ EgtGetBBox(nText, GDB_BB.STANDARD, ptMinBBox, ptMaxBBox)
+ Dim ptMidBBox As Point3d
+ ptMidBBox = Point3d.Media(ptMinBBox, ptMaxBBox)
+ ' Punto medio della curva
+ Dim ptMid As Point3d
+ EgtMidPoint(CurrLine, nText, ptMid)
+ ' Versore sul punto medio della curva
+ Dim vtMid As Vector3d
+ EgtMidVector(CurrLine, nText, vtMid)
+ ' versore perpendicolare alla CurrLine che punta verso il testo
+ Dim vtOrto As New Vector3d(vtMid)
+ If bTextExt Then
+ vtOrto.Rotate(Vector3d.Z_AX(), -90)
+ Else
+ vtOrto.Rotate(Vector3d.Z_AX(), 90)
+ End If
+ ' eventuale rotazione del testo
+ Dim dRotAng As Double = 0
+ If bRot Then
+ dRotAng = Math.Atan2(vtMid.y, vtMid.x) * 180 / Math.PI
+ Dim dSpecRotAng = dRotAng
+ If dSpecRotAng > 91 Then
+ dSpecRotAng -= 180
+ ElseIf dSpecRotAng < -89 Then
+ dSpecRotAng += 180
+ End If
+ EgtRotate(nText, Point3d.ORIG(), Vector3d.Z_AX(), dSpecRotAng)
+ End If
+ ' vettore dal centro del BBox all'estremo più vicino
+ Dim vtptExtptMC As Vector3d
+ If bRot Then
+ vtptExtptMC = New Vector3d(0, ptMidBBox.y - ptMinBBox.y, 0)
+ vtptExtptMC.Rotate(Vector3d.Z_AX(), dRotAng)
+ Else
+ If bTextExt Then
+ If vtMid.x > 0 Then
+ If vtMid.y > 0 Then
+ vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
+ Else
+ vtptExtptMC = ptMidBBox - ptMaxBBox
+ End If
+ Else
+ If vtMid.y > 0 Then
+ vtptExtptMC = ptMidBBox - ptMinBBox
+ Else
+ vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
+ End If
+ End If
+ Else
+ If vtMid.x > 0 Then
+ If vtMid.y > 0 Then
+ vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
+ Else
+ vtptExtptMC = ptMidBBox - ptMinBBox
+ End If
+ Else
+ If vtMid.y > 0 Then
+ vtptExtptMC = ptMidBBox - ptMaxBBox
+ Else
+ vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
+ End If
+ End If
+ End If
+ End If
+ ' Calcolo il centro del testo
+ Dim ptTextMC As Point3d = ptMid + vtOrto * (dDistance + (vtOrto * vtptExtptMC))
+ EgtMove(nText, (ptTextMC - Point3d.ORIG()))
+ Return nText
+ End Function
+
+#Region "CHIAMATA ALLE TEXT/CHECK/LABEL"
+ Private Function GetChBxFromIndex(Index As Integer) As CheckBox
+ Select Case Index
+ Case 1
+ Return A1
+ Case 2
+ Return A2
+ Case 3
+ Return A3
+ Case 4
+ Return A4
+ Case 5
+ Return A5
+ Case 6
+ Return A6
+ Case 7
+ Return A7
+ Case 8
+ Return A8
+ Case 9
+ Return A9
+ Case Else
+ Return A10
+ End Select
+ End Function
+
+ Private Function GetAngleTxBxFromIndex(Index As Integer) As EgtWPFLib.EgtTextBox
+ Select Case Index
+ Case 1
+ Return A1TxBx
+ Case 2
+ Return A2TxBx
+ Case 3
+ Return A3TxBx
+ Case 4
+ Return A4TxBx
+ Case 5
+ Return A5TxBx
+ Case 6
+ Return A6TxBx
+ Case 7
+ Return A7TxBx
+ Case 8
+ Return A8TxBx
+ Case 9
+ Return A9TxBx
+ Case Else
+ Return A10TxBx
+ End Select
+ End Function
+
+ Private Function GetHeelTxBxFromIndex(Index As Integer) As EgtWPFLib.EgtTextBox
+ Select Case Index
+ Case 1
+ Return H1TxBx
+ Case 2
+ Return H2TxBx
+ Case 3
+ Return H3TxBx
+ Case 4
+ Return H4TxBx
+ Case 5
+ Return H5TxBx
+ Case 6
+ Return H6TxBx
+ Case 7
+ Return H7TxBx
+ Case 8
+ Return H8TxBx
+ Case 9
+ Return H9TxBx
+ Case Else
+ Return H10TxBx
+ End Select
+ End Function
+
+ Private Function GetTxBlFromIndex(Index As Integer) As TextBlock
+ Select Case Index
+ Case 1
+ Return Entity1
+ Case 2
+ Return Entity2
+ Case 3
+ Return Entity3
+ Case 4
+ Return Entity4
+ Case 5
+ Return Entity5
+ Case 6
+ Return Entity6
+ Case 7
+ Return Entity7
+ Case 8
+ Return Entity8
+ Case 9
+ Return Entity9
+ Case Else
+ Return Entity10
+ End Select
+ End Function
+
+#End Region ' Chiamata elle Text/Check/Label
+
+ ' Per gestire la selezione delle Alzatine (devo ancora definire la CheckBox: An)
+ Private Sub A_Checked(sender As Object, e As RoutedEventArgs) Handles A1.Checked, A2.Checked, A3.Checked, A4.Checked
+ ' recupero il nome della Check selezionata
+ Dim sChName As String = DirectCast(sender, CheckBox).Name
+ Dim sItems As String() = Split(sChName, "A")
+ Dim nIndex As Integer
+ If sItems.Count > 1 Then
+ nIndex = CInt(sItems(1))
+ End If
+ Dim j As Integer = nIndex - (MAX_LINES - m_nShow)
+ AddTextToLine(AlzFrontEntityList(j).SideName, m_AlzLayer, AlzFrontEntityList(j).Id, 20, m_dBBoxRad, True)
+
+ 'For j = 0 To AlzFrontEntityList.Count() - 1
+ ' If AlzFrontEntityList(j).SideName = sChName Then
+ ' If sChName = "A1" Or sChName = "A3" Or sChName = "A5" Or sChName = "A7" Then
+ ' AddTextToLine(AlzFrontEntityList(j).SideName, m_AlzLayer, AlzFrontEntityList(j).Id, 20, m_dBBoxRad, True)
+ ' Else
+ ' AddTextToLine(AlzFrontEntityList(j).SideName, m_Frontlayer, AlzFrontEntityList(j).Id, 20, m_dBBoxRad, True)
+ ' End If
+ ' Exit For
+ ' End If
+ 'Next
+
+ EgtDraw()
+ End Sub
+
+ ' Per gestire la selezione dei Frontalini (devo ancora definire la CheckBox: Fn)
+ 'Private Sub F_Checked(sender As Object, e As RoutedEventArgs) Handles A1.Checked, A2.Checked, A3.Checked, A4.Checked, A5.Checked, A6.Checked, A7.Checked, A8.Checked
+ ' ' recupero il nome della Check selezionata
+ ' Dim sChName As String = DirectCast(sender, CheckBox).Name
+
+ ' For j = 0 To AlzFrontEntityList.Count() - 1
+ ' If AlzFrontEntityList(j).SideName = sChName Then
+ ' If sChName = "A1" Or sChName = "A3" Or sChName = "A5" Or sChName = "A7" Then
+ ' AddTextToLine(AlzFrontEntityList(j).SideName, m_AlzLayer, AlzFrontEntityList(j).Id, 20, m_dBBoxRad, True)
+ ' Else
+ ' AddTextToLine(AlzFrontEntityList(j).SideName, m_Frontlayer, AlzFrontEntityList(j).Id, 20, m_dBBoxRad, True)
+ ' End If
+ ' Exit For
+ ' End If
+ ' Next
+
+ ' EgtDraw()
+ 'End Sub
+
+ ' metodo utilizzato per tornare indietro alla pagina di selezione "CompoInterni/Alz&Front"
+ Private Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
+ m_MainWindow.m_DrawPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
+
+ ' torno alla pagina iniziale di selezione del piano (Compo)
+ 'm_MainWindow.m_DrawPageUC.BackBtn_Click(sender, e)
+
+ '--------- NUOVA GESTIONE ---------
+ ' rimuovo l'elenco di bottoni per selezionare il tipo di componente interna
+ m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
+ ' inserisco nella Grid VaribalsesGrid lo UeserControl per definire le dimensioni della componente
+ m_MainWindow.m_DrawPageUC.VariablesGrd.Children.Add(m_MainWindow.m_DrawPageUC.m_CompoDimension)
+ ' nascondo la lista dei parametri
+ m_MainWindow.m_DrawPageUC.m_CompoDimension.CollapsedAllParam()
+ ' sto uscendo dalla componente interna (quindi comunico il cambio di componente)
+ m_MainWindow.m_DrawPageUC.m_bInternalCompo = False
+ ' comunico che sto arrivando da una componente interna
+ m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = True
+
+ 'm_MainWindow.m_DrawPageUC.SelectedComponent(m_MainWindow.m_DrawPageUC.m_sMainCompo)
+ 'm_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.CompoDimension
+ End Sub
+
+End Class
+
+Public Class AlzFrontEntity
+ Public Enum AlzFront
+ ALZATINA
+ FRONTALINO
+ End Enum
+
+ Private m_SideName As String
+ Private m_Type As AlzFront
+ Private m_Id As Integer
+
+ Public Property SideName As String
+ Get
+ Return m_SideName
+ End Get
+ Set(value As String)
+ m_SideName = value
+ End Set
+ End Property
+
+ Public Property Type As AlzFront
+ Get
+ Return m_Type
+ End Get
+ Set(value As AlzFront)
+ m_Type = value
+ End Set
+ End Property
+
+ Public Property Id As Integer
+ Get
+ Return m_Id
+ End Get
+ Set(value As Integer)
+ m_Id = value
+ End Set
+ End Property
+
+ Sub New(Name As String, CurrId As Integer)
+ m_SideName = Name
+ m_Id = CurrId
+ End Sub
+
+End Class
\ No newline at end of file
diff --git a/DrawImport/CompoDimensionUC.xaml b/DrawImport/CompoDimensionUC.xaml
index dcb6a28..02ee754 100644
--- a/DrawImport/CompoDimensionUC.xaml
+++ b/DrawImport/CompoDimensionUC.xaml
@@ -26,7 +26,7 @@
-
+
@@ -69,12 +69,18 @@
-
+
+
+
-
-
+
+
-
+
+
+
+
diff --git a/DrawImport/CompoDimensionUC.xaml.vb b/DrawImport/CompoDimensionUC.xaml.vb
index 98d29a1..c0756e1 100644
--- a/DrawImport/CompoDimensionUC.xaml.vb
+++ b/DrawImport/CompoDimensionUC.xaml.vb
@@ -13,15 +13,25 @@ Public Class CompoDimensionUC
' Riferimento alla pagina di selezione dei componenti interni
Friend m_InternalCompoPage As InternalComponentPageUC
+ ' Riferimento alla pagina di selezione della alzatine
+ Friend m_AlzFrontPage As AlzFrontUC
Private Sub CompoDimensionUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
- 'Creazione delle Page UserControl
+ 'Creazione delle Page UserControl (per le componenti interne)
m_InternalCompoPage = New InternalComponentPageUC
- 'Posizionemento nella griglia delle Page UserControl
+ 'Posizionemento nella griglia delle Page UserControl
m_InternalCompoPage.SetValue(Grid.ColumnSpanProperty, 2)
m_InternalCompoPage.SetValue(Grid.RowSpanProperty, 4)
+ 'Creazione della Page UserControl (per le alzatine e i frontalini)
+ m_AlzFrontPage = New AlzFrontUC
+ 'Posizionamento nella griglia della Page UserControl
+ m_AlzFrontPage.SetValue(Grid.ColumnSpanProperty, 2)
+ m_AlzFrontPage.SetValue(Grid.RowSpanProperty, 4)
+
+ ' definisco il nome dei comandi presenti nella pagine
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
+ AlzFrontBtn.Content = "Alzatine & Frontalini"
AddBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 48) ' Aggiungi
CancelBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 49) ' Rimuovi
End Sub
@@ -36,11 +46,13 @@ Public Class CompoDimensionUC
' se arrivo dalla pagina delle componenti interne allora esco (non devo ricalcolare i parametri)
If m_DrawPage.m_bBackFromInternalCompo Then
ShowInternalBtn(True)
+ ShowAlzFrontBtn(True)
' Se componente interno visualizzo bottoni aggiungi rimuovi
ShowAddRemoveBtn(m_DrawPage.m_bInternalCompo)
' Imposto contesto corrente e faccio uno ZoomAll della scena con il componente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
EgtZoom(ZM.ALL)
+ ' termino il caricamento della pagina
Return
End If
@@ -52,8 +64,10 @@ Public Class CompoDimensionUC
If m_DrawPage.sCompoName.StartsWith("PCucina") Or
m_DrawPage.sCompoName.StartsWith("PBagno") Then
ShowInternalBtn(True)
+ ShowAlzFrontBtn(True)
Else
ShowInternalBtn(False)
+ ShowAlzFrontBtn(False)
End If
' Se componente interno visualizzo bottoni aggiungi rimuovi
@@ -78,6 +92,15 @@ Public Class CompoDimensionUC
End If
End Sub
+ ' rende visibile il bottone per inserire le azatine e i frontalini: solo nella pagina delle componenti
+ Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
+ If value Then
+ AlzFrontBtn.Visibility = Visibility.Visible
+ Else
+ AlzFrontBtn.Visibility = Visibility.Hidden
+ End If
+ End Sub
+
' definisce se rendere visbile oppure no i bottone "Aggiungi" e "Rimuovi": presenti solo nella componenti interne
Friend Sub ShowAddRemoveBtn(value As Boolean)
If value Then
@@ -272,6 +295,24 @@ Public Class CompoDimensionUC
m_DrawPage.LeftButtonGrd.Children.Add(m_InternalCompoPage)
End Sub
+ ' visualizzo la pagina per la selezione delle componenti interne
+ Private Sub AlzFrontBtn_Click(sender As Object, e As RoutedEventArgs) Handles AlzFrontBtn.Click
+ m_DrawPage.m_bBackFromInternalCompo = False
+ ' imposto contesto
+ EgtSetCurrentContext(m_DrawPage.DrawScene.GetCtx())
+ ' Nascondo layer etichette e quotature
+ Dim Pz As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
+ EgtSetStatus(EgtGetFirstNameInGroup(Pz, "LayAux"), GDB_ST.OFF)
+ EgtSetStatus(EgtGetFirstNameInGroup(Pz, "Etichette"), GDB_ST.OFF)
+ EgtSetStatus(EgtGetFirstNameInGroup(Pz, "Quotature"), GDB_ST.OFF)
+ EgtDraw()
+
+ m_DrawPage.VariablesGrd.Children.Remove(Me)
+ m_DrawPage.m_bInternalCompo = True
+ m_DrawPage.LeftButtonGrd.Children.Add(m_AlzFrontPage)
+ End Sub
+
+
' Bottone utilizzato per inserire le componenti interne
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
' Se componente errato, non faccio alcunché
diff --git a/DrawImport/DrawPageUC.xaml.vb b/DrawImport/DrawPageUC.xaml.vb
index 46041a6..b106823 100644
--- a/DrawImport/DrawPageUC.xaml.vb
+++ b/DrawImport/DrawPageUC.xaml.vb
@@ -30,7 +30,7 @@ Public Class DrawPageUC
Friend m_SideAngleUC As SideAngleUC
Friend m_FiloTopUC As FiloTopUC
- ' Variabile che indica se componenti interni o esterni
+ ' Variabile che indica se componenti interni o esterni (usato anche per definire le alzatine e i fronatlini)
Friend m_bInternalCompo As Boolean = False
Friend m_bBackFromInternalCompo As Boolean = False
@@ -114,6 +114,7 @@ Public Class DrawPageUC
CompoDimension
SideAngle
FiloTop
+ AlzFront
End Enum
Private Sub DrawPage_Initialized(sender As Object, e As EventArgs)
@@ -276,11 +277,14 @@ Public Class DrawPageUC
If e.Button <> Windows.Forms.MouseButtons.Left Or Not DrawScene.IsStatusNull() Then Return
' Si può selezionare solo se non si sta già editando un componente
If m_ActiveComponentPage = Pages.InternalComponent Then
- OnMouseDownSceneInternalComponent( e)
+ OnMouseDownSceneInternalComponent(e)
ElseIf m_ActiveComponentPage = Pages.SideAngle Then
- OnMouseDownSceneSideAngle( e)
+ OnMouseDownSceneSideAngle(e)
ElseIf m_ActiveComponentPage = Pages.FiloTop Then
- OnMouseDownSceneFiloTop( e)
+ OnMouseDownSceneFiloTop(e)
+ ElseIf m_ActiveComponentPage = Pages.AlzFront Then
+ ' da definire
+
End If
End Sub
@@ -908,6 +912,7 @@ Public Class DrawPageUC
' Chiudo compo secondari e interni nel caso siano aperti
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
+ LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
@@ -941,6 +946,9 @@ Public Class DrawPageUC
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
m_PrevSideAnglePage = Pages.InternalComponent
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
+ ElseIf m_ActiveComponentPage = Pages.AlzFront Then
+ m_PrevSideAnglePage = Pages.AlzFront
+ LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End If
VariablesGrd.Children.Add(m_SideAngleUC)
FiloTopBtn.IsEnabled = False
@@ -1002,6 +1010,9 @@ Public Class DrawPageUC
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
m_PrevSideAnglePage = Pages.InternalComponent
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
+ ElseIf m_ActiveComponentPage = Pages.AlzFront Then
+ m_PrevSideAnglePage = Pages.AlzFront
+ LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End If
VariablesGrd.Children.Add(m_SideAngleUC)
FiloTopBtn.IsEnabled = False
@@ -1060,6 +1071,9 @@ Public Class DrawPageUC
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
m_PrevSideAnglePage = Pages.InternalComponent
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
+ ElseIf m_ActiveComponentPage = Pages.AlzFront Then
+ m_PrevSideAnglePage = Pages.AlzFront
+ LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End If
VariablesGrd.Children.Add(m_SideAngleUC)
SideAngleBtn.IsEnabled = False
@@ -1113,10 +1127,13 @@ Public Class DrawPageUC
' Imposto modalità
If m_ActiveComponentPage = Pages.CompoDimension Then
m_PrevSideAnglePage = Pages.CompoDimension
- VariablesGrd.Children.Remove( m_CompoDimension)
+ VariablesGrd.Children.Remove(m_CompoDimension)
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
m_PrevSideAnglePage = Pages.InternalComponent
- LeftButtonGrd.Children.Remove( m_CompoDimension.m_InternalCompoPage)
+ LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
+ ElseIf m_ActiveComponentPage = Pages.AlzFront Then
+ m_PrevSideAnglePage = Pages.AlzFront
+ LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End If
VariablesGrd.Children.Add( m_FiloTopUC)
SideAngleBtn.IsEnabled = False
@@ -1174,7 +1191,7 @@ Public Class DrawPageUC
Case Pages.SideAngle
VariablesGrd.Children.Remove( m_SideAngleUC)
Case Pages.FiloTop
- VariablesGrd.Children.Remove( m_FiloTopUC)
+ VariablesGrd.Children.Remove(m_FiloTopUC)
End Select
' Pulisco l'ambiente lua
diff --git a/DrawImport/InternalComponentPageUC.xaml.vb b/DrawImport/InternalComponentPageUC.xaml.vb
index 45bec23..428ed4d 100644
--- a/DrawImport/InternalComponentPageUC.xaml.vb
+++ b/DrawImport/InternalComponentPageUC.xaml.vb
@@ -285,7 +285,8 @@ Public Class InternalComponentPageUC
' Verifico presenza immagine e la aggiungo
If sCompoImage.Length <> 0 Then
Try
- sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
+ Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
+ sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj
index 9f45cd7..beb7099 100644
--- a/OmagCUT.vbproj
+++ b/OmagCUT.vbproj
@@ -173,6 +173,9 @@
SingleCutAuto.xaml
+
+ AlzFrontUC.xaml
+ CompoCsvData.xaml
@@ -394,6 +397,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner