added some useful icons and event actions for shipcall control

This commit is contained in:
Daniel Schick 2023-07-28 08:21:32 +02:00
parent 3148ed32b1
commit 9fb3e9e751
18 changed files with 293 additions and 85 deletions

View File

@ -1,7 +1,7 @@
//----------------------
// <auto-generated>
// Generated REST API Client Code Generator v1.7.17.0 on 26.07.2023 19:35:38
// Generated REST API Client Code Generator v1.7.17.0 on 28.07.2023 08:12:12
// Using the tool OpenAPI Generator v6.6.0
// </auto-generated>
//----------------------

View File

@ -8,12 +8,23 @@
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\arrow_down_red.png" />
<None Remove="Resources\arrow_right_blue.png" />
<None Remove="Resources\arrow_up_green.png" />
<None Remove="Resources\clipboard.png" />
<None Remove="Resources\clock.png" />
<None Remove="Resources\containership.png" />
<None Remove="Resources\emergency_stop_button.png" />
<None Remove="Resources\ship2.png" />
<None Remove="Resources\trafficlight_green.png" />
<None Remove="Resources\trafficlight_off.png" />
<None Remove="Resources\trafficlight_on.png" />
<None Remove="Resources\trafficlight_red.png" />
<None Remove="Resources\trafficlight_red_yellow.png" />
<None Remove="Resources\trafficlight_yellow.png" />
<None Remove="Resources\umbrella_closed.png" />
<None Remove="Resources\umbrella_open.png" />
<None Remove="Resources\worker2.png" />
</ItemGroup>
<ItemGroup>
@ -34,6 +45,14 @@
<Generator>OpenApiCodeGenerator</Generator>
<LastGenOutput>BreCalApi.cs</LastGenOutput>
</None>
<Resource Include="Resources\arrow_down_red.png" />
<Resource Include="Resources\arrow_right_blue.png" />
<Resource Include="Resources\arrow_up_green.png" />
<Resource Include="Resources\clipboard.png" />
<Resource Include="Resources\clock.png" />
<Resource Include="Resources\containership.png" />
<Resource Include="Resources\emergency_stop_button.png" />
<Resource Include="Resources\ship2.png" />
<Resource Include="Resources\StringResources.de.xaml">
<Generator>MSBuild:Compile</Generator>
</Resource>
@ -44,6 +63,9 @@
<Resource Include="Resources\trafficlight_red.png" />
<Resource Include="Resources\trafficlight_red_yellow.png" />
<Resource Include="Resources\trafficlight_yellow.png" />
<Resource Include="Resources\umbrella_closed.png" />
<Resource Include="Resources\umbrella_open.png" />
<Resource Include="Resources\worker2.png" />
</ItemGroup>
<ItemGroup>

View File

@ -156,6 +156,8 @@ namespace BreCalClient
ShipcallControl sc = new ShipcallControl();
sc.Height = 80;
sc.ShipcallControlModel = scm;
sc.TimesRequested += Sc_TimesRequested;
sc.EditRequested += Sc_EditRequested;
this.stackPanel.Children.Add(sc);
}));
}
@ -172,6 +174,18 @@ namespace BreCalClient
}
}
private void Sc_EditRequested(ShipcallControl obj)
{
// TODO: get the shipcall from the control and show the edit control
}
private void Sc_TimesRequested(ShipcallControl obj)
{
// TODO: get the shipcall, load and show a list of the times
}
#endregion

View File

