Controls: Add UnitTextBox
This commit is contained in:
@ -2,11 +2,12 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Elwig"
|
||||
xmlns:controls="clr-namespace:Elwig.Controls"
|
||||
xmlns:ctrl="clr-namespace:Elwig.Controls"
|
||||
StartupUri="Windows\MainWindow.xaml"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019">
|
||||
<Application.Resources>
|
||||
<controls:BoolToStringConverter x:Key="BoolToStarConverter" FalseValue="" TrueValue="*"/>
|
||||
<ctrl:BoolToStringConverter x:Key="BoolToStarConverter" FalseValue="" TrueValue="*"/>
|
||||
<ctrl:WidthToPaddingConverter x:Key="WidthToPaddingConverter"/>
|
||||
|
||||
<DataTemplate x:Key="PostalDestTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
@ -1,16 +1,17 @@
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Elwig.Controls {
|
||||
public class BoolToValueConverter<T> : IValueConverter {
|
||||
public T FalseValue { get; set; }
|
||||
public T TrueValue { get; set; }
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
|
||||
return (bool)value ? TrueValue : FalseValue;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
|
||||
return value?.Equals(TrueValue) ?? false;
|
||||
}
|
||||
}
|
||||
|
11
Elwig/Controls/UnitTextBox.xaml
Normal file
11
Elwig/Controls/UnitTextBox.xaml
Normal file
@ -0,0 +1,11 @@
|
||||
<UserControl x:Class="Elwig.Controls.UnitTextBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="25">
|
||||
<TextBox x:Name="TextBox" TextAlignment="Right" FontSize="14" VerticalAlignment="Stretch"
|
||||
Padding="{Binding ElementName=UnitBlock, Path=ActualWidth, Converter={StaticResource WidthToPaddingConverter}}"
|
||||
Text="{Binding Path=Text, Mode=TwoWay}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBlock x:Name="UnitBlock" Text="{Binding Path=Unit}" Margin="0,0,4,4" FontSize="10"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
|
||||
</Grid>
|
||||
</UserControl>
|
31
Elwig/Controls/UnitTextBox.xaml.cs
Normal file
31
Elwig/Controls/UnitTextBox.xaml.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Elwig.Controls {
|
||||
public partial class UnitTextBox : UserControl {
|
||||
|
||||
public event TextChangedEventHandler? TextChanged;
|
||||
|
||||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(UnitTextBox));
|
||||
public string Text {
|
||||
get => (string)GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UnitProperty = DependencyProperty.Register("Unit", typeof(string), typeof(UnitTextBox));
|
||||
public string Unit {
|
||||
get => (string)GetValue(UnitProperty);
|
||||
set => SetValue(UnitProperty, value);
|
||||
}
|
||||
|
||||
public UnitTextBox() {
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
if (TextChanged != null) TextChanged(sender, evt);
|
||||
}
|
||||
}
|
||||
}
|
16
Elwig/Controls/WidthToPaddingConverter.cs
Normal file
16
Elwig/Controls/WidthToPaddingConverter.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Elwig.Controls {
|
||||
public class WidthToPaddingConverter : IValueConverter {
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
|
||||
return new Thickness(2, 2, 4 + (double)value, 2);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
|
||||
return ((Thickness)value).Right - 4;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
using Elwig.Controls;
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Models;
|
||||
using System;
|
||||
@ -105,6 +106,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
protected void ValidateInput(Control input, bool valid) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
Valid[input] = valid;
|
||||
}
|
||||
|
||||
@ -205,6 +207,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
protected void SetOriginalValue(Control input, object? value) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
OriginalValues[input] = value is bool b ? b.ToString() : value;
|
||||
if (InputHasChanged(input)) {
|
||||
ControlUtils.SetInputChanged(input);
|
||||
@ -214,15 +217,18 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
protected void SetOriginalValue(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
SetOriginalValue(input, ControlUtils.GetInputValue(input));
|
||||
}
|
||||
|
||||
protected void UnsetOriginalValue(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
OriginalValues.Remove(input);
|
||||
ControlUtils.ClearInputState(input);
|
||||
}
|
||||
|
||||
protected void SetDefaultValue(Control input, object? value) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
DefaultValues[input] = value is bool b ? b.ToString() : value;
|
||||
if (!InputHasChanged(input)) {
|
||||
if (InputIsNotDefault(input)) {
|
||||
@ -234,10 +240,12 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
protected void SetDefaultValue(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
SetDefaultValue(input, ControlUtils.GetInputValue(input));
|
||||
}
|
||||
|
||||
protected void UnsetDefaultValue(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
DefaultValues.Remove(input);
|
||||
if (!InputHasChanged(input)) {
|
||||
ControlUtils.ClearInputState(input);
|
||||
@ -261,10 +269,12 @@ namespace Elwig.Windows {
|
||||
protected bool IsValid => Valid.All(kv => kv.Value);
|
||||
|
||||
protected bool GetInputValid(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
return Valid[input];
|
||||
}
|
||||
|
||||
protected bool InputHasChanged(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
if (!OriginalValues.ContainsKey(input)) {
|
||||
return false;
|
||||
} else if (input is TextBox tb) {
|
||||
@ -283,6 +293,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
protected bool InputIsNotDefault(Control input) {
|
||||
if (input is UnitTextBox utbx) input = utbx.TextBox;
|
||||
if (!DefaultValues.ContainsKey(input)) {
|
||||
return false;
|
||||
} else if (input is TextBox tb) {
|
||||
@ -458,15 +469,15 @@ namespace Elwig.Windows {
|
||||
UpdateComboBox((Control)sender);
|
||||
}
|
||||
|
||||
protected void IntegerInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void IntegerInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckInteger);
|
||||
}
|
||||
|
||||
protected void DecimalInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void DecimalInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckDecimal);
|
||||
}
|
||||
|
||||
protected void PartialDateInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void PartialDateInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckPartialDate);
|
||||
}
|
||||
|
||||
@ -474,7 +485,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckPartialDate);
|
||||
}
|
||||
|
||||
protected void DateInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void DateInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckDate);
|
||||
}
|
||||
|
||||
@ -482,7 +493,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckDate);
|
||||
}
|
||||
|
||||
protected void TimeInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void TimeInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckTime);
|
||||
}
|
||||
|
||||
@ -490,7 +501,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckTime);
|
||||
}
|
||||
|
||||
protected void PlzInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void PlzInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
var plz = (TextBox)sender;
|
||||
InputTextChanged(plz, Validator.CheckPlz);
|
||||
if ("PLZ".Equals(plz.Tag))
|
||||
@ -504,7 +515,7 @@ namespace Elwig.Windows {
|
||||
UpdatePlz(plz, GetPlzOrtInput(plz));
|
||||
}
|
||||
|
||||
protected void EmailAddressInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void EmailAddressInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckEmailAddress);
|
||||
}
|
||||
|
||||
@ -512,7 +523,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckEmailAddress);
|
||||
}
|
||||
|
||||
protected void PhoneNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void PhoneNrInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckPhoneNumber);
|
||||
}
|
||||
|
||||
@ -520,7 +531,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckPhoneNumber);
|
||||
}
|
||||
|
||||
protected void IbanInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void IbanInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckIban);
|
||||
}
|
||||
|
||||
@ -528,7 +539,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckIban);
|
||||
}
|
||||
|
||||
protected void BicInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void BicInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckBic);
|
||||
}
|
||||
|
||||
@ -536,7 +547,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckBic);
|
||||
}
|
||||
|
||||
protected void UstIdNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void UstIdNrInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckUstIdNr);
|
||||
}
|
||||
|
||||
@ -544,7 +555,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckUstIdNr);
|
||||
}
|
||||
|
||||
protected void LfbisNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void LfbisNrInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckLfbisNr);
|
||||
}
|
||||
|
||||
@ -552,7 +563,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckLfbisNr);
|
||||
}
|
||||
|
||||
protected void UpperCaseInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
protected void UpperCaseInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckUpperCase);
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Elwig.Windows"
|
||||
xmlns:ctrl="clr-namespace:Elwig.Controls"
|
||||
mc:Ignorable="d"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
Title="Flächenbindungen - Elwig" Height="480" Width="1100"
|
||||
@ -161,8 +162,8 @@
|
||||
TextChanged="GstNrInput_TextChanged" LostFocus="GstNrInput_LostFocus"/>
|
||||
|
||||
<Label Content="Fläche:" Margin="10,100,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="AreaInput" Margin="0,100,0,0" Width="100" Grid.Column="1" TextAlignment="Right" HorizontalAlignment="Left"
|
||||
TextChanged="IntegerInput_TextChanged"/>
|
||||
<ctrl:UnitTextBox x:Name="AreaInput" Unit="m²" TextChanged="IntegerInput_TextChanged"
|
||||
Grid.Column="1" Width="70" Margin="0,100,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
@ -25,7 +25,7 @@ namespace Elwig.Windows {
|
||||
};
|
||||
RequiredInputs = new Control[] {
|
||||
FbNrInput, YearFromInput, KgInput, RdInput,
|
||||
GstNrInput, AreaInput, AreaComTypeInput, WineCultivationInput
|
||||
GstNrInput, AreaInput.TextBox, AreaComTypeInput, WineCultivationInput
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ namespace Elwig.Windows {
|
||||
OechslePricePlot.Plot.Legend(false, Alignment.UpperRight);
|
||||
}
|
||||
|
||||
private void OechsleInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
private void OechsleInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
IntegerInput_TextChanged(sender, evt);
|
||||
|
||||
bool success = int.TryParse(OechsleInput.Text, out int oechsle);
|
||||
|
@ -4,6 +4,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Elwig.Windows"
|
||||
xmlns:ctrl="clr-namespace:Elwig.Controls"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
Title="Lieferungen - Elwig" Height="720" Width="1100" MinHeight="720" MinWidth="1000"
|
||||
Loaded="Window_Loaded">
|
||||
@ -285,17 +286,12 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Gradation:" Margin="10,10,10,10"/>
|
||||
<Grid Grid.Column="1" Width="54" Height="25" Margin="0,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<TextBox x:Name="GradationOeInput" TextAlignment="Right" Padding="2,2,23,2"
|
||||
TextChanged="GradationOeInput_TextChanged" LostFocus="GradationOeInput_LostFocus" KeyUp="Input_KeyUp"/>
|
||||
<Label Content="°Oe" Margin="0,4,3,0" HorizontalAlignment="Right" FontSize="10"/>
|
||||
</Grid>
|
||||
<ctrl:UnitTextBox x:Name="GradationOeInput" Unit="°Oe" TextChanged="GradationOeInput_TextChanged" KeyUp="Input_KeyUp"
|
||||
Grid.Column="1" Width="54" Margin="0,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
|
||||
<Label Content="=" Margin="60,10,10,10" Grid.Column="1"/>
|
||||
<Grid Grid.Column="1" Width="68" Height="25" Margin="78,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<TextBox x:Name="GradationKmwInput" TextAlignment="Right" Padding="2,2,34,2" SnapsToDevicePixels="True"
|
||||
TextChanged="GradationKmwInput_TextChanged" LostFocus="GradationKmwInput_LostFocus" KeyUp="Input_KeyUp"/>
|
||||
<Label Content="°KMW" Margin="0,4,3,0" HorizontalAlignment="Right" FontSize="10"/>
|
||||
</Grid>
|
||||
<ctrl:UnitTextBox x:Name="GradationKmwInput" Unit="°KMW" TextChanged="GradationKmwInput_TextChanged" KeyUp="Input_KeyUp"
|
||||
Grid.Column="1" Width="68" Margin="78,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
|
||||
<Label Content="Qualitätsstufe:" Margin="10,40,10,10"/>
|
||||
<ComboBox x:Name="WineQualityLevelInput" Width="146" Margin="0,40,10,10" Grid.Column="1" HorizontalAlignment="Left"
|
||||
@ -315,11 +311,8 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="Gewicht:" Margin="10,10,10,10"/>
|
||||
<Grid Grid.Column="1" Width="70" Height="25" Margin="0,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<TextBox x:Name="WeightInput" TextAlignment="Right" Padding="2,2,17,2" IsReadOnly="True"
|
||||
TextChanged="WeightInput_TextChanged"/>
|
||||
<Label Content="kg" Margin="0,4,3,0" HorizontalAlignment="Right" FontSize="10"/>
|
||||
</Grid>
|
||||
<ctrl:UnitTextBox x:Name="WeightInput" Unit="kg" TextChanged="WeightInput_TextChanged"
|
||||
Grid.Column="1" Width="70" Margin="0,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
|
||||
<CheckBox x:Name="ManualWeighingInput" Content="Handwiegung" IsEnabled="False"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,45,10,10" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
@ -365,18 +358,14 @@
|
||||
TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
<Label Content="Temperatur:" Margin="10,70,0,10"/>
|
||||
<Grid Grid.Column="1" Height="25" Margin="0,70,10,10" VerticalAlignment="Top">
|
||||
<TextBox x:Name="TemperatureInput" TextAlignment="Right" Padding="2,2,16,2"
|
||||
TextChanged="TemperatureAcidInput_TextChanged" LostFocus="TemperatureAcidInput_LostFocus"/>
|
||||
<Label Content="°C" Margin="0,4,3,0" HorizontalAlignment="Right" FontSize="10"/>
|
||||
</Grid>
|
||||
<ctrl:UnitTextBox x:Name="TemperatureInput" Unit="°C"
|
||||
TextChanged="TemperatureAcidInput_TextChanged" LostFocus="TemperatureAcidInput_LostFocus"
|
||||
Grid.Column="1" Margin="0,70,10,10" VerticalAlignment="Top"/>
|
||||
|
||||
<Label Content="Säure:" Margin="10,100,0,10"/>
|
||||
<Grid Grid.Column="1" Height="25" Margin="0,100,10,10" VerticalAlignment="Top">
|
||||
<TextBox x:Name="AcidInput" TextAlignment="Right" Padding="2,2,19,2"
|
||||
TextChanged="TemperatureAcidInput_TextChanged" LostFocus="TemperatureAcidInput_LostFocus"/>
|
||||
<Label Content="g/l" Margin="0,4,3,0" HorizontalAlignment="Right" FontSize="10"/>
|
||||
</Grid>
|
||||
<ctrl:UnitTextBox x:Name="AcidInput" Unit="g/l"
|
||||
TextChanged="TemperatureAcidInput_TextChanged" LostFocus="TemperatureAcidInput_LostFocus"
|
||||
Grid.Column="1" Margin="0,100,10,10" VerticalAlignment="Top"/>
|
||||
|
||||
<CheckBox x:Name="LesewagenInput" Content="Lesewagen" Margin="10,75,0,0" Grid.Column="2"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
|
@ -40,9 +40,9 @@ namespace Elwig.Windows {
|
||||
MgNrInput, MemberInput,
|
||||
LsNrInput, DateInput, BranchInput,
|
||||
SortIdInput, WineVarietyInput,
|
||||
GradationOeInput, GradationKmwInput, WineQualityLevelInput,
|
||||
GradationOeInput.TextBox, GradationKmwInput.TextBox, WineQualityLevelInput,
|
||||
WineOriginInput, WineKgInput,
|
||||
WeightInput
|
||||
WeightInput.TextBox
|
||||
};
|
||||
ExemptInputs = new Control[] {
|
||||
SearchInput, SeasonInput, TodayOnlyInput, AllSeasonsInput,
|
||||
@ -282,7 +282,7 @@ namespace Elwig.Windows {
|
||||
SortIdInput.SelectAll();
|
||||
} else if (ctrl == SortIdInput || ctrl == WineVarietyInput || ctrl == AttributeInput) {
|
||||
GradationOeInput.Focus();
|
||||
GradationOeInput.SelectAll();
|
||||
GradationOeInput.TextBox.SelectAll();
|
||||
} else if (ctrl == GradationKmwInput || ctrl == GradationOeInput || ctrl == WineQualityLevelInput) {
|
||||
if (WeighingAButton.IsVisible) WeighingAButton.Focus();
|
||||
else WeighingManualButton.Focus();
|
||||
@ -1367,7 +1367,7 @@ namespace Elwig.Windows {
|
||||
WineOriginInput.IsEnabled = false;
|
||||
if (WineKgInput.SelectedItem == null)
|
||||
WineRdInput.IsEnabled = false;
|
||||
WeightInput.IsReadOnly = true;
|
||||
WeightInput.TextBox.IsReadOnly = true;
|
||||
AbgewertetInput.IsEnabled = false;
|
||||
ManualWeighingInput.IsEnabled = false;
|
||||
LsNrInput.IsReadOnly = true;
|
||||
@ -1408,12 +1408,12 @@ namespace Elwig.Windows {
|
||||
}
|
||||
}
|
||||
|
||||
private async void DateInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
private new async void DateInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
base.DateInput_TextChanged(sender, evt);
|
||||
if (IsEditing || IsCreating) await UpdateLsNr();
|
||||
}
|
||||
|
||||
private async void BranchInput_SelectionChanged(object sender, RoutedEventArgs evt) {
|
||||
private async void BranchInput_SelectionChanged(object sender, SelectionChangedEventArgs evt) {
|
||||
base.ComboBox_SelectionChanged(sender, evt);
|
||||
if (IsEditing || IsCreating) {
|
||||
await UpdateLsNr();
|
||||
@ -1465,17 +1465,17 @@ namespace Elwig.Windows {
|
||||
|
||||
private void UpdateGradationKmw() {
|
||||
IsUpdatingGradation = true;
|
||||
var caret = GradationKmwInput.CaretIndex;
|
||||
var caret = GradationKmwInput.TextBox.CaretIndex;
|
||||
GradationKmwInput.Text = $"{Utils.OeToKmw(double.Parse(GradationOeInput.Text)):#.0}";
|
||||
GradationKmwInput.CaretIndex = caret;
|
||||
GradationKmwInput.TextBox.CaretIndex = caret;
|
||||
IsUpdatingGradation = false;
|
||||
}
|
||||
|
||||
private void UpdateGradationOe() {
|
||||
IsUpdatingGradation = true;
|
||||
var caret = GradationOeInput.CaretIndex;
|
||||
var caret = GradationOeInput.TextBox.CaretIndex;
|
||||
GradationOeInput.Text = $"{Utils.KmwToOe(double.Parse(GradationKmwInput.Text)):#}";
|
||||
GradationOeInput.CaretIndex = caret;
|
||||
GradationOeInput.TextBox.CaretIndex = caret;
|
||||
IsUpdatingGradation = false;
|
||||
}
|
||||
|
||||
|
@ -668,7 +668,7 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckPredecessorMgNr);
|
||||
}
|
||||
|
||||
private new void PhoneNrInput_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
private new void PhoneNrInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
base.PhoneNrInput_TextChanged(sender, evt);
|
||||
UpdatePhoneNrInputVisibility(IsEditing || IsCreating);
|
||||
}
|
||||
|
Reference in New Issue
Block a user