Gestione Engrave in ImportDXF
This commit is contained in:
@@ -112,7 +112,7 @@ Public Class DxfImportSceneHostV
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportDxfScene.OnMouseDownScene
|
||||
' Solo se in modalità angoli o gocciolatoio su lati esterni
|
||||
If DxfImportWindowMap.refDxfImportWindowVM.SideAngle_IsChecked Or DxfImportWindowMap.refDxfImportWindowVM.Drip_IsChecked Then
|
||||
If DxfImportWindowMap.refDxfImportWindowVM.SideAngle_IsChecked Or DxfImportWindowMap.refDxfImportWindowVM.Drip_IsChecked Or DxfImportWindowMap.refDxfImportWindowVM.Engrave_IsChecked Then
|
||||
OnMouseDownSceneSideAngle(e)
|
||||
ElseIf DxfImportWindowMap.refDxfImportWindowVM.FiloTop_IsChecked Then
|
||||
OnMouseDownSceneFiloTop(e)
|
||||
|
||||
@@ -6,7 +6,193 @@
|
||||
Title="{Binding TitleMsg}"
|
||||
IsMinimizable="False"
|
||||
ShowInTaskbar="False"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStartupLocation="CenterOwner">
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStartupLocation="CenterOwner"
|
||||
xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
<!--gradiente colore-->
|
||||
|
||||
<!--<Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<theme:ScrollChrome x:Name="Chrome" RenderPressed="{TemplateBinding IsPressed}" RenderMouseOver="{TemplateBinding IsMouseOver}" SnapsToDevicePixels="true" theme:ScrollChrome.ScrollGlyph="{TemplateBinding theme:ScrollChrome.ScrollGlyph}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>-->
|
||||
|
||||
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Thumb}">
|
||||
<Border x:Name="Background" CornerRadius="0" Background="Transparent" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<Grid Background="Transparent" Margin="1">
|
||||
<Border Opacity="0" x:Name="BackgroundAnimation" Background="Transparent" />
|
||||
<Rectangle x:Name="BackgroundGradient" RadiusX="8" RadiusY="8" Fill="#FF095CA8" Stroke="#1C1D22" StrokeThickness="0.5">
|
||||
<!--<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
|
||||
<GradientStop Color="#1C1D22" Offset="0.375" />
|
||||
<GradientStop Color="#1C1D22" Offset="0.625" />
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>-->
|
||||
</Rectangle>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>-->
|
||||
|
||||
<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ScrollBarStyle1" TargetType="{x:Type ScrollBar}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
|
||||
<Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
||||
<Grid x:Name="Bg" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MaxHeight="1"/>
|
||||
<RowDefinition Height="0.00001*"/>
|
||||
<RowDefinition MaxHeight="1"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--<RepeatButton Command="{x:Static ScrollBar.LineUpCommand}" IsEnabled="{TemplateBinding IsMouseOver}" />-->
|
||||
<Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
|
||||
</Track.DecreaseRepeatButton>
|
||||
<Track.IncreaseRepeatButton>
|
||||
<RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
|
||||
</Track.IncreaseRepeatButton>
|
||||
<Track.Thumb>
|
||||
<Thumb Style="{StaticResource ScrollBarThumb}"/>
|
||||
</Track.Thumb>
|
||||
</Track>
|
||||
<!--<RepeatButton Command="{x:Static ScrollBar.LineDownCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="2" theme:ScrollChrome.ScrollGlyph="DownArrow"/>-->
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="Bg" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<!--<Style.Triggers>
|
||||
<Trigger Property="Orientation" Value="Horizontal">
|
||||
<Setter Property="Width" Value="Auto"/>
|
||||
<Setter Property="MinWidth" Value="0"/>
|
||||
<Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
|
||||
<Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
||||
<Grid x:Name="Bg" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
|
||||
<ColumnDefinition Width="0.00001*"/>
|
||||
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" IsEnabled="{TemplateBinding IsMouseOver}" theme:ScrollChrome.ScrollGlyph="LeftArrow" Style="{StaticResource CustomScrollBarButton}"/>
|
||||
<Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource CustomScrollBarButton}"/>
|
||||
</Track.DecreaseRepeatButton>
|
||||
<Track.IncreaseRepeatButton>
|
||||
<RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource CustomScrollBarButton}"/>
|
||||
</Track.IncreaseRepeatButton>
|
||||
<Track.Thumb>
|
||||
<Thumb Style="{StaticResource ScrollBarThumb}"/>
|
||||
</Track.Thumb>
|
||||
</Track>
|
||||
<RepeatButton Command="{x:Static ScrollBar.LineRightCommand}" Grid.Column="2" IsEnabled="{TemplateBinding IsMouseOver}" theme:ScrollChrome.ScrollGlyph="RightArrow" Style="{StaticResource CustomScrollBarButton}"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="Bg" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>-->
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ScrollViewerStyle1" TargetType="{x:Type ScrollViewer}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||||
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Rectangle x:Name="Corner" Grid.Column="1" Fill="{StaticResource Omag_Black}" Grid.Row="1"/>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanHorizontallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" CanVerticallyScroll="False" Grid.Column="0" Content="{TemplateBinding Content}" CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
|
||||
<ScrollBar Style="{DynamicResource ScrollBarStyle1}" x:Name="PART_VerticalScrollBar"
|
||||
AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1"
|
||||
Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0"
|
||||
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
||||
Margin="2,0,0,0"/>
|
||||
<ScrollBar Style="{DynamicResource ScrollBarStyle1}" x:Name="PART_HorizontalScrollBar"
|
||||
AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0"
|
||||
Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1"
|
||||
Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Omag_Blue}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
|
||||
<DockPanel>
|
||||
|
||||
@@ -84,7 +270,7 @@
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<UniformGrid Columns="4"
|
||||
<UniformGrid Columns="5"
|
||||
DockPanel.Dock="Top"
|
||||
IsEnabled="{Binding SideEntity_IsEnabled}"
|
||||
Margin="0,0,0,5">
|
||||
@@ -98,6 +284,10 @@
|
||||
IsChecked="{Binding FiloTop_IsChecked}"
|
||||
Style="{StaticResource CompoWindow_WrapToggleButton}"/>
|
||||
|
||||
<ToggleButton Content="{Binding EngraveMsg}"
|
||||
IsChecked="{Binding Engrave_IsChecked}"
|
||||
Style="{StaticResource CompoWindow_WrapToggleButton}"/>
|
||||
|
||||
<!--Incidi da sotto-->
|
||||
<ToggleButton Content="{Binding DripMsg}"
|
||||
IsChecked="{Binding Drip_IsChecked}"
|
||||
@@ -122,13 +312,12 @@
|
||||
Style="{StaticResource OptionPanel_TextButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<GroupBox Header="Dati pezzo"
|
||||
|
||||
<GroupBox Header="Dati pezzo"
|
||||
BorderThickness="{StaticResource BorderGpBx_Thickness}"
|
||||
Foreground="{StaticResource Omag_White}"
|
||||
Margin="0">
|
||||
|
||||
<StackPanel>
|
||||
<ScrollViewer Style="{DynamicResource ScrollViewerStyle1}" VerticalScrollBarVisibility="Auto" Focusable="False">
|
||||
<StackPanel>
|
||||
<Grid Visibility="{Binding PartData_Visibility}"
|
||||
Margin="0,0,0,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -178,10 +367,12 @@
|
||||
TextWrapping="Wrap"
|
||||
TextAlignment="Center"
|
||||
Margin="0,0,0,20"/>
|
||||
|
||||
|
||||
<ContentControl VerticalAlignment="Center"
|
||||
Content="{Binding SideEntityControl}"/>
|
||||
Content="{Binding SideEntityControl}" ScrollViewer.VerticalScrollBarVisibility="Visible"/>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</GroupBox>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
@@ -142,7 +142,7 @@ Public Class DxfImportWindowVM
|
||||
Return m_SideAngle_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_Drip_IsChecked Or m_UnderDrill_IsChecked Or m_FiloTop_IsChecked Then Return
|
||||
If m_Drip_IsChecked Or m_UnderDrill_IsChecked Or m_FiloTop_IsChecked Or m_Engrave_IsChecked Then Return
|
||||
m_SideAngle_IsChecked = value
|
||||
If value Then
|
||||
' Aggiungo regioni per percorsi interni
|
||||
@@ -190,7 +190,7 @@ Public Class DxfImportWindowVM
|
||||
Return m_FiloTop_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_SideAngle_IsChecked Or m_Drip_IsChecked Or m_UnderDrill_IsChecked Then Return
|
||||
If m_SideAngle_IsChecked Or m_Drip_IsChecked Or m_UnderDrill_IsChecked Or m_Engrave_IsChecked Then Return
|
||||
m_FiloTop_IsChecked = value
|
||||
If value Then
|
||||
' Aggiungo regioni per percorsi interni
|
||||
@@ -233,13 +233,61 @@ Public Class DxfImportWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Engrave_IsChecked As Boolean
|
||||
Public Property Engrave_IsChecked As Boolean
|
||||
Get
|
||||
Return m_Engrave_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_Drip_IsChecked Or m_UnderDrill_IsChecked Or m_FiloTop_IsChecked Or m_SideAngle_IsChecked Then Return
|
||||
m_Engrave_IsChecked = value
|
||||
If value Then
|
||||
' Aggiungo regioni per percorsi interni
|
||||
AdjustSelectRegions()
|
||||
' Messaggio di selezione contorno
|
||||
SetOutputMessage(EgtMsg(MSG_DRAWPAGEUC + 6), MSG_TYPE.INFO) ' Selezionare un contorno
|
||||
' Imposto modalità sideangle
|
||||
m_SideEntityControlVM = New SideEntityControlVM(SideEntityControlVM.CallingWindowOpt.DXFIMPORT,
|
||||
DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene,
|
||||
SideEntityControlVM.ModeOpt.ENGRAVE)
|
||||
SideEntityControl = New SideEntityControlV(m_SideEntityControlVM)
|
||||
Open_IsEnabled = False
|
||||
Type_IsEnabled = False
|
||||
Measure_IsEnabled = False
|
||||
PartData_Visibility = Visibility.Collapsed
|
||||
OrderList_Visibility = Visibility.Collapsed
|
||||
OkIsEnabled = False
|
||||
Else
|
||||
' Rimuovo regioni per percorsi interni
|
||||
RemoveSelectRegions()
|
||||
m_SideEntityControlVM.Close()
|
||||
Open_IsEnabled = True
|
||||
Type_IsEnabled = True
|
||||
Measure_IsEnabled = True
|
||||
PartData_Visibility = Visibility.Visible
|
||||
OrderList_Visibility = Visibility.Visible
|
||||
OkIsEnabled = True
|
||||
m_SideEntityControlVM = Nothing
|
||||
SideEntityControl = Nothing
|
||||
' Elimino scritte angoli per input e inserisco quelle definitive
|
||||
SideEntityControlVM.WriteSideAngleForNest(DxfImportWindowMap.refDxfImportSceneHostV.ImportDxfScene.GetCtx())
|
||||
' Deseleziono tutto
|
||||
DxfImportWindowMap.refDxfImportSceneHostV.Deselect()
|
||||
' Pulisco area messaggi
|
||||
ClearOutputMessage()
|
||||
End If
|
||||
NotifyPropertyChanged("EngraveIsChecked")
|
||||
EgtZoom(ZM.ALL)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Drip_IsChecked As Boolean
|
||||
Public Property Drip_IsChecked As Boolean
|
||||
Get
|
||||
Return m_Drip_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_SideAngle_IsChecked Or m_UnderDrill_IsChecked Or m_FiloTop_IsChecked Then Return
|
||||
If m_SideAngle_IsChecked Or m_UnderDrill_IsChecked Or m_FiloTop_IsChecked Or m_Engrave_IsChecked Then Return
|
||||
m_Drip_IsChecked = value
|
||||
If value Then
|
||||
' Messaggio di selezione contorno
|
||||
@@ -283,7 +331,7 @@ Public Class DxfImportWindowVM
|
||||
Return m_UnderDrill_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If m_SideAngle_IsChecked Or m_Drip_IsChecked Or m_FiloTop_IsChecked Then Return
|
||||
If m_SideAngle_IsChecked Or m_Drip_IsChecked Or m_FiloTop_IsChecked Or m_Engrave_IsChecked Then Return
|
||||
m_UnderDrill_IsChecked = value
|
||||
If value Then
|
||||
' Aggiungo regioni di selezione per percorsi interni
|
||||
@@ -493,6 +541,12 @@ Public Class DxfImportWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EngraveMsg As String
|
||||
Get
|
||||
Return EgtMsg(90397)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DripMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_IMPORTPAGEUC + 8)
|
||||
@@ -844,7 +898,7 @@ Public Class DxfImportWindowVM
|
||||
|
||||
Friend Sub SelectedPartChanged()
|
||||
' Se sono in modalità inclinazioni o gocciolatoio calcolo lati inclinabili e creo testi
|
||||
If SideAngle_IsChecked() Or Drip_IsChecked() Or FiloTop_IsChecked Then
|
||||
If SideAngle_IsChecked() Or Drip_IsChecked() Or FiloTop_IsChecked Or Engrave_IsChecked Then
|
||||
m_SideEntityControlVM.ReLoadSideAnglePage(SideEntityControlVM.CallingWindowOpt.DXFIMPORT)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user