Controls: Add UnitTextBox
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user