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

MaskBox: Fix cursor move when inserting a character in a filled mask pattern.

[GB.FORM]
* NEW: ButtonBox: Raise the Validate event.
* BUG: MaskBox: Fix cursor move when inserting a character in a filled mask pattern.

* BUG: MaskBox: Handle space separators correctly when setting the Text property.
parent caac660a
Pipeline #346791126 passed with stage
in 23 minutes and 31 seconds
......@@ -14,6 +14,7 @@ Event Change
Event Activate
Event Clear
Event Filter
Event Validate
Property Picture As Picture
Property Text As String
......@@ -211,6 +212,16 @@ Public Sub TextBox_Activate()
End
Public Sub TextBox_Validate()
Dim bStop As Boolean
bStop = Raise Validate
If bStop Then Stop Event
End
Public Sub TextBox_Change()
If $bFilter Then $hTimer.Start
......
......@@ -309,6 +309,14 @@ Private Sub IsFull(sText As String, iPos As Integer) As Boolean
End
Private Sub IsSeparator(iPos As Integer) As Boolean
If iPos < 0 Or If iPos >= $aMask.Count Then Return True
If Not $aMask[iPos] Then Return True
End
Private Sub IsVoid(sText As String, iPos As Integer) As Boolean
Dim iStart As Integer
......@@ -544,7 +552,7 @@ Public Sub TextBox_KeyPress()
iPos += iMove
If sInsert And If IsFull(sText, iPos - 1) Then
If sInsert And If IsFull(sText, iPos - 1) And If IsSeparator(iPos) Then
iPos = GetNextSeparator(iPos)
......
' Gambas class file
Public Sub _new()
Dim d As Date
d = Date(2021, 1, 1, 12, 45)
'DateBox1.Mode = DateChooser.DateTime
DateBox3.Value = d
'Message("DateBox1 should display the date " & d & " but does not")
DateBox2.Value = Date(Now)
DateBox2.SetFocus
End
......
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