SpinBox: The Change event is correctly raised when the value is changed by typing it.

[GB.GUI.BASE]
* BUG: SpinBox: The Change event is correctly raised when the value is changed by typing it.
This commit is contained in:
gambas 2018-09-06 13:02:48 +02:00
parent 1b2ad271ae
commit fc00dcbad2
4 changed files with 15 additions and 7 deletions

View file

@ -1,6 +1,6 @@
# Gambas Project File 3.0
Title=Common controls and classes for GUI components
Startup=FScrollArea
Startup=FTestCombo
Version=3.11.90
VersionFile=1
Component=gb.image

View file

@ -179,10 +179,10 @@ Private Sub SetValue(iValue As Integer, Optional bFocus As Boolean)
Else If iValue > $iMax Then
iValue = If($bWrap, $iMin, $iMax)
Endif
$iValue = iValue
sValue = CStr($iValue)
If $hTextBox.Text <> sValue Then
$hTextBox.Text = sValue
sValue = CStr(iValue)
If $hTextBox.Text <> sValue Then $hTextBox.Text = sValue
If $iValue <> iValue Then
$iValue = iValue
Raise Change
Endif
@ -358,7 +358,9 @@ Public Sub TextBox_KeyPress()
SetValue($iMax, True)
Stop Event
Else If Key.Text Then
If IsDigit(Key.Text) Or If Key.Text = "-" Then
If IsDigit(Key.Text) Then
Else If Key.Text = "-" Then
If $iMin >= 0 Then Stop Event
Else If Len(Key.Text) >= 2 Or Asc(Key.Text) >= 32 Then
Stop Event
Endif

View file

@ -28,3 +28,9 @@ Public Sub Button2_Click()
Debug ComboBox2.W
End
Public Sub SpinBox1_Change()
Debug SpinBox1.Value
End

View file

@ -44,7 +44,7 @@
Text = ("bxvcbxcbc")
}
{ SpinBox1 SpinBox
MoveScaled(2,3,9,4)
MoveScaled(44,3,9,4)
Font = Font["Italic"]
Step = 4
}