- introdotto BottomRail

- migliorie a grafica e CRM
This commit is contained in:
Emmanuele Sassi
2025-04-01 11:13:50 +02:00
parent d3e9474417
commit 9acbbab49e
9 changed files with 122 additions and 14 deletions
+2 -1
View File
@@ -38,7 +38,8 @@
</StackPanel>
<TabControl Grid.Row="1"
SelectedIndex="{Binding SelCRMPage}"
TabStripPlacement="Right">
TabStripPlacement="Right"
Style="{StaticResource TabControl.NoHeader}">
<TabItem Header="Nuovo cliente">
<!--<local:NewEstimationPageV DataContext="{StaticResource NewEstimationPageVM}"/>-->
</TabItem>
@@ -420,6 +420,7 @@ Public Class TemplateRow
m_sName = sName
m_dWidth = dWidth
m_dHeight = dHeight
m_sImagePath = Map.refMainWindowVM.MainWindowM.sTemplateDir & "\" & nId & ".png"
End Sub
End Class
+11 -3
View File
@@ -8,9 +8,9 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<local:ProjManagerV DataContext="{StaticResource ProjManagerVM}"/>
<TabControl Grid.Row="1"
SelectedIndex="{Binding SelPage}">
SelectedIndex="{Binding SelPage}"
Style="{StaticResource TabControl.NoHeader}">
<TabItem Header="Home">
<local:HomePageV DataContext="{StaticResource HomePageVM}"/>
</TabItem>
@@ -21,7 +21,15 @@
<local:ProducingPageV DataContext="{StaticResource ProducingPageVM}"/>
</TabItem>
<TabItem Header="WindowManager">
<local:ManageWindowV DataContext="{StaticResource ManageWindowVM}"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<local:ProjManagerV DataContext="{StaticResource ProjManagerVM}"/>
<local:ManageWindowV Grid.Row="1"
DataContext="{StaticResource ManageWindowVM}"/>
</Grid>
</TabItem>
</TabControl>
</Grid>
@@ -77,6 +77,16 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
<Expander IsExpanded="{Binding SelArea.BottomRail}"
Header="Bottom Rail"
Margin="0,0,0,10"
Style="{StaticResource Expander.CheckBoxHeader}">
<UniformGrid Columns="2"
Margin="0,5">
<TextBlock Text="Quantità"/>
<TextBox Text="{Binding SelArea.BottomRailQty}"/>
</UniformGrid>
</Expander>
<Button Content="Calcola"
Command="{Binding ApplyFrame_Command}"
Style="{StaticResource Button.ManageWindow.LeftBar}"/>
+20 -2
View File
@@ -108,7 +108,7 @@ Public Class ManageWindowVM
Private m_DShowMode As DShowModes = DShowModes.MODESIMPLE3D
Friend Sub SetDShowMode(value As DShowModes)
m_DShowMode = value
DrawWindow()
DrawWindow(False)
End Sub
Public Property bIsShow2DOn As Boolean
@@ -1011,6 +1011,7 @@ Public Class SashDimension
m_SelOpeningType = value
m_Parent.RefreshHardwareList()
m_Parent.RefreshHardwareOptionList()
m_Parent.SetFirstHardware()
End Set
End Property
@@ -1633,6 +1634,19 @@ Public Class Frame
m_bBottomRail = bBottomRail
End Sub
Private m_nBottomRailQty As Integer = 0
Public Property BottomRailQty As Integer
Get
Return m_nBottomRailQty
End Get
Set(value As Integer)
m_nBottomRailQty = value
End Set
End Property
Friend Sub SetBottomRailQty(nBottomRailQty As Integer)
m_nBottomRailQty = nBottomRailQty
End Sub
Private m_Outline As ObservableCollection(Of Curve)
Public Property Outline As ObservableCollection(Of Curve)
Get
@@ -1715,6 +1729,7 @@ Public Class Frame
If m_nAreaId = GDB_ID.NULL Then Return False
' aggiungo BottomRail se necessario
If m_bBottomRail Then
EgtLuaSetGlobIntVar("WDG.NBR", m_nBottomRailQty)
Dim tdlt = EgtLuaCallFunction("WinCreate_AddBottomRail")
End If
' lancio disegno delle sotto aree
@@ -1737,7 +1752,7 @@ Public Class Frame
End Function
Friend Overrides Function Serialize() As JsonArea
Dim JsonFrame As JsonFrame = New JsonFrame(m_Shape, m_bBottomRail)
Dim JsonFrame As JsonFrame = New JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty)
For Each Dimension In DimensionList
JsonFrame.DimensionList.Add(Dimension.Serialize())
Next
@@ -1962,6 +1977,9 @@ Public Class Sash
End Sub
Friend Sub SetSelHardwareFromId(sId As String)
m_SelHardware = m_HardwareList.FirstOrDefault(Function(x) x.sId = sId)
If IsNothing(m_SelHardware) Then
m_SelHardware = m_HardwareList(0)
End If
NotifyPropertyChanged(NameOf(SelHardware))
End Sub
Friend Sub SetFirstHardware()
+15 -6
View File
@@ -8,9 +8,11 @@
Title="Editor Finestra"
Height="900" Width="1200"
WindowStartupLocation="CenterOwner">
<TabControl SelectedIndex="{Binding SelPage}">
<TabControl SelectedIndex="{Binding SelPage}"
Style="{StaticResource TabControl.NoHeader}">
<TabItem Header="TemplateList">
<DataGrid ItemsSource="{Binding TemplateList}"
SelectedItem="{Binding SelTemplate}"
AutoGenerateColumns="False"
CanUserDeleteRows="False"
CanUserResizeRows="False"
@@ -26,7 +28,7 @@
FontSize="12"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Regular"
RowHeight="32"
RowHeight="150"
BorderThickness="0">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
@@ -42,20 +44,27 @@
Binding="{Binding nId}"
Width="Auto"
ElementStyle="{StaticResource TextBlock.DataGridTextColumn}"/>
<DataGridTextColumn Header="Immagine"
Binding="{Binding sImagePath}"
Width="1*"
ElementStyle="{StaticResource TextBlock.DataGridTextColumn}"/>
<DataGridTemplateColumn Header="Immagine"
Width="1*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding sImagePath}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Name"
Binding="{Binding sName}"
IsReadOnly="True"
Width="1*"
ElementStyle="{StaticResource TextBlock.DataGridTextColumn}"/>
<DataGridTextColumn Header="Larghezza"
Binding="{Binding dWidth}"
IsReadOnly="True"
Width="1*"
ElementStyle="{StaticResource TextBlock.DataGridTextColumn}"/>
<DataGridTextColumn Header="Altezza"
Binding="{Binding dHeight}"
IsReadOnly="True"
Width="1*"
ElementStyle="{StaticResource TextBlock.DataGridTextColumn}"/>
</DataGrid.Columns>
@@ -95,6 +95,7 @@ Public Class NewWindowWndVM
' carico template
Dim TemplateFiles() As String = Directory.GetFiles(Map.refMainWindowVM.MainWindowM.sTemplateDir)
For Each Template In TemplateFiles
If Path.GetExtension(Template).ToLower <> ".jwd" Then Continue For
Dim TemplateData() As String = Path.GetFileNameWithoutExtension(Template).Split("_"c)
Dim nTemplateId As Integer = 0
Integer.TryParse(TemplateData(0), nTemplateId)
@@ -116,7 +117,7 @@ Public Class NewWindowWndVM
End Sub
Public Sub TemplateConfirmed()
m_ManageWindowVM.Read(Map.refMainWindowVM.MainWindowM.sTemplateDir & "\" & TEMPLATE_DIR & "\" & SelTemplate.sName & ".jwd")
m_ManageWindowVM.Read(Map.refMainWindowVM.MainWindowM.sTemplateDir & "\" & SelTemplate.nId & "_" & SelTemplate.sName & "_" & SelTemplate.dWidth & "_" & SelTemplate.dHeight & ".jwd")
SetSelPage(NewWindowPages.EDIT)
End Sub
+47
View File
@@ -430,6 +430,53 @@
<Setter Property="Width" Value="100"/>
</Style>
<ControlTemplate x:Key="ControlTemplate.TabControl.NoHeader" TargetType="{x:Type TabControl}">
<Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Border x:Name="contentPanel" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="TabControl.NoHeader" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template" Value="{StaticResource ControlTemplate.TabControl.NoHeader}"/>
</Style>
<Style x:Key="Expander.CheckBoxHeader" TargetType="{x:Type Expander}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" SnapsToDevicePixels="true">
<DockPanel>
<CheckBox x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FontStretch="{TemplateBinding FontStretch}" Foreground="{TemplateBinding Foreground}" FocusVisualStyle="{StaticResource FocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="1,1,5,1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
</DockPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion USERCONTROL-->
</ResourceDictionary>
+14 -1
View File
@@ -127,14 +127,26 @@ Public Class JsonFrame
End Set
End Property
Private m_nBottomRailQty As Integer = 0
<JsonProperty>
Public Property BottomRailQty As Integer
Get
Return m_nBottomRailQty
End Get
Set(value As Integer)
m_nBottomRailQty = value
End Set
End Property
Sub New()
MyBase.New(AreaTypes.FRAME)
End Sub
Sub New(Shape As Shapes, BottomRail As Boolean)
Sub New(Shape As Shapes, BottomRail As Boolean, BottomRailQty As Integer)
MyBase.New(AreaTypes.FRAME)
m_Shape = Shape
m_bBottomRail = BottomRail
m_nBottomRailQty = BottomRailQty
End Sub
Friend Overrides Function Deserialize(ParentArea As Area) As Area
@@ -142,6 +154,7 @@ Public Class JsonFrame
Frame.SetAreaType(AreaTypes.FRAME)
Frame.SetSelShape(m_Shape)
Frame.SetBottomRail(m_bBottomRail)
Frame.SetBottomRailQty(m_nBottomRailQty)
Frame.AppliedDone()
For DimensionIndex = 0 To m_DimensionList.Count - 1
Frame.DimensionList(DimensionIndex).dValue = m_DimensionList(DimensionIndex).dValue