diff --git a/src/BreCalClient/App.xaml b/src/BreCalClient/App.xaml
index 376a37a..9e781de 100644
--- a/src/BreCalClient/App.xaml
+++ b/src/BreCalClient/App.xaml
@@ -2,16 +2,19 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BreCalClient"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
StartupUri="MainWindow.xaml" Exit="Application_Exit" Startup="Application_Startup" >
-
-
+
+ 8
+ 8
+
-
+
diff --git a/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs
index 671fc4c..58cbac4 100644
--- a/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs
+++ b/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs
@@ -255,7 +255,7 @@ namespace BreCalClient
this.datePickerETA_End.IsEnabled = _editing;
this.comboBoxArrivalBerth.IsEnabled = _editing;
this.comboBoxPierside.IsEnabled = _editing;
- this.textBoxBerthRemarks.IsEnabled = _editing;
+ this.textBoxBerthRemarks.IsReadOnly = !_editing;
this.doubleUpDownDraft.IsEnabled = _editing;
this.datePickerTidalWindowFrom.IsEnabled = _editing;
this.datePickerTidalWindowTo.IsEnabled = _editing;
@@ -273,7 +273,7 @@ namespace BreCalClient
this.checkBoxBunkering.IsEnabled = _editing;
this.checkBoxReplenishingTerminal.IsEnabled = _editing;
this.checkBoxReplenishingLock.IsEnabled = _editing;
- this.textBoxRemarks.IsEnabled = _editing;
+ this.textBoxRemarks.IsReadOnly = !_editing;
CheckOKButton();
}
diff --git a/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs
index b444d5e..20c3c69 100644
--- a/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs
+++ b/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs
@@ -247,7 +247,7 @@ namespace BreCalClient
this.datePickerETD_End.IsEnabled = _editing;
this.comboBoxDepartureBerth.IsEnabled = _editing;
this.comboBoxPierside.IsEnabled = _editing;
- this.textBoxBerthRemarks.IsEnabled = _editing;
+ this.textBoxBerthRemarks.IsReadOnly = !_editing;
this.doubleUpDownDraft.IsEnabled = _editing;
this.datePickerTidalWindowFrom.IsEnabled = _editing;
this.datePickerTidalWindowTo.IsEnabled = _editing;
@@ -261,7 +261,7 @@ namespace BreCalClient
this.checkBoxMooredLock.IsEnabled = _editing;
this.comboBoxTerminal.IsEnabled = _editing;
this.checkBoxRainsensitiveCargo.IsEnabled = _editing;
- this.textBoxRemarks.IsEnabled = _editing;
+ this.textBoxRemarks.IsReadOnly = !_editing;
CheckOKButton();
}
diff --git a/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs
index 2f24a9f..5837881 100644
--- a/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs
+++ b/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs
@@ -270,7 +270,7 @@ namespace BreCalClient
this.datePickerETA.IsEnabled = _editing;
this.comboBoxDepartureBerth.IsEnabled = _editing;
this.comboBoxPiersideArrival.IsEnabled = _editing;
- this.textBoxBerthRemarksArrival.IsEnabled = _editing;
+ this.textBoxBerthRemarksArrival.IsReadOnly = !_editing;
this.checkBoxCanceled.IsEnabled = _editing;
@@ -281,7 +281,7 @@ namespace BreCalClient
this.checkBoxMooredLock.IsEnabled = _editing;
this.comboBoxTerminal.IsEnabled = _editing;
this.checkBoxRainsensitiveCargo.IsEnabled = _editing;
- this.textBoxRemarks.IsEnabled = _editing;
+ this.textBoxRemarks.IsReadOnly = !_editing;
CheckOKButton();
}
diff --git a/src/BreCalClient/EditTimesControl.xaml b/src/BreCalClient/EditTimesControl.xaml
index 394995c..465f90b 100644
--- a/src/BreCalClient/EditTimesControl.xaml
+++ b/src/BreCalClient/EditTimesControl.xaml
@@ -152,7 +152,7 @@
-
+
diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs
index bc679ab..b09a40e 100644
--- a/src/BreCalClient/EditTimesControl.xaml.cs
+++ b/src/BreCalClient/EditTimesControl.xaml.cs
@@ -159,7 +159,7 @@ namespace BreCalClient
this.datePickerETABerth_End.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival);
this.datePickerETDBerth.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Departure || ShipcallModel.Shipcall?.Type == ShipcallType.Shifting);
this.datePickerETDBerth_End.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Departure || ShipcallModel.Shipcall?.Type == ShipcallType.Shifting);
- this.textBoxRemarks.IsEnabled = true;
+ this.textBoxRemarks.IsReadOnly = false;
switch (pType)
{
diff --git a/src/BreCalClient/EditTimesTerminalControl.xaml b/src/BreCalClient/EditTimesTerminalControl.xaml
index 165cf6f..0854263 100644
--- a/src/BreCalClient/EditTimesTerminalControl.xaml
+++ b/src/BreCalClient/EditTimesTerminalControl.xaml
@@ -112,8 +112,8 @@
-
-
+
+
diff --git a/src/BreCalClient/Extensions.cs b/src/BreCalClient/Extensions.cs
index 22b6d3d..b57cbb4 100644
--- a/src/BreCalClient/Extensions.cs
+++ b/src/BreCalClient/Extensions.cs
@@ -80,7 +80,12 @@ namespace BreCalClient
{
if(string.IsNullOrEmpty(value)) return value;
if (value.Length <= maxLength) return value;
- if (value.Length > (maxLength + 1)) return $"{value[..maxLength]}..";
+ if (value.Length > (maxLength + 1))
+ {
+ int i = maxLength - 2;
+ for (; (i > 0) && !(char.IsWhiteSpace(value[i])); i--) ; // try to put the "..." at a word break
+ return value.Substring(0, i) + " ...";
+ }
return value[..maxLength];
}
diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs
index fd7c82c..42bbac0 100644
--- a/src/BreCalClient/ShipcallControl.xaml.cs
+++ b/src/BreCalClient/ShipcallControl.xaml.cs
@@ -323,8 +323,8 @@ namespace BreCalClient
{
this.labelAgencyBerth.Content = this.ShipcallControlModel?.GetBerthText(agencyTimes);
this.labelAgencyETAETDValue.Content = agencyTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
- this.textBlockAgencyRemarks.Text = agencyTimes.Remarks;
- this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo;
+ this.textBlockAgencyRemarks.Text = agencyTimes.Remarks.TruncateDots(50);
+ this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo.TruncateDots(50);
this.textBlockDraft.Text = ShipcallControlModel?.Shipcall?.Draft?.ToString("N2");
}
else
@@ -343,7 +343,7 @@ namespace BreCalClient
{
this.labelMooringETAETDValue.Content = mooringTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
- this.textBlockMooringRemarks.Text = mooringTimes.Remarks;
+ this.textBlockMooringRemarks.Text = mooringTimes.Remarks.TruncateDots(50);
this.imageMooringLocked.Visibility = (mooringTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
if(mooringTimes.Ata.HasValue)
@@ -379,7 +379,7 @@ namespace BreCalClient
if (portAuthorityTimes != null)
{
this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
- this.textBlockPortAuthorityRemarks.Text = portAuthorityTimes.Remarks;
+ this.textBlockPortAuthorityRemarks.Text = portAuthorityTimes.Remarks.TruncateDots(50);
this.imagePortAuthorityLocked.Visibility = (portAuthorityTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
if(portAuthorityTimes.LockTime.HasValue)
{
@@ -402,7 +402,7 @@ namespace BreCalClient
if (pilotTimes != null)
{
this.labelPilotETAETDValue.Content = pilotTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
- this.textBlockPilotRemarks.Text = pilotTimes.Remarks;
+ this.textBlockPilotRemarks.Text = pilotTimes.Remarks.TruncateDots(50);
this.imagePilotLocked.Visibility = (pilotTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
}
else
@@ -416,7 +416,7 @@ namespace BreCalClient
if (tugTimes != null)
{
this.labelTugETAETDValue.Content = tugTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
- this.textBlockTugRemarks.Text = tugTimes.Remarks;
+ this.textBlockTugRemarks.Text = tugTimes.Remarks.TruncateDots(50);
this.imageTugLocked.Visibility = (tugTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
}
else
@@ -431,8 +431,8 @@ namespace BreCalClient
{
this.labelTerminalBerth.Content = this.ShipcallControlModel?.GetBerthText(terminalTimes);
this.labelOperationsStart.Content = terminalTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
- this.textBlockTerminalRemarks.Text = terminalTimes.Remarks;
- this.textBlockTerminalBerthRemarks.Text = terminalTimes.BerthInfo;
+ this.textBlockTerminalRemarks.Text = terminalTimes.Remarks.TruncateDots(40);
+ this.textBlockTerminalBerthRemarks.Text = terminalTimes.BerthInfo.TruncateDots(40);
}
else
{