BSpinner: do not redefine fValue
BSpinner had its own fValue defined instead of using the one from BControl. This results in the be:value in the message sent when the control is invoked to always be 0. Change-Id: I1cff5f30adbf5b1dede57a14377cd4e1db7a30d3 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7428 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -45,7 +45,6 @@ public:
|
|||||||
void Range(int32* min, int32* max);
|
void Range(int32* min, int32* max);
|
||||||
virtual void SetRange(int32 min, int32 max);
|
virtual void SetRange(int32 min, int32 max);
|
||||||
|
|
||||||
int32 Value() const { return fValue; };
|
|
||||||
virtual void SetValue(int32 value);
|
virtual void SetValue(int32 value);
|
||||||
virtual void SetValueFromText();
|
virtual void SetValueFromText();
|
||||||
|
|
||||||
@@ -77,10 +76,9 @@ private:
|
|||||||
|
|
||||||
int32 fMinValue;
|
int32 fMinValue;
|
||||||
int32 fMaxValue;
|
int32 fMaxValue;
|
||||||
int32 fValue;
|
|
||||||
|
|
||||||
// FBC padding
|
// FBC padding
|
||||||
uint32 _reserved[20];
|
uint32 _reserved[21];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,9 +105,6 @@ BSpinner::BSpinner(BMessage* data)
|
|||||||
|
|
||||||
if (data->FindInt32("_max", &fMaxValue) != B_OK)
|
if (data->FindInt32("_max", &fMaxValue) != B_OK)
|
||||||
fMaxValue = INT32_MAX;
|
fMaxValue = INT32_MAX;
|
||||||
|
|
||||||
if (data->FindInt32("_val", &fValue) != B_OK)
|
|
||||||
fValue = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -138,9 +135,6 @@ BSpinner::Archive(BMessage* data, bool deep) const
|
|||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = data->AddInt32("_max", fMaxValue);
|
status = data->AddInt32("_max", fMaxValue);
|
||||||
|
|
||||||
if (status == B_OK)
|
|
||||||
status = data->AddInt32("_val", fValue);
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +154,7 @@ BSpinner::GetSupportedSuites(BMessage* message)
|
|||||||
void
|
void
|
||||||
BSpinner::AttachedToWindow()
|
BSpinner::AttachedToWindow()
|
||||||
{
|
{
|
||||||
SetValue(fValue);
|
SetValue(Value());
|
||||||
|
|
||||||
BAbstractSpinner::AttachedToWindow();
|
BAbstractSpinner::AttachedToWindow();
|
||||||
}
|
}
|
||||||
@@ -243,10 +237,10 @@ BSpinner::SetValue(int32 value)
|
|||||||
SetIncrementEnabled(IsEnabled() && value < fMaxValue);
|
SetIncrementEnabled(IsEnabled() && value < fMaxValue);
|
||||||
SetDecrementEnabled(IsEnabled() && value > fMinValue);
|
SetDecrementEnabled(IsEnabled() && value > fMinValue);
|
||||||
|
|
||||||
if (value == fValue)
|
if (value == Value())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fValue = value;
|
BControl::SetValue(value);
|
||||||
ValueChanged();
|
ValueChanged();
|
||||||
|
|
||||||
Invoke();
|
Invoke();
|
||||||
@@ -269,7 +263,6 @@ BSpinner::_InitObject()
|
|||||||
{
|
{
|
||||||
fMinValue = INT32_MIN;
|
fMinValue = INT32_MIN;
|
||||||
fMaxValue = INT32_MAX;
|
fMaxValue = INT32_MAX;
|
||||||
fValue = 0;
|
|
||||||
|
|
||||||
TextView()->SetAlignment(B_ALIGN_RIGHT);
|
TextView()->SetAlignment(B_ALIGN_RIGHT);
|
||||||
for (uint32 c = 0; c <= 42; c++)
|
for (uint32 c = 0; c <= 42; c++)
|
||||||
|
|||||||
Reference in New Issue
Block a user