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

ListEditor: Fix crash when checking for duplicates if the Unique property is TRUE.

[GB.FORM]
* BUG: ListEditor: Fix crash when checking for duplicates if the Unique property is TRUE.
parent 792c7bec
Pipeline #334111633 passed with stage
in 23 minutes and 52 seconds
# Gambas Project File 3.0
Title=More controls for graphical components
Startup=FTestValueBox
Startup=FTestMaskBox
Icon=.hidden/icon.png
Version=3.16.90
VersionFile=1
......@@ -10,7 +10,7 @@ Component=gb.form
Component=gb.settings
Component=gb.form.stock
Authors="Benoît Minisini"
Environment="GB_GUI=gb.qt5\n GB_STOCK_DEBUG=1\n LANG=zh_CN.UTF-8\n LC_ALL=en_US.UTF-8\n LC_ALL=zh_CN.UTF-8\n GTK_DEBUG=interactive"
Environment="GB_GUI=gb.gtk3\n GB_STOCK_DEBUG=1\n LANG=zh_CN.UTF-8\n LC_ALL=en_US.UTF-8\n LC_ALL=zh_CN.UTF-8\n GTK_DEBUG=interactive"
TabSize=2
Translate=1
Language=en
......
......@@ -298,7 +298,7 @@ Private Sub CheckUnique()
I = 1
While I < lstData.Count
iPos = lstData.Find(lstData[I])
iPos = lstData.Find(lstData[I].Text)
If iPos <> I Then
lstData.Remove(I)
Else
......
......@@ -18,7 +18,7 @@ Property Read Editor As Control
'' Return or set if duplicates are allowed in the list.
''
'' By default, this property is 'FALSE' and duplicate are allowed.
'' By default, this property is 'FALSE' and duplicates are allowed.
Property Unique As Boolean
'' Return or set the index of the current item.
......
......@@ -6,3 +6,9 @@ Public Sub ListEditor1_Select()
Debug
End
Public Sub Form_Open()
ListEditor1.Index = 20
End
......@@ -4,6 +4,7 @@
MoveScaled(0,0,64,64)
{ ListEditor1 ListEditor
MoveScaled(5,6,48,34)
List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("Élément 5")]
Unique = True
}
}
......@@ -13,28 +13,28 @@ Public Sub Button1_Click()
End
Public Sub MaskBox1_Validate()
Dim aAdr As String[]
Dim I As Integer
Dim sAdr As String
Dim iAdr As Integer
Dim bValid As Boolean
aAdr = Split(Last.Text, ".")
If aAdr.Count = 4 Then
For I = 0 To aAdr.Max
bValid = False
sAdr = Trim(aAdr[I])
If sAdr Then
Try iAdr = CInt(sAdr)
If Error Then Break
If iAdr < 0 Or If iAdr > 255 Then Break
Endif
bValid = True
Next
Endif
If Not bValid Then Stop Event
End
' Public Sub MaskBox1_Validate()
'
' Dim aAdr As String[]
' Dim I As Integer
' Dim sAdr As String
' Dim iAdr As Integer
' Dim bValid As Boolean
'
' aAdr = Split(Last.Text, ".")
' If aAdr.Count = 4 Then
' For I = 0 To aAdr.Max
' bValid = False
' sAdr = Trim(aAdr[I])
' If sAdr Then
' Try iAdr = CInt(sAdr)
' If Error Then Break
' If iAdr < 0 Or If iAdr > 255 Then Break
' Endif
' bValid = True
' Next
' Endif
'
' If Not bValid Then Stop Event
'
' End
......@@ -8,7 +8,6 @@
}
{ MaskBox1 MaskBox
MoveScaled(13,34,24,4)
Mask = "###<.###<.###<.###<"
Prompt = MaskBox.Bracket
Mask = "####0<!.0000"
}
}
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