Controls: Rewrite UnitTextBox as extension of TextBox instead of UserControl
This commit is contained in:
@ -63,9 +63,9 @@ namespace Elwig.Windows {
|
||||
MgNrInput, MemberInput,
|
||||
LsNrInput, DateInput, BranchInput,
|
||||
SortIdInput, WineVarietyInput,
|
||||
GradationOeInput.TextBox, GradationKmwInput.TextBox, WineQualityLevelInput,
|
||||
GradationOeInput, GradationKmwInput, WineQualityLevelInput,
|
||||
WineOriginInput, WineKgInput,
|
||||
WeightInput.TextBox
|
||||
WeightInput
|
||||
];
|
||||
ExemptInputs = [
|
||||
SearchInput, SeasonInput, TodayOnlyInput, AllSeasonsInput,
|
||||
@ -529,7 +529,7 @@ namespace Elwig.Windows {
|
||||
SortIdInput.SelectAll();
|
||||
} else if (ctrl == SortIdInput || ctrl == WineVarietyInput || ctrl == AttributeInput || ctrl == CultivationInput) {
|
||||
GradationOeInput.Focus();
|
||||
GradationOeInput.TextBox.SelectAll();
|
||||
GradationOeInput.SelectAll();
|
||||
} else if (ctrl == GradationKmwInput || ctrl == GradationOeInput || ctrl == WineQualityLevelInput) {
|
||||
if (WeighingAButton.IsVisible) WeighingAButton.Focus();
|
||||
else WeighingManualButton.Focus();
|
||||
@ -1894,7 +1894,7 @@ namespace Elwig.Windows {
|
||||
WineOriginInput.IsEnabled = false;
|
||||
if (WineKgInput.SelectedItem == null)
|
||||
WineRdInput.IsEnabled = false;
|
||||
WeightInput.TextBox.IsReadOnly = true;
|
||||
WeightInput.IsReadOnly = true;
|
||||
AbgewertetInput.IsEnabled = false;
|
||||
ManualWeighingInput.IsEnabled = false;
|
||||
LsNrInput.IsReadOnly = true;
|
||||
@ -1996,17 +1996,17 @@ namespace Elwig.Windows {
|
||||
|
||||
private void UpdateGradationKmw() {
|
||||
IsUpdatingGradation = true;
|
||||
var caret = GradationKmwInput.TextBox.CaretIndex;
|
||||
var caret = GradationKmwInput.CaretIndex;
|
||||
GradationKmwInput.Text = $"{Utils.OeToKmw(double.Parse(GradationOeInput.Text)):#.0}";
|
||||
GradationKmwInput.TextBox.CaretIndex = caret;
|
||||
GradationKmwInput.CaretIndex = caret;
|
||||
IsUpdatingGradation = false;
|
||||
}
|
||||
|
||||
private void UpdateGradationOe() {
|
||||
IsUpdatingGradation = true;
|
||||
var caret = GradationOeInput.TextBox.CaretIndex;
|
||||
var caret = GradationOeInput.CaretIndex;
|
||||
GradationOeInput.Text = $"{Utils.KmwToOe(double.Parse(GradationKmwInput.Text)):#}";
|
||||
GradationOeInput.TextBox.CaretIndex = caret;
|
||||
GradationOeInput.CaretIndex = caret;
|
||||
IsUpdatingGradation = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user