If you use the PROPERTY ... USE syntax, you have to use the SHIFT key with the ENTER key to automatically insert property handlers.

[DEVELOPMENT ENVIRONMENT]
* NEW: If you use the PROPERTY ... USE syntax, you have to use the SHIFT key with the ENTER key to automatically insert property handlers.
This commit is contained in:
gambas 2019-12-23 11:37:36 +01:00
parent ccac0d27b4
commit 5c69af0777

View file

@ -548,7 +548,7 @@ Public Sub mnuClose_Click()
End End
Private Sub InsertProperty() Private Sub InsertProperty(bShift As Boolean)
Dim iPos As Integer Dim iPos As Integer
Dim bStatic As Boolean Dim bStatic As Boolean
@ -558,28 +558,31 @@ Private Sub InsertProperty()
Dim sType As String Dim sType As String
Dim iLine As Integer Dim iLine As Integer
Dim iCol As Integer Dim iCol As Integer
Dim aSymbols As String[]
If Highlight.Symbols[0] = "STATIC" Then aSymbols = Highlight.Symbols
If aSymbols[0] = "STATIC" Then
bStatic = True bStatic = True
iPos = 2 iPos = 2
Else Else
iPos = 1 iPos = 1
Endif Endif
If Highlight.Symbols[iPos] = "READ" Then If aSymbols[iPos] = "READ" Then
bRead = True bRead = True
Inc iPos Inc iPos
Endif Endif
ANOTHER_SYMBOL: ANOTHER_SYMBOL:
sName = Highlight.Symbols[iPos] sName = aSymbols[iPos]
If sName = "{" Then If sName = "{" Then
Inc iPos Inc iPos
If Highlight.Types[iPos] <> Highlight.Symbol Then Return If Highlight.Types[iPos] <> Highlight.Symbol Then Return
sName = Highlight.Symbols[iPos] sName = aSymbols[iPos]
Inc iPos Inc iPos
If Highlight.Symbols[iPos] <> "}" Then Return If aSymbols[iPos] <> "}" Then Return
Else Else
If Highlight.Types[iPos] <> Highlight.Symbol Then Return If Highlight.Types[iPos] <> Highlight.Symbol Then Return
Endif Endif
@ -587,23 +590,27 @@ ANOTHER_SYMBOL:
Inc iPos Inc iPos
If Highlight.Symbols[iPos] = "," Then If aSymbols[iPos] = "," Then
Inc iPos Inc iPos
Goto ANOTHER_SYMBOL Goto ANOTHER_SYMBOL
Endif Endif
sName = sName2 sName = sName2
If Highlight.Symbols[iPos] <> "AS" Then Return If aSymbols[iPos] <> "AS" Then Return
Inc iPos Inc iPos
sType = Highlight.Symbols[iPos] sType = aSymbols[iPos]
If Highlight.Types[iPos] <> Highlight.DataType Then Return If Highlight.Types[iPos] <> Highlight.DataType Then Return
Inc iPos Inc iPos
If Highlight.Symbols.Max >= iPos Then If aSymbols.Max >= iPos Then
If Highlight.Symbols[iPos] = "[" Then If aSymbols[iPos] = "[" Then
sType &= "[]" sType &= "[]"
Endif Endif
Endif Endif
If aSymbols[aSymbols.Max - 1] = "USE" Then
If Not bShift Then Return
Endif
iLine = $hEditor.Line iLine = $hEditor.Line
iCol = $hEditor.Column iCol = $hEditor.Column
@ -903,7 +910,7 @@ Public Sub Editors_KeyPress()
If aSymbol.Count >= 4 Then If aSymbol.Count >= 4 Then
If aSymbol[0] = "PROPERTY" Or If aSymbol[0] = "STATIC" And aSymbol[1] = "PROPERTY" Then If aSymbol[0] = "PROPERTY" Or If aSymbol[0] = "STATIC" And aSymbol[1] = "PROPERTY" Then
InsertProperty InsertProperty(Key.Shift)
'$hEditor.Insert("\n") '$hEditor.Insert("\n")
'Stop Event 'Stop Event
Return Return