[Gambas-user] customising my gambas TextEditorMode

Bruce Steers bsteers4 at gmail.com
Tue Dec 1 16:08:16 CET 2020


Never mind i found it :)
If anyone else finds this post looking to do the same type of mod I did
this.

In app/src/gambas3/.src/Editor/Code/FEditor.class
I changed the *InsertFunction*() parameters on lines 619 and 621, added an
additional optional field..
*InsertFunction(sName & "_Read", sType, False, "", bStatic, "Return $" &
sName)*
and
* InsertFunction(sName & "_Write", "", False, "Value As " & sType, bStatic,
"$" & sName & " = Value")*

The last parameters are new " *Optional sInsertString As String*"

The write commands in *InsertFunction*() at line 514 now look like this..




* If sType Then    $hEditor.Insert("\n" & sStatic & sPublic & " Function "
& sProc & "(" & sSign & ") As " & sType & "\n\n" & Space$(Project.TabSize)
& IIf(sInsertString, sInsertString, "") & "\n\nEnd\n")  Else
$hEditor.Insert("\n" & sStatic & sPublic & " Sub " & sProc & "(" & sSign &
")\n\n" & Space$(Project.TabSize) & IIf(sInsertString, sInsertString, "") &
"\n\nEnd\n")  Endif*

Got my gambas doing this now...
http://bws.org.uk/images/screenrecord-2020-12-01_14.54.36.mp4

Loving it, that'll save me some typing :)
BruceS



On Fri, 27 Nov 2020 at 19:40, Bruce Steers <bsteers4 at gmail.com> wrote:

> Hi
> I'm trying to customise my gambas a bit. but i cannot find the code (not
> for a lack of looking)
>
> What i want to do is alter the auto-fill when i type a property.
> If i type for example ..
> *Property Runable As Boolean*  (then hit return)
> I get automatically written at the bottom of my file
>
>
>
>
>
>
>
> *Private Function Runable_Read() As Boolean  EndPrivate Sub
> Runable_Write(Value As Boolean)End*
> ---
> That's awesome but i want it to add something more like this ...
> *Private $Runable As Boolean  *(this added just below the property
> declaration)
>
>
>
>
>
>
> *Private Function Runable_Read() As BooleanReturn $RunableEndPrivate Sub
> Runable_Write(Value As Boolean)*
>
> *$Runable = Value  *
> *End*
>
> Have been through the highlight and mode and editor code but not seeing
> where it happens to modify it, ?
>
> tia
> all the best
> BruceS
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201201/7c19c32e/attachment.htm>


More information about the User mailing list