Support for write-only properties.

[DEVELOPMENT ENVIRONMENT]
* NEW: Support for write-only properties.
This commit is contained in:
Benoît Minisini 2022-08-01 22:15:20 +02:00
parent 600a4d961d
commit c723d4c018
8 changed files with 19 additions and 7 deletions

View file

@ -670,6 +670,10 @@ Private Sub ScanClass(hModule As Object, cSymbol As Collection, bModule As Boole
If sKind = "p" Then sKind = "r"
Inc iInd
Break
Case "WRITE"
If sKind = "p" Then sKind = "w"
Inc iInd
Break
Case "EVENT"
sKind = ":"
bStatic = False

View file

@ -152,6 +152,8 @@ Public Function GetIcon() As String
Case "r"
sIcon = If(bStatic, "s-property-ro", "property-ro")
Case "w"
sIcon = If(bStatic, "s-property-rw", "property-rw")
Case "p"
sIcon = If(bStatic, "s-property", "property")
Case "v"
@ -633,6 +635,8 @@ Public Function GetDescription(Optional bBalise As Boolean) As String
Case "r"
sDesc = sStatic & "Property Read"
Case "w"
sDesc = sStatic & "Property Write"
Case "p"
sDesc = sStatic & "Property"
'CASE "v"
@ -1439,6 +1443,8 @@ Public Sub WikiGetSyntax() As String[]
sSyntax = sSyntax & Keyword("Property") & " "
Case "r"
sSyntax = sSyntax & Keyword("Property Read") & " "
Case "w"
sSyntax = sSyntax & Keyword("Property Write") & " "
Case "c"
sSyntax = sSyntax & Keyword("Const") & " "
Case ":"

View file

@ -639,19 +639,23 @@ Private Sub InsertProperty(bShift As Boolean)
Dim iLine As Integer
Dim iCol As Integer
Dim aSymbols As String[]
Dim bWrite As Boolean
aSymbols = Highlight.Symbols
If aSymbols[0] = "STATIC" Then
If aSymbols[0] == "STATIC" Then
bStatic = True
iPos = 2
Else
iPos = 1
Endif
If aSymbols[iPos] = "READ" Then
If aSymbols[iPos] == "READ" Then
bRead = True
Inc iPos
Else If aSymbols[iPos] == "WRITE" Then
bWrite = True
Inc iPos
Endif
ANOTHER_SYMBOL:
@ -696,10 +700,8 @@ ANOTHER_SYMBOL:
iCol = $hEditor.Column
$hEditor.Begin
InsertFunction(sName & "_Read", sType, False, "", bStatic)
If Not bRead Then
InsertFunction(sName & "_Write", "", False, "Value As " & sType, bStatic)
Endif
If Not bWrite Then InsertFunction(sName & "_Read", sType, False, "", bStatic)
If Not bRead Then InsertFunction(sName & "_Write", "", False, "Value As " & sType, bStatic)
$hEditor.End
$hEditor.Goto(iCol, iLine)

View file

@ -677,7 +677,7 @@
{ cmbForceBytecodeVersion ComboBox
MoveScaled(61,0,14,4)
#Translate = False
List = ["", "3.8", "3.15"]
List = ["", "3.8", "3.15", "3.18"]
}
}
{ Label19 Label

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 140 B