From c723d4c018e2d8c3e1b3f4b8df5a7103dd572047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Mon, 1 Aug 2022 22:15:20 +0200 Subject: [PATCH] Support for write-only properties. [DEVELOPMENT ENVIRONMENT] * NEW: Support for write-only properties. --- .../gambas3/.src/Component/CDocumentation.class | 4 ++++ .../gambas3/.src/Component/CSymbolInfo.class | 6 ++++++ app/src/gambas3/.src/Editor/Code/FEditor.class | 14 ++++++++------ .../gambas3/.src/Project/FProjectProperty.form | 2 +- app/src/gambas3/img/symbol/property-rw.png | Bin 0 -> 225 bytes app/src/gambas3/img/symbol/s-property-rw.png | Bin 0 -> 225 bytes app/src/gambas3/img/symbol/symbol.png | Bin 210 -> 127 bytes app/src/gambas3/img/symbol/unknown.png | Bin 225 -> 140 bytes 8 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 app/src/gambas3/img/symbol/property-rw.png create mode 100644 app/src/gambas3/img/symbol/s-property-rw.png diff --git a/app/src/gambas3/.src/Component/CDocumentation.class b/app/src/gambas3/.src/Component/CDocumentation.class index d06e01645..7dfb7ee3d 100644 --- a/app/src/gambas3/.src/Component/CDocumentation.class +++ b/app/src/gambas3/.src/Component/CDocumentation.class @@ -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 diff --git a/app/src/gambas3/.src/Component/CSymbolInfo.class b/app/src/gambas3/.src/Component/CSymbolInfo.class index 8e6fe94f3..c2260e95a 100644 --- a/app/src/gambas3/.src/Component/CSymbolInfo.class +++ b/app/src/gambas3/.src/Component/CSymbolInfo.class @@ -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 ":" diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index e17d221be..d8576da28 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -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) diff --git a/app/src/gambas3/.src/Project/FProjectProperty.form b/app/src/gambas3/.src/Project/FProjectProperty.form index 7ae7ff32a..528b0b426 100644 --- a/app/src/gambas3/.src/Project/FProjectProperty.form +++ b/app/src/gambas3/.src/Project/FProjectProperty.form @@ -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 diff --git a/app/src/gambas3/img/symbol/property-rw.png b/app/src/gambas3/img/symbol/property-rw.png new file mode 100644 index 0000000000000000000000000000000000000000..b56605033e5d17577a0eba06e73ec5442ef4549c GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv&H|6fVg?4jBOuH;Rhv&5D5w?S z6XNP#;3E^dNx;zuVUCt>6EDvhmENAahEB{DK)cuN3_} zb5>q%(S^7yprE&>i(`n!`Q!wNBnOM5X9Z@SUuRkTYzdPJFVdQ I&MBb@08Us&g8%>k literal 0 HcmV?d00001 diff --git a/app/src/gambas3/img/symbol/symbol.png b/app/src/gambas3/img/symbol/symbol.png index a2dfde775519a596391d9c34bd5b17bf07a2b889..9feb33da07b2e0f8c5b1a1335c70d370b633763e 100644 GIT binary patch delta 89 zcmcb_SU*96laZN$fx&aji|rE?CEVBod_r8^3w#n168>*;?E}g%mIV0)GdMiEkp|=l rdAc};a9mGLP>{XxUva*ICy#k>sG_aaC~U`8>` zz$rANNksriwy7)tk}duW&fIMaC9XBeUTb*tMMcW=_(HKe40Z?QqpEhK1^`WD@O1Ta JS?83{1OP|yJy8Gv diff --git a/app/src/gambas3/img/symbol/unknown.png b/app/src/gambas3/img/symbol/unknown.png index 5b3aafff405247ca95727236f4af0eaa77aa56c6..0a68bc11129d74ec83136683ad39f386dce8050a 100644 GIT binary patch delta 103 zcmaFJ*uywMf|H4vfq{WfWK#M>MTua}0G|+7_X3~)|Nkc>B(#Ms`U{j~ED7=pW^j0R zBMr!r@pN$vk+__kut4!a)YdG<83!e$W;sZ+-QkjAWN?n<+nxJXtQe?{!PC{xWt~$( F69AMlAkY8+ delta 189 zcmeBSe8@OKf|G@rfq|hhB>nhAMTvT?0G|+7_X3~L(9i@_ker+x8yoxo|NomeZ%&>( z`PZ*s+qZ9D^}Q|?sGGAS$S;_I^XHYKvuEVx_H3^Z0SbC}x;TbtoKH@WNODl|xGFgF zeBRz?SDrDcFg~1ZoPN&KMd-skPL}8iEQ=hNPETMdabRlypvjq#anL~IaMXswQUP=3 gEqP{frAeBhK2ovj_Su`OfQB-7y85}Sb4q9e04nB90{{R3