@ -60,6 +60,86 @@ namespace BreCalClient.Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] arrow_down_red {
get {
object obj = ResourceManager.GetObject("arrow_down_red", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] arrow_right_blue {
get {
object obj = ResourceManager.GetObject("arrow_right_blue", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] arrow_up_green {
get {
object obj = ResourceManager.GetObject("arrow_up_green", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] clipboard {
get {
object obj = ResourceManager.GetObject("clipboard", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] clock {
get {
object obj = ResourceManager.GetObject("clock", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] containership {
get {
object obj = ResourceManager.GetObject("containership", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] emergency_stop_button {
get {
object obj = ResourceManager.GetObject("emergency_stop_button", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] ship2 {
get {
object obj = ResourceManager.GetObject("ship2", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
@ -119,5 +199,35 @@ namespace BreCalClient.Resources {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] umbrella_closed {
get {
object obj = ResourceManager.GetObject("umbrella_closed", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] umbrella_open {
get {
object obj = ResourceManager.GetObject("umbrella_open", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] worker2 {
get {
object obj = ResourceManager.GetObject("worker2", resourceCulture);
return ((byte[])(obj));
}
}
}
}

View File

@ -118,6 +118,30 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="arrow_down_red" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>arrow_down_red.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="arrow_right_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>arrow_right_blue.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="arrow_up_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>arrow_up_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="clipboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>clipboard.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="clock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>clock.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="containership" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>containership.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="emergency_stop_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>emergency_stop_button.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ship2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>ship2.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="trafficlight_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
@ -136,4 +160,13 @@
<data name="trafficlight_yellow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>trafficlight_yellow.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="umbrella_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>umbrella_closed.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="umbrella_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>umbrella_open.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="worker2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>worker2.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -7,84 +7,100 @@
xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="800" Loaded="UserControl_Loaded">
<Border Width="1" BorderBrush="Red" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="100">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height=".3*"/>
<RowDefinition Height=".3*"/>
<RowDefinition Height=".3*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".4*" />
<ColumnDefinition Width=".1*" />
<ColumnDefinition Width=".4*" />
<ColumnDefinition Width=".1*" />
</Grid.ColumnDefinitions>
<Viewbox Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
<TextBlock x:Name="textBlockShipname" Text="{Binding Ship.Name}" />
</Viewbox>
<Grid Grid.Row="2" Grid.Column="0">
<Border BorderBrush="LightGray" Margin="1" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height=".3*"/>
<RowDefinition Height=".3*"/>
<RowDefinition Height=".3*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*" />
<ColumnDefinition Width="0.4*" />
<ColumnDefinition Width=".2*" />
<ColumnDefinition Width=".3*" />
<ColumnDefinition Width=".4*" />
<ColumnDefinition Width=".1*" />
<ColumnDefinition Width=".4*" />
<ColumnDefinition Width=".1*" />
</Grid.ColumnDefinitions>
<Viewbox>
<TextBlock Text="IMO:"/>
<Viewbox Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Left">
<Border BorderThickness="1" BorderBrush="AliceBlue" >
<TextBlock x:Name="textBlockShipname" Text="{Binding Ship.Name}" Foreground="DarkBlue" />
</Border>
</Viewbox>
<Viewbox Grid.Column="1">
<TextBlock Text="{Binding Ship.Imo}" TextAlignment="Right"/>
<Grid Grid.Row="2" Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".2*" />
<ColumnDefinition Width=".3*" />
<ColumnDefinition Width=".2*" />
<ColumnDefinition Width=".3*" />
</Grid.ColumnDefinitions>
<Viewbox HorizontalAlignment="Left" Margin="4,0,0,0">
<TextBlock Text="IMO:"/>
</Viewbox>
<Viewbox Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0">
<TextBlock Text="{Binding Ship.Imo}" />
</Viewbox>
<Viewbox Grid.Column="2" HorizontalAlignment="Left">
<TextBlock Text="Callsign:" />
</Viewbox>
<Viewbox Grid.Column="3" HorizontalAlignment="Left" Margin="4,0,0,0">
<TextBlock Text="{Binding Ship.Callsign}" />
</Viewbox>
</Grid>
<Viewbox Grid.Column="1" Grid.Row="0">
<TextBlock Text="ETA:" />
</Viewbox>
<Viewbox Grid.Column="2">
<TextBlock Text="Callsign:" />
<Viewbox Grid.Column="2" Grid.Row="0" HorizontalAlignment="Left">
<TextBlock Text="{Binding Shipcall.Eta}" />
</Viewbox>
<Viewbox Grid.Column="3">
<TextBlock Text="{Binding Ship.Callsign}" />
<Viewbox Grid.Column="1" Grid.Row="1">
<TextBlock Text="ETD:" />
</Viewbox>
<Viewbox Grid.Column="2" Grid.Row="1" HorizontalAlignment="Left">
<TextBlock Text="{Binding Shipcall.Etd}" />
</Viewbox>
<Grid Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".5*" />
<ColumnDefinition Width=".5*" />
</Grid.ColumnDefinitions>
<Button x:Name="buttonListTimes" Click="buttonListTimes_Click" Grid.Column="0" Background="Transparent" ToolTip="List times" Margin="1" BorderThickness="0" HorizontalAlignment="Right">
<Image Source="./Resources/clock.png" />
</Button>
<Button x:Name="buttonEditShipcall" Click="buttonEditShipcall_Click" Grid.Column="1" Background="Transparent" ToolTip="Edit shipcall" Margin="1" BorderThickness="0" HorizontalAlignment="Left">
<Image Source="./Resources/clipboard.png" />
</Button>
</Grid>
<Viewbox Grid.Column="2" Grid.Row="3">
<TextBlock Text="" />
</Viewbox>
<Image Margin="2" Grid.Column="3" Grid.Row="0" Grid.RowSpan="3">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="{Binding NotFolderImage}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.OFF}">
<Setter Property="Source" Value="./Resources/trafficlight_off.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.RED}">
<Setter Property="Source" Value="./Resources/trafficlight_red.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.RED_YELLOW}">
<Setter Property="Source" Value="./Resources/trafficlight_red_yellow.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.GREEN}">
<Setter Property="Source" Value="./Resources/trafficlight_green.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.ALL}">
<Setter Property="Source" Value="./Resources/trafficlight_on.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.YELLOW}">
<Setter Property="Source" Value="./Resources/trafficlight_yellow.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
<Viewbox Grid.Column="1" Grid.Row="0">
<TextBlock Text="ETA:" />
</Viewbox>
<Viewbox Grid.Column="2" Grid.Row="0">
<TextBlock Text="{Binding Shipcall.Eta}" />
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="1">
<TextBlock Text="ETD:" />
</Viewbox>
<Viewbox Grid.Column="2" Grid.Row="1">
<TextBlock Text="{Binding Shipcall.Etd}" />
</Viewbox>
<Viewbox Grid.Column="2" Grid.Row="3">
<TextBlock Text="" />
</Viewbox>
<Image Margin="2" Grid.Column="3" Grid.Row="0" Grid.RowSpan="3">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="{Binding NotFolderImage}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.OFF}">
<Setter Property="Source" Value="./Resources/trafficlight_off.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.RED}">
<Setter Property="Source" Value="./Resources/trafficlight_red.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.RED_YELLOW}">
<Setter Property="Source" Value="./Resources/trafficlight_red_yellow.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.GREEN}">
<Setter Property="Source" Value="./Resources/trafficlight_green.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.ALL}">
<Setter Property="Source" Value="./Resources/trafficlight_on.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding LightMode}" Value="{x:Static db:ShipcallControlModel+TrafficLightMode.YELLOW}">
<Setter Property="Source" Value="./Resources/trafficlight_yellow.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
</Border>
</UserControl>

View File

@ -3,19 +3,8 @@
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BreCalClient
{
@ -34,6 +23,14 @@ namespace BreCalClient
#endregion
#region events
public event Action<ShipcallControl>? EditRequested;
public event Action<ShipcallControl>? TimesRequested;
#endregion
#region Properties
/// <summary>
@ -50,6 +47,22 @@ namespace BreCalClient
this.DataContext = this.ShipcallControlModel;
}
private void buttonListTimes_Click(object sender, RoutedEventArgs e)
{
if(this.TimesRequested != null)
{
this.TimesRequested(this);
}
}
private void buttonEditShipcall_Click(object sender, RoutedEventArgs e)
{
if (this.EditRequested != null)
{
this.EditRequested(this);
}
}
#endregion
}