Commit 61f79d6e authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Don't crash when hitting Backspace at the beginning of the editable text.

[GB.FORM]
* BUG: MaskBox: Don't crash when hitting Backspace at the beginning of the editable text.
parent 53e39e8b
Pipeline #341553608 passed with stage
in 24 minutes and 2 seconds
......@@ -200,7 +200,12 @@ Private Sub UpdateMaskAndSeparator(sMask As String)
$sSeparator = sSeparator
$sAlign = sAlign
$sDefault = sDefault
$iPosFocus = iPosFocus
If iPosFocus < 0 Then
$iPosFocus = GetFirstCharacterPos()
Else
$iPosFocus = iPosFocus
Endif
'If $sMaskChar Then $sDefault = Replace($sDefault, "_", $sMaskChar)
End
......@@ -218,8 +223,6 @@ Private Sub Mask_Write(Value As String)
Clear()
Endif
Me.Pos = GetFirstCharacterPos()
End
' Private Sub IsMaskCharacter(sCar As String) As Boolean
......@@ -563,6 +566,11 @@ Public Sub TextBox_KeyPress()
iPos = GetLastCharacterPos(iPos)
If iPos < 0 Then
Stop Event
Return
Endif
Endif
If bDelete Then
......@@ -652,8 +660,8 @@ End
Public Sub TextBox_LostFocus()
If Not $sMaskOrg Then Return
$iPosFocus = Me.Pos
TextBox_Change
GotoCursor($iPosFocus)
End
......
......@@ -4,6 +4,6 @@
MoveScaled(0,0,64,64)
{ MaskBox1 MaskBox
MoveScaled(13,34,24,4)
Mask = "####0<!.0000"
Mask = "$#,###,##0<!.##"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment