Optics adjustment: Scrollbar width, text cutoff with ... and set textareas to readonly but enabled for better viewing
This commit is contained in:
parent
4766584512
commit
3569360600
@ -2,15 +2,18 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:BreCalClient"
|
xmlns:local="clr-namespace:BreCalClient"
|
||||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
StartupUri="MainWindow.xaml" Exit="Application_Exit" Startup="Application_Startup" >
|
StartupUri="MainWindow.xaml" Exit="Application_Exit" Startup="Application_Startup" >
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
|
|
||||||
<ResourceDictionary Source="Resources\StringResources.xaml"/>
|
<ResourceDictionary Source="Resources\StringResources.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
|
<sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">8</sys:Double>
|
||||||
|
<sys:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarHeightKey}">8</sys:Double>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@ -255,7 +255,7 @@ namespace BreCalClient
|
|||||||
this.datePickerETA_End.IsEnabled = _editing;
|
this.datePickerETA_End.IsEnabled = _editing;
|
||||||
this.comboBoxArrivalBerth.IsEnabled = _editing;
|
this.comboBoxArrivalBerth.IsEnabled = _editing;
|
||||||
this.comboBoxPierside.IsEnabled = _editing;
|
this.comboBoxPierside.IsEnabled = _editing;
|
||||||
this.textBoxBerthRemarks.IsEnabled = _editing;
|
this.textBoxBerthRemarks.IsReadOnly = !_editing;
|
||||||
this.doubleUpDownDraft.IsEnabled = _editing;
|
this.doubleUpDownDraft.IsEnabled = _editing;
|
||||||
this.datePickerTidalWindowFrom.IsEnabled = _editing;
|
this.datePickerTidalWindowFrom.IsEnabled = _editing;
|
||||||
this.datePickerTidalWindowTo.IsEnabled = _editing;
|
this.datePickerTidalWindowTo.IsEnabled = _editing;
|
||||||
@ -273,7 +273,7 @@ namespace BreCalClient
|
|||||||
this.checkBoxBunkering.IsEnabled = _editing;
|
this.checkBoxBunkering.IsEnabled = _editing;
|
||||||
this.checkBoxReplenishingTerminal.IsEnabled = _editing;
|
this.checkBoxReplenishingTerminal.IsEnabled = _editing;
|
||||||
this.checkBoxReplenishingLock.IsEnabled = _editing;
|
this.checkBoxReplenishingLock.IsEnabled = _editing;
|
||||||
this.textBoxRemarks.IsEnabled = _editing;
|
this.textBoxRemarks.IsReadOnly = !_editing;
|
||||||
|
|
||||||
CheckOKButton();
|
CheckOKButton();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -247,7 +247,7 @@ namespace BreCalClient
|
|||||||
this.datePickerETD_End.IsEnabled = _editing;
|
this.datePickerETD_End.IsEnabled = _editing;
|
||||||
this.comboBoxDepartureBerth.IsEnabled = _editing;
|
this.comboBoxDepartureBerth.IsEnabled = _editing;
|
||||||
this.comboBoxPierside.IsEnabled = _editing;
|
this.comboBoxPierside.IsEnabled = _editing;
|
||||||
this.textBoxBerthRemarks.IsEnabled = _editing;
|
this.textBoxBerthRemarks.IsReadOnly = !_editing;
|
||||||
this.doubleUpDownDraft.IsEnabled = _editing;
|
this.doubleUpDownDraft.IsEnabled = _editing;
|
||||||
this.datePickerTidalWindowFrom.IsEnabled = _editing;
|
this.datePickerTidalWindowFrom.IsEnabled = _editing;
|
||||||
this.datePickerTidalWindowTo.IsEnabled = _editing;
|
this.datePickerTidalWindowTo.IsEnabled = _editing;
|
||||||
@ -261,7 +261,7 @@ namespace BreCalClient
|
|||||||
this.checkBoxMooredLock.IsEnabled = _editing;
|
this.checkBoxMooredLock.IsEnabled = _editing;
|
||||||
this.comboBoxTerminal.IsEnabled = _editing;
|
this.comboBoxTerminal.IsEnabled = _editing;
|
||||||
this.checkBoxRainsensitiveCargo.IsEnabled = _editing;
|
this.checkBoxRainsensitiveCargo.IsEnabled = _editing;
|
||||||
this.textBoxRemarks.IsEnabled = _editing;
|
this.textBoxRemarks.IsReadOnly = !_editing;
|
||||||
|
|
||||||
CheckOKButton();
|
CheckOKButton();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -270,7 +270,7 @@ namespace BreCalClient
|
|||||||
this.datePickerETA.IsEnabled = _editing;
|
this.datePickerETA.IsEnabled = _editing;
|
||||||
this.comboBoxDepartureBerth.IsEnabled = _editing;
|
this.comboBoxDepartureBerth.IsEnabled = _editing;
|
||||||
this.comboBoxPiersideArrival.IsEnabled = _editing;
|
this.comboBoxPiersideArrival.IsEnabled = _editing;
|
||||||
this.textBoxBerthRemarksArrival.IsEnabled = _editing;
|
this.textBoxBerthRemarksArrival.IsReadOnly = !_editing;
|
||||||
this.checkBoxCanceled.IsEnabled = _editing;
|
this.checkBoxCanceled.IsEnabled = _editing;
|
||||||
|
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ namespace BreCalClient
|
|||||||
this.checkBoxMooredLock.IsEnabled = _editing;
|
this.checkBoxMooredLock.IsEnabled = _editing;
|
||||||
this.comboBoxTerminal.IsEnabled = _editing;
|
this.comboBoxTerminal.IsEnabled = _editing;
|
||||||
this.checkBoxRainsensitiveCargo.IsEnabled = _editing;
|
this.checkBoxRainsensitiveCargo.IsEnabled = _editing;
|
||||||
this.textBoxRemarks.IsEnabled = _editing;
|
this.textBoxRemarks.IsReadOnly = !_editing;
|
||||||
|
|
||||||
CheckOKButton();
|
CheckOKButton();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,7 +152,7 @@
|
|||||||
</xctk:DateTimePicker>
|
</xctk:DateTimePicker>
|
||||||
<!--CheckBox IsEnabled="False" Grid.Row="4" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxZoneEntryFixed" VerticalAlignment="Center" /-->
|
<!--CheckBox IsEnabled="False" Grid.Row="4" Grid.Column="2" Margin="4,0,0,0" Name="checkBoxZoneEntryFixed" VerticalAlignment="Center" /-->
|
||||||
|
|
||||||
<TextBox Grid.Row="7" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsEnabled="False" MaxLength="512"/>
|
<TextBox Grid.Row="7" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsReadOnly="True" MaxLength="512"/>
|
||||||
<StackPanel Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Button Width= "80" Margin="2" Content="{x:Static p:Resources.textOK}" x:Name="buttonOK" Click="buttonOK_Click" IsEnabled="False" />
|
<Button Width= "80" Margin="2" Content="{x:Static p:Resources.textOK}" x:Name="buttonOK" Click="buttonOK_Click" IsEnabled="False" />
|
||||||
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
|
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
|
||||||
|
|||||||
@ -159,7 +159,7 @@ namespace BreCalClient
|
|||||||
this.datePickerETABerth_End.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival);
|
this.datePickerETABerth_End.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival);
|
||||||
this.datePickerETDBerth.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Departure || ShipcallModel.Shipcall?.Type == ShipcallType.Shifting);
|
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.datePickerETDBerth_End.IsEnabled = (ShipcallModel.Shipcall?.Type == ShipcallType.Departure || ShipcallModel.Shipcall?.Type == ShipcallType.Shifting);
|
||||||
this.textBoxRemarks.IsEnabled = true;
|
this.textBoxRemarks.IsReadOnly = false;
|
||||||
|
|
||||||
switch (pType)
|
switch (pType)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -112,8 +112,8 @@
|
|||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</ComboBox.ContextMenu>
|
</ComboBox.ContextMenu>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Margin="2" Name="textBoxBerthRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsEnabled="False" MaxLength="512" />
|
<TextBox Grid.Row="4" Grid.Column="1" Margin="2" Name="textBoxBerthRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsReadOnly="True" MaxLength="512" />
|
||||||
<TextBox Grid.Row="5" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsEnabled="False" MaxLength="512" />
|
<TextBox Grid.Row="5" Grid.Column="1" Margin="2" Name="textBoxRemarks" TextWrapping="Wrap" AcceptsReturn="True" SpellCheck.IsEnabled="True" AcceptsTab="False" IsReadOnly="True" MaxLength="512" />
|
||||||
<StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Button Width= "80" Margin="2" Content="{x:Static p:Resources.textOK}" x:Name="buttonOK" Click="buttonOK_Click" IsEnabled="False"/>
|
<Button Width= "80" Margin="2" Content="{x:Static p:Resources.textOK}" x:Name="buttonOK" Click="buttonOK_Click" IsEnabled="False"/>
|
||||||
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
|
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
|
||||||
|
|||||||
@ -80,7 +80,12 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
if(string.IsNullOrEmpty(value)) return value;
|
if(string.IsNullOrEmpty(value)) return value;
|
||||||
if (value.Length <= maxLength) 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];
|
return value[..maxLength];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -323,8 +323,8 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
this.labelAgencyBerth.Content = this.ShipcallControlModel?.GetBerthText(agencyTimes);
|
this.labelAgencyBerth.Content = this.ShipcallControlModel?.GetBerthText(agencyTimes);
|
||||||
this.labelAgencyETAETDValue.Content = agencyTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
this.labelAgencyETAETDValue.Content = agencyTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
||||||
this.textBlockAgencyRemarks.Text = agencyTimes.Remarks;
|
this.textBlockAgencyRemarks.Text = agencyTimes.Remarks.TruncateDots(50);
|
||||||
this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo;
|
this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo.TruncateDots(50);
|
||||||
this.textBlockDraft.Text = ShipcallControlModel?.Shipcall?.Draft?.ToString("N2");
|
this.textBlockDraft.Text = ShipcallControlModel?.Shipcall?.Draft?.ToString("N2");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -343,7 +343,7 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
|
|
||||||
this.labelMooringETAETDValue.Content = mooringTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
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;
|
this.imageMooringLocked.Visibility = (mooringTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
|
||||||
if(mooringTimes.Ata.HasValue)
|
if(mooringTimes.Ata.HasValue)
|
||||||
@ -379,7 +379,7 @@ namespace BreCalClient
|
|||||||
if (portAuthorityTimes != null)
|
if (portAuthorityTimes != null)
|
||||||
{
|
{
|
||||||
this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
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;
|
this.imagePortAuthorityLocked.Visibility = (portAuthorityTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
|
||||||
if(portAuthorityTimes.LockTime.HasValue)
|
if(portAuthorityTimes.LockTime.HasValue)
|
||||||
{
|
{
|
||||||
@ -402,7 +402,7 @@ namespace BreCalClient
|
|||||||
if (pilotTimes != null)
|
if (pilotTimes != null)
|
||||||
{
|
{
|
||||||
this.labelPilotETAETDValue.Content = pilotTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
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;
|
this.imagePilotLocked.Visibility = (pilotTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -416,7 +416,7 @@ namespace BreCalClient
|
|||||||
if (tugTimes != null)
|
if (tugTimes != null)
|
||||||
{
|
{
|
||||||
this.labelTugETAETDValue.Content = tugTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
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;
|
this.imageTugLocked.Visibility = (tugTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -431,8 +431,8 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
this.labelTerminalBerth.Content = this.ShipcallControlModel?.GetBerthText(terminalTimes);
|
this.labelTerminalBerth.Content = this.ShipcallControlModel?.GetBerthText(terminalTimes);
|
||||||
this.labelOperationsStart.Content = terminalTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
this.labelOperationsStart.Content = terminalTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival);
|
||||||
this.textBlockTerminalRemarks.Text = terminalTimes.Remarks;
|
this.textBlockTerminalRemarks.Text = terminalTimes.Remarks.TruncateDots(40);
|
||||||
this.textBlockTerminalBerthRemarks.Text = terminalTimes.BerthInfo;
|
this.textBlockTerminalBerthRemarks.Text = terminalTimes.BerthInfo.TruncateDots(40);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user