OmagCUT :

- Aggiunta nuova grafica combobox, listbox e scrollbar.
- Aggiunta gestione inclinazione pezzi sia a componenti che a importazione dxf.
This commit is contained in:
Emmanuele Sassi
2016-02-26 11:58:48 +00:00
parent b38aa3dce0
commit 4300a8f2e9
13 changed files with 797 additions and 206 deletions
-58
View File
@@ -33,18 +33,6 @@
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
<!--<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>-->
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
@@ -65,52 +53,6 @@
<Grid Name="VariablesGrd" Grid.Row="1" Grid.ColumnSpan="2"/>
<!--<TextBlock Name="Label1" Grid.Row="1"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox1" Grid.Column="1" Grid.Row="1" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label2" Grid.Row="2"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox2" Grid.Column="1" Grid.Row="2" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label3" Grid.Row="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox3" Grid.Column="1" Grid.Row="3" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label4" Grid.Row="4"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox4" Grid.Column="1" Grid.Row="4" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label5" Grid.Row="5"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox5" Grid.Column="1" Grid.Row="5" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label6" Grid.Row="6"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox6" Grid.Column="1" Grid.Row="6" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label7" Grid.Row="7"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox7" Grid.Column="1" Grid.Row="7" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label8" Grid.Row="8"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox8" Grid.Column="1" Grid.Row="8" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label9" Grid.Row="9"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox9" Grid.Column="1" Grid.Row="9" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Label10" Grid.Row="10"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TextBox10" Grid.Column="1" Grid.Row="10" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<Button Name="InternComponentBtn" Grid.Row="11" Grid.ColumnSpan="2" FontSize="15" />
<Button Name="AddBtn" Grid.Row="12" FontSize="15" />
<Button Name="CancelBtn" Grid.Column="1" Grid.Row="12" FontSize="15" />-->
<Grid Name="MessageGrid" Grid.Row="2" Grid.ColumnSpan="2">
<TextBlock Name="MessageTxBl" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
</Grid>
+6 -22
View File
@@ -25,8 +25,8 @@ Public Class DrawPageUC
Private m_bDrawOk As Boolean = False
Private m_bFirst As Boolean = True
' Lista di tutte le entità inclinabili presenti nel progetto
Friend m_SideAngleEntityList As New List(Of SideAngleEntity)
'' Lista di tutte le entità inclinabili presenti nel progetto
'Friend m_SideAngleEntityList As New List(Of SideAngleEntity)
Friend ReadOnly Property CVars
Get
@@ -198,7 +198,7 @@ Public Class DrawPageUC
' Elimino nome del componente precedente
m_sCompoName = String.Empty
' Reset inclinazioni
DeleteSideAngle()
m_SideAngle.DeleteSideAngle()
If String.IsNullOrEmpty(m_MainComponentPage.m_SecondaryComponentPage.m_sCurrCompo) Then
DrawPage_Loaded(sender, e)
Else
@@ -359,7 +359,7 @@ Public Class DrawPageUC
' Ne recupero il layer OutLoop
Dim nOutLoopLayer As Integer = EgtGetFirstNameInGroup(nId2, "OutLoop")
' Modifico inclinazione lati
For Each Entity In m_SideAngleEntityList
For Each Entity In m_SideAngle.m_SideAngleEntityList
Dim nCurrEntityName As Integer = EgtGetFirstNameInGroup(nOutLoopLayer, Entity.sEntityName)
If Entity.dSideAngle <> 0 Then
' Scrivo nuovo angolo nelle info
@@ -400,7 +400,7 @@ Public Class DrawPageUC
' Elimino nome del componente precedente
m_sCompoName = String.Empty
' Reset inclinazioni
DeleteSideAngle()
m_SideAngle.DeleteSideAngle()
'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)
@@ -412,29 +412,13 @@ Public Class DrawPageUC
' Elimino nome del componente precedente
m_sCompoName = String.Empty
' Reset inclinazioni
DeleteSideAngle()
m_SideAngle.DeleteSideAngle()
'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)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
End Sub
Private Sub DeleteSideAngle()
' Cancello lista lati inclinati
m_SideAngleEntityList.Clear()
' Annullo tutti i CheckBox
m_SideAngle.A1.IsChecked = False
m_SideAngle.A2.IsChecked = False
m_SideAngle.A3.IsChecked = False
m_SideAngle.A4.IsChecked = False
m_SideAngle.A5.IsChecked = False
m_SideAngle.A6.IsChecked = False
m_SideAngle.A7.IsChecked = False
m_SideAngle.A8.IsChecked = False
m_SideAngle.A9.IsChecked = False
m_SideAngle.A10.IsChecked = False
End Sub
Private Sub DrawPage_Unloaded(sender As Object, e As RoutedEventArgs)
'Seleziono la Tab e la Page di apertura
Select Case m_ActiveComponentPage
+25 -10
View File
@@ -19,25 +19,40 @@
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="FilePathTxBl" Background="White" FontSize="15"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<!-- Definizione della Grid superiore per Button -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="SideAngleBtn" Grid.Column="0"
Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}"/>
</Grid>
<!-- Definizione della Grid laterale -->
<Grid Name="LeftGrid" Grid.RowSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="7*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="FilePathTxBl" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="3" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
</Grid>
<!-- Definizione della Grid inferiore per Button -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
+75 -20
View File
@@ -5,37 +5,58 @@ Imports System.Runtime.InteropServices
Public Class ImportPageUC
'Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
'Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
'Dichiarazione del UserControl SceneButtons
Friend m_SceneButtons As SceneButtonsUC
Friend m_SceneButtons As SceneButtonsUC
' Properties
Private m_sCurrDir As String = String.Empty
Private m_sCurrFile As String = String.Empty
Private m_nFileType As Integer = FT.NULL
Private m_bFirst As Boolean = True
Private m_bMM As Boolean = True
' Variabilee che contiene l'entità selezionata
Friend m_nSelectedPart As Integer = GDB_ID.NULL
' Evento che viene lanciato quando cambia il pezzo selezionato
Public Event SelectedPartChanged(ByVal nPartId As Integer)
' Proprietà che lancia l'evento quando cambia il valore della variabile
Private Property nSelectedPart As Integer
Get
Return m_nSelectedPart
End Get
Set(value As Integer)
m_nSelectedPart = value
RaiseEvent SelectedPartChanged(value)
End Set
End Property
'Variabile che contiene l'entità selezionata precedente
Friend m_PrevSelPart As Integer = GDB_ID.NULL
'Dichiarazione Scene
Friend WithEvents ImportScene As New Scene
Dim ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
' Dichiarazione SideAngleUc
Friend m_SideAngleUC As SideAngleUC
' Properties
Private m_sCurrDir As String = String.Empty
Private m_sCurrFile As String = String.Empty
Private m_nFileType As Integer = FT.NULL
Private m_bFirst As Boolean = True
Private m_bMM As Boolean = True
'Dichiarazione Scene
Friend WithEvents ImportScene As New Scene
Dim ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private Sub ImportPage_Initialized(sender As Object, e As EventArgs)
'Creazione del UserCOntrol SceneButtons
'Creazione degli UserControl
m_SceneButtons = New SceneButtonsUC
m_SideAngleUC = New SideAngleUC
'Posizionemento nella griglia del UserControl SceneButtons
m_SceneButtons.SetValue(Grid.ColumnProperty, 1)
'Posizionemento nella griglia degli UserControl
m_SceneButtons.SetValue(Grid.ColumnProperty, 2)
m_SideAngleUC.SetValue(Grid.RowProperty, 2)
UpperButtonGrid.Children.Add(m_SceneButtons)
'Assegnazione scena all'host e posizionamento nella ImportPageGrid
ImportSceneHost.Child = ImportScene
ImportSceneHost.SetValue(Grid.ColumnProperty, 1)
ImportSceneHost.SetValue(Grid.RowProperty, 2)
'ImportSceneHost.SetValue(Grid.RowSpanProperty, 2)
ImportSceneHost.SetValue(Grid.RowProperty, 1)
Me.ImportPageGrid.Children.Add(ImportSceneHost)
'Imposto i messaggi letti dal file dei messaggi
@@ -137,7 +158,7 @@ Public Class ImportPageUC
Return LoadDisks()
End If
Dim TempPath As New Text.StringBuilder(260)
PathCompactPathEx(TempPath, m_sCurrDir, 28, 0)
PathCompactPathEx(TempPath, m_sCurrDir, 22, 0)
' lo visualizzo
FilePathTxBl.Content = TempPath.ToString
' pulisco la lista
@@ -152,7 +173,7 @@ Public Class ImportPageUC
' per saltare i link, troppo complessi da gestire
If (DirI.Attributes And FileAttributes.Hidden) <> FileAttributes.Hidden Or
(DirI.Attributes And FileAttributes.System) <> FileAttributes.System Then
m_MainWindow.m_ImportItemList.Add(New IconListBoxItem(DirI.Name, 2))
m_MainWindow.m_ImportItemList.Add(New IconListBoxItem(DirI.Name, 2))
End If
Next
' elenco dei file
@@ -161,7 +182,7 @@ Public Class ImportPageUC
For Each FileI In vFileI
Dim sExt As String = Path.GetExtension(FileI.Name).ToUpper()
If sExt = ".DXF" Or sExt = ".NGE" Then
m_MainWindow.m_ImportItemList.Add(New IconListBoxItem(FileI.Name, 3))
m_MainWindow.m_ImportItemList.Add(New IconListBoxItem(FileI.Name, 3))
End If
Next
' pulisco la vista
@@ -293,7 +314,10 @@ Public Class ImportPageUC
If nStat = GDB_ST.SEL Then
EgtDeselectObj(nPartId)
Else
EgtDeselectAll()
EgtSelectObj(nPartId)
m_PrevSelPart = nSelectedPart
nSelectedPart = nPartId
End If
EgtDraw()
Exit While
@@ -302,6 +326,13 @@ Public Class ImportPageUC
End While
End Sub
Private Sub Me_SelectedPartChanged(nPartId As Integer) Handles Me.SelectedPartChanged
' Se sono in modalità inclinazioni calcolo lati inclinabili e creo testi
If SideAngleBtn.IsChecked Then
m_SideAngleUC.ReLoadSideAnglePage()
End If
End Sub
Private Sub UseLayerBtn_Click(sender As Object, e As RoutedEventArgs) Handles UseLayerBtn.Click
' Creo i pezzi
Dim nType As Integer = If(m_nFileType = FT.NGE, FPC_TYPE.NGE, FPC_TYPE.LAYER)
@@ -471,6 +502,30 @@ Public Class ImportPageUC
Private Sub ImportPage_Unloaded(sender As Object, e As RoutedEventArgs)
' Salvo direttorio corrente
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
' Tolgo pagina inclinazioni se attiva
If SideAngleBtn.IsChecked Then
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_SideAngleUC)
SideAngleBtn.IsChecked = False
End If
End Sub
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
If SideAngleBtn.IsChecked Then
LeftGrid.Children.Add(m_SideAngleUC)
FilePathTxBl.Visibility = Windows.Visibility.Hidden
FileListBox.Visibility = Windows.Visibility.Hidden
Else
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_SideAngleUC)
' Ricavo nome primo pezzo
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Ricavo nome pezzo precedentemente selezionato
Part1 = m_MainWindow.m_ImportPageUC.m_nSelectedPart
EgtErase(EgtGetFirstNameInGroup(Part1, "SideAngle"))
End If
End Sub
End Class
+524 -8
View File
@@ -62,8 +62,9 @@
<LinearGradientBrush x:Key="OmagCut_TreeViewGradientGray" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Color="LightGray"/>
<GradientStop Color="#B29E9E9E" Offset="0.7007"/>
<GradientStop Color="#CC565656" Offset="1"/>
<!--<GradientStop Color="#B29E9E9E" Offset="0.7007"/>
<GradientStop Color="#CC565656" Offset="1"/>-->
<GradientStop Color="#FF9E9E9E" Offset="1"/>
</LinearGradientBrush>
<!--Parametri predefiniti-->
@@ -279,6 +280,202 @@
<!--ComboBox-->
<!--ComboBoxBackground-->
<LinearGradientBrush x:Key="ComboBox_Background" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFDDDDDD"/>
<GradientStop Color="#FFA2A2A2" Offset="1"/>
</LinearGradientBrush>
<!--ComboBoxBorder-->
<Style x:Key="ComboBox_Border" TargetType="{x:Type Border}">
<Setter Property="Background" Value="{StaticResource ComboBox_Background}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<!--ComboBoxToggleButton-->
<Style x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Border
x:Name="Border" Grid.ColumnSpan="2"
Style="{StaticResource ComboBox_Border}"
BorderBrush="{TemplateBinding BorderBrush}"/>
<Border
Grid.Column="0"
CornerRadius="0"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="10" />
<Path
x:Name="Arrow"
Grid.Column="1"
Fill="{TemplateBinding Foreground}"
Stroke="{TemplateBinding Foreground}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 6,0 L 6,6 L 0,6 Z" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="45"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Background" Value="LightGray" />
<Setter TargetName="Border" Property="BorderBrush" Value="Gray" />
<Setter Property="Foreground" Value="Gray"/>
<Setter TargetName="Arrow" Property="Fill" Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--ComboBoxTextBox-->
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
<Border x:Name="PART_ContentHost" Focusable="True" />
</ControlTemplate>
<!--ComboBox Style-->
<Style TargetType="{x:Type ComboBox}">
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="Background" Value="White" />
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
<Setter Property="FontSize" Value="20" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="MinWidth" Value="50"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton
Name="ToggleButton"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
Style="{StaticResource ComboBoxToggleButton}"
Grid.Column="2"
Focusable="false"
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
ClickMode="Press">
</ToggleButton>
<ContentPresenter
Name="ContentSite"
IsHitTestVisible="False"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
Margin="10,3,30,3"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
<TextBox x:Name="PART_EditableTextBox"
Style="{x:Null}"
Template="{StaticResource ComboBoxTextBox}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="3,3,23,3"
Focusable="True"
Visibility="Hidden"
IsReadOnly="{TemplateBinding IsReadOnly}"/>
<Popup
Name="Popup"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Slide">
<Grid
Name="DropDown"
SnapsToDevicePixels="True"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border
x:Name="DropDownBorder"
Style="{StaticResource ComboBox_Border}"
BorderBrush="{TemplateBinding BorderBrush}"/>
<ScrollViewer Margin="2,4,2,4" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
<Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,2"/>
</Trigger>
<Trigger Property="IsEditable" Value="true">
<Setter Property="IsTabStop" Value="false"/>
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
</Style.Triggers>
</Style>
<!--ComboBoxItemStyle-->
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="FontSize" Value="20" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border
Name="Border"
Padding="0"
Margin="2"
BorderThickness="2"
CornerRadius="0"
Background="Transparent"
BorderBrush="Transparent">
<TextBlock TextAlignment="Center">
<ContentPresenter />
</TextBlock>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White"/>
<Setter TargetName="Border" Property="Background" Value="LightGray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
@@ -316,14 +513,329 @@
<Setter Property="Height" Value="75"/>
</Style>
<!--Style di un immagine in una ListBox-->
<Style x:Key="OmagCut_ListBoxIcon" TargetType="{x:Type Image}" >
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="Margin" Value="0,8,6,4"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!-- ** LISTBOX ** -->
<!-- ListBox -->
<!--DataTemplate solo testo-->
<DataTemplate x:Key="NameIdLsBxItem">
<TextBlock Text="{Binding Name}" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" />
</DataTemplate>
<!--DataTemplate testo ed immagine-->
<DataTemplate x:Key="DataTemplateItem">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />-->
<Image Grid.Column="0" Source="{Binding PictureString}" Style="{StaticResource OmagCut_ListBoxIcon}" />
<!--<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" VerticalAlignment="Center" />-->
<TextBlock Grid.Column="1" Text="{Binding Name}" Style="{StaticResource OmagCut_ListBoxTextBlock}" />
</Grid>
</DataTemplate>
<Style TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="{StaticResource OmagCut_TreeViewGradientGray}"/>
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Blue}"/>
<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="9.5" Padding="1" SnapsToDevicePixels="true">
<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}" Style="{StaticResource FavsScrollViewer}">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</Trigger>
<Trigger Property="IsGrouping" Value="false">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ListBoxItem -->
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="Margin" Value="1,0,1,0"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
Margin="{TemplateBinding Margin}"
SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" TargetName="Bd" Value="LightGray"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="White"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="false"/>
<Condition Property="IsMouseOver" Value="true"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="LightGray"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="LightGray"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true"/>
<Condition Property="Selector.IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="LightGray"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="White"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="DarkGray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!-- ScrollBar & it's component (RepeatButton, Thumb) -->
<!-- SrollViewer ScrollBar Repeat Buttons (The part in the middle, not the thumb the long area between the
buttons ) -->
<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Border Background="Transparent" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ScrollViewer Vertical ScrollBar Thumb, that part that can be dragged up/down or left/right Buttons -->
<Style x:Key="VerticalScrollBarThumb" TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="6"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50*"/>
<RowDefinition Height="1"/>
<RowDefinition Height="50*"/>
</Grid.RowDefinitions>
<Border Grid.Column="1" Grid.Row="1" CornerRadius="1" Background="LightGray"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ScrollViewer Horizontal ScrollBar Thumb, that part that can be dragged up/down or left/right Buttons -->
<Style x:Key="HorizontalScrollBarThumb" TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="6"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Grid.Column="1" Grid.Row="1" CornerRadius="1" Background="LightGray"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- VerticalScrollBar Template using the previously created Templates -->
<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="0.00001*"/>
</Grid.RowDefinitions>
<Border Grid.RowSpan="3"
CornerRadius="0"
Background="Transparent" />
<Track Name="PART_Track"
Grid.Row="1"
IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageUpCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource VerticalScrollBarThumb}"
Margin="0,2.75,2,2.75"
Background="{StaticResource OmagCut_Blue}"
BorderBrush="Transparent" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageDownCommand" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
</ControlTemplate>
<!-- HorizontalScrollBar Template using the previously created Templates -->
<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.00001*"/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="3"
CornerRadius="0"
Background="Transparent" />
<Track Name="PART_Track"
Grid.Column="1"
IsDirectionReversed="False">
<Track.DecreaseRepeatButton>
<RepeatButton
Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageLeftCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource HorizontalScrollBarThumb}"
Margin="2.75,0,0,2"
Background="{StaticResource OmagCut_Blue}"
BorderBrush="Transparent" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton
Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageRightCommand" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
</ControlTemplate>
<!-- Style for overall ScrollBar -->
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto"/>
<Setter Property="Height" Value="12" />
<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
</Trigger>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="Width" Value="12"/>
<Setter Property="Height" Value="Auto" />
<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
</Trigger>
</Style.Triggers>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!-- ScrollViewer -->
<!-- Style for overall ScrollViewer -->
<Style x:Key="FavsScrollViewer" TargetType="{x:Type ScrollViewer}">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollContentPresenter Grid.Column="0"/>
<ScrollBar Name="PART_VerticalScrollBar"
Grid.Row="0"
Grid.Column="1"
Value="{TemplateBinding VerticalOffset}"
Maximum="{TemplateBinding ScrollableHeight}"
ViewportSize="{TemplateBinding ViewportHeight}"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
<ScrollBar Name="PART_HorizontalScrollBar"
Orientation="Horizontal"
Grid.Row="1"
Grid.Column="0"
Value="{TemplateBinding HorizontalOffset}"
Maximum="{TemplateBinding ScrollableWidth}"
ViewportSize="{TemplateBinding ViewportWidth}"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TextBlock-->
@@ -344,6 +856,11 @@
<Setter Property="Margin" Value="6,1,0,1"/>
</Style>
<!--TextBlock per elementi delle ListBox-->
<Style x:Key="OmagCut_ListBoxTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
<Setter Property="TextWrapping" Value="NoWrap"/>
</Style>
<Style x:Key="OmagCut_ToolsDBTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="25,0,0,0"/>
@@ -561,7 +1078,6 @@
<Setter Property="Background" TargetName="ExpanderBorder" Value="Transparent"/>
<Setter Property="BorderBrush" TargetName="ExpanderBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
<Setter Property="BorderThickness" TargetName="ExpanderBorder" Value="1,1,0,1"/>
<!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
@@ -919,7 +1435,7 @@
<!-- ** LISTBOX ** -->
<DataTemplate x:Key="DataTemplateItem">
<!--<DataTemplate x:Key="DataTemplateItem">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -930,13 +1446,13 @@
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</DataTemplate>-->
<!-- *************************************************************************** -->
<!-- ** COMBOBOX ** -->
<Style x:Key="ComboBoxFocusVisual">
<!--<Style x:Key="ComboBoxFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
@@ -1152,7 +1668,7 @@
<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
</Trigger>
</Style.Triggers>
</Style>
</Style>-->
<!-- *************************************************************************** -->
+1 -1
View File
@@ -34,7 +34,7 @@
</Grid>
<Label Name="FilePathTxBl" Background="White" FontSize="15"/>
<Label Name="FilePathTxBl" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
+1 -1
View File
@@ -101,7 +101,7 @@ Public Class OpenPageUC
Return LoadDisks()
End If
Dim TempPath As New Text.StringBuilder(260)
PathCompactPathEx(TempPath, m_sCurrDir, 28, 0)
PathCompactPathEx(TempPath, m_sCurrDir, 22, 0)
' lo visualizzo
FilePathTxBl.Content = TempPath.ToString
' pulisco la lista
+40 -43
View File
@@ -12,53 +12,50 @@
</UserControl.Resources>
<!-- Definizione della ImportPage -->
<Border Style="{StaticResource OmagCut_PageBorder}" >
<Grid Name="PhotoPageGrid" >
<Grid Name="PhotoPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="FilePathTxBl" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<!-- Definizione della Grid superiore per Button -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="FilePathTxBl" Background="White" FontSize="15"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<!-- Definizione della Grid superiore per Button -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<Image Name="PhotoImage" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3"/>
<!-- Definizione della Grid inferiore per Button -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<Image Source="Resources/V.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
<Image Name="PhotoImage" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3"/>
<!-- Definizione della Grid inferiore per Button -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<Image Source="Resources/V.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_GradientBlueIconButton}">
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</UserControl>
+1 -1
View File
@@ -31,7 +31,7 @@ Public Class PhotoPageUC
Return LoadDisks()
End If
Dim TempPath As New Text.StringBuilder(260)
PathCompactPathEx(TempPath, m_sCurrDir, 28, 0)
PathCompactPathEx(TempPath, m_sCurrDir, 22, 0)
' lo visualizzo
FilePathTxBl.Content = TempPath.ToString
' pulisco la lista
+1 -1
View File
@@ -93,7 +93,7 @@
<GroupBox Name="MaterialGpBx" Grid.Row="1" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_GroupBox}">
<ComboBox Name="MaterialsCmbx" Height="38" Width="200"
Background="LightGray" >
Background="LightGray" MaxDropDownHeight="600">
<ComboBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding sName}" FontSize="20" />
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+123 -41
View File
@@ -6,27 +6,44 @@ Public Class SideAngleUC
Private m_MainWindow As MainWindow = Application.Current.MainWindow
Private m_DrawPage As DrawPageUC
' Riferimento alla pagina che ha aperto SideAngleUC
Private m_CallingPage As MainWindow.Pages
' Lista di tutte le entità inclinabili presenti nel progetto
Friend m_SideAngleEntityList As New List(Of SideAngleEntity)
Private Sub SideAngleUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Copio riferimento alla DrawPage
m_DrawPage = m_MainWindow.m_DrawPageUC
' Imposto questa come pagina correntemente visualizzata nella drawpage
m_DrawPage.m_ActiveComponentPage = DrawPageUC.Pages.SideAngle
m_CallingPage = m_MainWindow.m_ActivePage
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto questa come pagina correntemente visualizzata nella drawpage
m_DrawPage.m_ActiveComponentPage = DrawPageUC.Pages.SideAngle
' se la lista non è vuota la leggo e metto le inclinazioni giuste
If m_DrawPage.m_SideAngleEntityList.Count > 0 Then
' Aggiorno indici che potrebbero essere cambiati se sono state modificate le misure
RefreshGeomId()
' Aggiorno testi in base alla tabella
RefreshSideAngleText()
' Aggiorno elenco variabili
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
' se la lista non è vuota la leggo e metto le inclinazioni giuste
If m_SideAngleEntityList.Count > 0 Then
' Aggiorno indici che potrebbero essere cambiati se sono state modificate le misure
RefreshGeomId()
' Aggiorno testi in base alla tabella
RefreshSideAngleText()
' Aggiorno elenco variabili
Else
Else
' Inizializzo lati per angoli (ne compilo la lista e aggiungo la scritta nel disegno)
InitSideAngleLine()
End If
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
DeleteSideAngle()
' Inizializzo lati per angoli (ne compilo la lista e aggiungo la scritta nel disegno)
InitSideAngleLine()
End If
' Gestisco Checkbox e nomi in base al numero di lati inclinabili
@@ -40,17 +57,16 @@ Public Class SideAngleUC
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Etichette"), GDB_ST.OFF)
EgtZoom(ZM.ALL)
EgtDraw()
EgtSaveFile("C:\Temp\qqq.nge", NGE.TEXT)
End Sub
Private Sub TxBlChBxView()
For Index As Integer = 1 To 10 - m_DrawPage.m_SideAngleEntityList.Count
For Index As Integer = 1 To 10 - m_SideAngleEntityList.Count
GetChBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Hidden
Next
' Indice dei nomi per TxBl
Dim TxBlIndex As Integer = 1
For Index As Integer = 10 - m_DrawPage.m_SideAngleEntityList.Count + 1 To 10
For Index As Integer = 10 - m_SideAngleEntityList.Count + 1 To 10
GetChBxFromIndex(Index).Visibility = Windows.Visibility.Visible
GetTxBlFromIndex(Index).Text = "A " & TxBlIndex
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Visible
@@ -109,16 +125,23 @@ Public Class SideAngleUC
End Function
Private Sub SideAngleUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Ricavo nome primo pezzo
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Attivo layer delle misure
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "LayAux"), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Quotature"), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Etichette"), GDB_ST.ON_)
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
EgtEmptyGroup(EgtGetFirstNameInGroup(Part1, "SideAngle"))
EgtDraw()
Dim Part1 As Integer
If m_CallingPage = MainWindow.Pages.Draw Then
' Ricavo nome primo pezzo
Part1 = EgtGetFirstInGroup(GDB_ID.ROOT)
' Attivo layer delle misure
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "LayAux"), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Quotature"), GDB_ST.ON_)
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Etichette"), GDB_ST.ON_)
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
EgtEmptyGroup(EgtGetFirstNameInGroup(Part1, "SideAngle"))
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Ricavo nome pezzo precedentemente selezionato
Part1 = m_MainWindow.m_ImportPageUC.m_PrevSelPart
EgtErase(EgtGetFirstNameInGroup(Part1, "SideAngle"))
End If
EgtDraw()
End Sub
Private Sub RefreshGeomId()
@@ -126,18 +149,27 @@ Public Class SideAngleUC
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Ricavo nome layer con geometria esterna pezzo
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, "OutLoop")
For Each Entity In m_DrawPage.m_SideAngleEntityList
For Each Entity In m_SideAngleEntityList
Entity.nGeomId = EgtGetFirstNameInGroup(OutLoop, Entity.sEntityName)
Next
End Sub
Private Sub RefreshSideAngleText()
Dim Part1 As Integer
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
' Ricavo nome primo pezzo
Part1 = EgtGetFirstInGroup(GDB_ID.ROOT)
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Ricavo nome primo pezzo
Part1 = EgtGetFirstSelectedObj()
End If
' Cancello testi già presenti
' Ricavo nome primo pezzo
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Ricavo nome layer con geometria esterna pezzo
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, "OutLoop")
' Calcolo dimensione ingombro OutLoop
@@ -156,21 +188,31 @@ Public Class SideAngleUC
End If
' Lo svuoto
For Each Entity In m_DrawPage.m_SideAngleEntityList
For Each Entity In m_SideAngleEntityList
' Creo testo con angolo di inclinazione
AddTextToLine(Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°", Entity.nTextId, Entity.nGeomId, 10, dBBoxRad)
Next
'Aggiorno visualizzazione
EgtZoom(ZM.ALL)
EgtDraw()
End Sub
Private Sub InitSideAngleLine()
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
Dim Part1 As Integer
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
' Ricavo nome primo pezzo
Part1 = EgtGetFirstInGroup(GDB_ID.ROOT)
Else
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Ricavo nome primo pezzo
Part1 = EgtGetFirstSelectedObj()
End If
' Ricavo nome primo pezzo
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
AdjustFlatPart(Part1)
' Ricavo nome layer con geometria esterna pezzo
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, "OutLoop")
' Calcolo dimensione ingombro OutLoop
@@ -184,11 +226,14 @@ Public Class SideAngleUC
Dim LastLine As Integer = EgtGetLastInGroup(OutLoop)
Dim CurrLine As Integer = EgtGetFirstInGroup(OutLoop)
Dim NextLine As Integer = EgtGetNext(CurrLine)
'Creo indice per numerare le entità in ImportPage
Dim nEntityIndex As Integer = 1
' Ciclo che verifica se possibile inclinare la linea corrente fino alla penultima
While NextLine <> GDB_ID.NULL
If VerifyIsSideAnglePossible(LastLine, CurrLine, NextLine) Then
' Aggiungo il lato alla lista di quelli inclinabili e ne azzero l'inclinazione
AddSideAngle(CurrLine, TextLayer, dBBoxRad)
AddSideAngle(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
nEntityIndex += 1
End If
LastLine = CurrLine
CurrLine = NextLine
@@ -197,7 +242,7 @@ Public Class SideAngleUC
' Verifico se possibile inclinare l'ultima linea
NextLine = EgtGetFirstInGroup(OutLoop)
If VerifyIsSideAnglePossible(LastLine, CurrLine, NextLine) Then
AddSideAngle(CurrLine, TextLayer, dBBoxRad)
AddSideAngle(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
End If
End Sub
@@ -257,11 +302,15 @@ Public Class SideAngleUC
End Function
' Funzione che gestisce le operazioni sull'entità da inclinare
Private Sub AddSideAngle(CurrLine As Integer, TextLayer As Integer, dBBoxRad As Double)
Private Sub AddSideAngle(CurrLine As Integer, TextLayer As Integer, dBBoxRad As Double, nEntityIndex As Integer)
' Se sono in importa
If m_CallingPage = MainWindow.Pages.Import Then
EgtSetName(CurrLine, "A" & nEntityIndex.ToString())
End If
' Aggiungo entità all'elenco di quelle inclinabili
Dim sEntityName As String = String.Empty
EgtGetName(CurrLine, sEntityName)
m_MainWindow.m_DrawPageUC.m_SideAngleEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, 0))
m_SideAngleEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, 0))
' Cancello inclinazione nell'apposito campo info
EgtRemoveInfo(CurrLine, "SideAng")
' Creo testo con angolo di inclinazione 0
@@ -324,7 +373,7 @@ Public Class SideAngleUC
dSideAngle = 0
End If
'Converto nome checkbox in nome elemento tenendo conto dello slittamento verso il basso
Dim CurrSideAng As String = "A" & m_DrawPage.m_SideAngleEntityList.Count - (10 - CurrCheckBox.Name.Substring(1))
Dim CurrSideAng As String = "A" & m_SideAngleEntityList.Count - (10 - CurrCheckBox.Name.Substring(1))
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideAngle(CurrSideAng, dSideAngle)
'Aggiorno tutti i testi
@@ -351,9 +400,26 @@ Public Class SideAngleUC
Return True
End Function
Friend Sub DeleteSideAngle()
' Cancello lista lati inclinati
m_SideAngleEntityList.Clear()
' Annullo tutti i CheckBox
A1.IsChecked = False
A2.IsChecked = False
A3.IsChecked = False
A4.IsChecked = False
A5.IsChecked = False
A6.IsChecked = False
A7.IsChecked = False
A8.IsChecked = False
A9.IsChecked = False
A10.IsChecked = False
End Sub
Private Sub SideAngleTxBx_EgtClosed(sender As Object, e As EventArgs) Handles SideAngleTxBx.EgtClosed
' ciclo sui checkbox calcolati sul numero di lati inclinabili presenti
For Index As Integer = 10 - m_DrawPage.m_SideAngleEntityList.Count + 1 To 10
For Index As Integer = 10 - m_SideAngleEntityList.Count + 1 To 10
' Nuovo angolo di inclinazione
Dim dSideAngle As Double
' Se checked lo imposto al valore letto dalla TxBx
@@ -364,7 +430,7 @@ Public Class SideAngleUC
dSideAngle = 0
End If
'Converto nome checkbox in nome elemento tenendo conto dello slittamento verso il basso
Dim CurrSideAng As String = "A" & m_DrawPage.m_SideAngleEntityList.Count - (10 - GetChBxFromIndex(Index).Name.Substring(1))
Dim CurrSideAng As String = "A" & m_SideAngleEntityList.Count - (10 - GetChBxFromIndex(Index).Name.Substring(1))
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideAngle(CurrSideAng, dSideAngle)
'Aggiorno tutti i testi
@@ -373,6 +439,11 @@ Public Class SideAngleUC
End Sub
Friend Sub ReLoadSideAnglePage()
SideAngleUC_Unloaded(Me, New RoutedEventArgs)
SideAngleUC_Loaded(Me, New RoutedEventArgs)
End Sub
End Class
Friend Class SideAngleEntity
@@ -422,7 +493,18 @@ Friend Class SideAngleEntity
End Sub
Friend Shared Function FindEntity(sEntityName As String) As SideAngleEntity
For Each Entity In m_MainWindow.m_DrawPageUC.m_SideAngleEntityList
Dim EntityList As List(Of SideAngleEntity) = Nothing
If m_MainWindow.m_ActivePage = MainWindow.Pages.Draw Then
EntityList = m_MainWindow.m_DrawPageUC.m_SideAngle.m_SideAngleEntityList
ElseIf m_MainWindow.m_ActivePage = MainWindow.Pages.Import Then
EntityList = m_MainWindow.m_ImportPageUC.m_SideAngleUC.m_SideAngleEntityList
End If
If IsNothing(EntityList) Then
Return Nothing
End If
For Each Entity In EntityList
If Entity.m_sEntityName = sEntityName Then
Return Entity
End If