diff --git a/comp/src/gb.gui.base/.project b/comp/src/gb.gui.base/.project index d3ef5137e..f555863f5 100644 --- a/comp/src/gb.gui.base/.project +++ b/comp/src/gb.gui.base/.project @@ -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 diff --git a/comp/src/gb.gui.base/.src/SpinBox.class b/comp/src/gb.gui.base/.src/SpinBox.class index bf39cd040..615e81371 100644 --- a/comp/src/gb.gui.base/.src/SpinBox.class +++ b/comp/src/gb.gui.base/.src/SpinBox.class @@ -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 diff --git a/comp/src/gb.gui.base/.src/Test/FTestCombo.class b/comp/src/gb.gui.base/.src/Test/FTestCombo.class index 979709ae5..fde1d864c 100644 --- a/comp/src/gb.gui.base/.src/Test/FTestCombo.class +++ b/comp/src/gb.gui.base/.src/Test/FTestCombo.class @@ -28,3 +28,9 @@ Public Sub Button2_Click() Debug ComboBox2.W End + +Public Sub SpinBox1_Change() + + Debug SpinBox1.Value + +End diff --git a/comp/src/gb.gui.base/.src/Test/FTestCombo.form b/comp/src/gb.gui.base/.src/Test/FTestCombo.form index 22bb50333..6daa66813 100644 --- a/comp/src/gb.gui.base/.src/Test/FTestCombo.form +++ b/comp/src/gb.gui.base/.src/Test/FTestCombo.form @@ -44,7 +44,7 @@ Text = ("bxvcbxcbc") } { SpinBox1 SpinBox - MoveScaled(2,3,9,4) + MoveScaled(44,3,9,4) Font = Font["Italic"] Step = 4 }