OmagCUT :
- Aggiunta possibilità di spostare le lavorazioni nella listbox.
This commit is contained in:
+2
-4
@@ -62,13 +62,11 @@
|
||||
<RadioButton Name="inchBtn" Grid.Column="6" Style="{StaticResource OmagCut_YellowToggleButton}"/>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="8" Style="{StaticResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="Resources/V.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<Image Source="Resources/V.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="9" Style="{StaticResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="Resources/X.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
<!-- ** LISTBOX ** -->
|
||||
|
||||
<DataTemplate x:Key="NameIdLsBxItem">
|
||||
<TextBlock Text="{Binding Name}" FontSize="15" />
|
||||
<TextBlock Text="{Binding Name}" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" />
|
||||
</DataTemplate>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
+54
-2
@@ -15,16 +15,68 @@
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Name="MachiningLsBx" Grid.Row="1" ItemTemplate="{DynamicResource NameIdLsBxItem}"/>
|
||||
<ListBox Name="MachiningLsBx" Grid.Row="1" ItemTemplate="{DynamicResource NameIdLsBxItem}"
|
||||
SelectionMode="Multiple"/>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="MoveUpBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/UpArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="MoveDownBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/DownArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="CutBtn" Grid.Column="0" Style="{StaticResource OmagCut_YellowTextButton}"
|
||||
Content="Taglia"/>
|
||||
<Button Name="MoveBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowTextButton}"
|
||||
Content="Sposta"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="BeforeBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/NumericKeyboardArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="LaterBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/NumericKeyboardArrow.png" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
|
||||
<Image.RenderTransform>
|
||||
<TransformGroup>
|
||||
<RotateTransform Angle="180"/>
|
||||
</TransformGroup>
|
||||
</Image.RenderTransform>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -10,9 +10,44 @@ Public Class SplitPageUC
|
||||
|
||||
m_MachiningList.Add(New NameIdLsBxItem("Taglio 1", "34"))
|
||||
m_MachiningList.Add(New NameIdLsBxItem("Taglio 2", "57"))
|
||||
m_MachiningList.Add(New NameIdLsBxItem("Taglio 3", "57"))
|
||||
m_MachiningList.Add(New NameIdLsBxItem("Taglio 4", "57"))
|
||||
m_MachiningList.Add(New NameIdLsBxItem("Taglio 5", "57"))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||
MoveItem(-1)
|
||||
End Sub
|
||||
|
||||
Private Sub MoveDownBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveDownBtn.Click
|
||||
MoveItem(1)
|
||||
End Sub
|
||||
|
||||
Public Sub MoveItem(direction As Integer)
|
||||
' Checking selected item
|
||||
If MachiningLsBx.SelectedItem Is Nothing OrElse MachiningLsBx.SelectedIndex < 0 OrElse MachiningLsBx.SelectedItems.Count > 1 Then
|
||||
Return
|
||||
End If
|
||||
' No selected item - nothing to do
|
||||
' Calculate new index using move direction
|
||||
Dim newIndex As Integer = MachiningLsBx.SelectedIndex + direction
|
||||
|
||||
' Checking bounds of the range
|
||||
If newIndex < 0 OrElse newIndex >= MachiningLsBx.Items.Count Then
|
||||
Return
|
||||
End If
|
||||
' Index out of range - nothing to do
|
||||
Dim selected As Object = MachiningLsBx.SelectedItem
|
||||
|
||||
' Removing removable element
|
||||
m_MachiningList.Remove(selected)
|
||||
' Insert it in new position
|
||||
m_MachiningList.Insert(newIndex, selected)
|
||||
' Restore selection
|
||||
MachiningLsBx.SelectedItem = selected
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class NameIdLsBxItem
|
||||
|
||||
Reference in New Issue
Block a user