Jump to content

Recommended Posts

Posted (edited)

is it possable to pull a backspace event?

also how do you set it so that if you use #include the angle brackets act like strings

and dose autocomplete have to be done through autoit. isn't their a way to load .api files

Edited by sycam0inc

All my projects live on github

  • 6 months later...
Posted

Know anyone how to use SCI_REGISTERIMAGE to register images for autocompletions? I tried to do it based on scintilla documentation but all I get is a white box.

  • 3 years later...
Posted (edited)
Func Sci_APPENDTEXT($Sci,$Text)
    $LineLenght=StringLen($Text)
    DllCall($user32, "long", "SendMessageA", "long", $Sci, "int", $SCI_APPENDTEXT, "int", $LineLenght, "str", $Text)
    If @error Then
        Return 0
    Else
        Return 1
    EndIf
EndFunc
Func Sci_AddLines($Sci, $Text,$Line)
    $Oldpos = Sci_GetCurrentLine($Sci)
    If @error Then
        Return 0
    EndIf
    $totalLine=Sci_GetLineCount($Sci)
    if $Line> $totalLine Then
        $MorLine=""
        For $i=$totalLine to $Line
        $MorLine&=@CRLF
        Next
        Sci_APPENDTEXT($Sci,$MorLine)
        If @error Then
            Return 0
        EndIf
    EndIf
    Sci_SetCurrentLine($Sci, $Line)
    If @error Then
        Return 0
    EndIf
    $LineLenght=StringLen($Text)
    ;$LineLenght = StringSplit($Text,"")
    If @error Then
        Return 0
    EndIf
    DllCall($user32, "long", "SendMessageA", "long", $Sci, "int", $SCI_ADDTEXT, "int", $LineLenght, "str", $Text)
    If @error Then
        Return 0
    EndIf
    Sci_SetCurrentLine($Sci, $Oldpos)
    If @error Then
        Return 0
    Else
        Return 1
    EndIf
EndFunc

Small improvements
Adding new lines below the existing maximum limit

Edited by odaylton
  • 1 year later...
Posted (edited)

Here is:     _SciLexer.zipFetching info...     my contribution to this UDF:

    Update History :
     == == == == == == == == == == == == == == == == == == == == == == == == == =
    2018/10/30
    v1.1 Refactoring - mLipok
     * Refactored: Function : almost all function are refactored - mLipok
     * Refactored: Function : all function use : Return SetError() - mLipok
     * Changed: Function : LoadLibrary() - set error when DLL File Not exist .... - mLipok
     * Renamed : "Scintilla.h.au3" > > "ScintillaConstants.au3" - mLipok
     * Added : "ScintillaConstants.au3" lexer Const $SCLEX_CMAKE = 80 > >>> $SCLEX_SAS = 125 - mLipok
     * Added : Const: "ScintillaConstants.au3" $SC_MARGIN_TEXT , $SC_MARGIN_RTEXT , $SC_MARGIN_COLOUR - mLipok
     * Added: Parameter to Function : Sci_SetCurrentLine($Sci, $iLine = -1) - $iLine = -1 >>> Go to LastLine - mLipok
     * Changed: Parameter default: $iLine = -1 : Sci_AddLines($Sci, $sText, $iLine = -1) >>> do not MoveCaret - mLipok
     * Added : new Function : Sci_SetReadOnly($Sci, $bReadOnly) - mLipok
     * Added : Few FunctionHeaders - mLipok
     * * * * * SCRIPT BREAKING CHANGE * * * * *
     * Renamed : Function : Sci_GetLineLenght > > Sci_GetLineLength - mLipok
     * Renamed : Function : Sci_GetLenght > > Sci_GetLength - mLipok
     == == == == == == == == == == == == == == == == == == == == == == == == == =

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Update  _SciLexer_v1.2.zipFetching info...

2018/11/02
    v1.2
    >>> _SciLexer.au3
     * Added: new Function: Sci_AppendText() - jmon / mLipok
     * Added: new Function: Sci_GetAccessibility() - mLipok
     * Added: new Function: Sci_SetAccessibility() - mLipok
     * Changed: All Function: better @error handling - mLipok
     * Changed: All Function: which was not returning specyfic value - now returns $Ret from SendMessage - mLipok

    >>> ScintillaConstants.au3
     * Changed: separation: - mLipok
     *      ScintillaConstants.au3 content based on Scintilla.h - mLipok
     *      SciLexerConstants.au3 content based on SciLexer.h - mLipok
     * Changed: compared to current version of Scintilla.h - mLipok

    >>> _SciLexerConstants.au3
     * Changed: compared to current version of SciLexer.h - mLipok

 

Edited by mLipok
quick/small fix in Sci_GetAccessibility()

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 3 weeks later...
Posted

It'd be easier to test the example if

Func GetSciLexerDll()
    If FileGetSize(@ScriptDir & "\SciLexer.dll") Then Return @ScriptDir & "\SciLexer.dll"
    Local $s = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\SciTE.exe", "")
    $s = StringLeft($s, StringInStr($s, "\", 0, -1))
    If FileGetSize($s & "SciLexer.dll") Then Return $s & "SciLexer.dll"
    Return "SciLexer.dll"
EndFunc

#Region - _SciLexer.au3 - EDITOR Window/Control initialization
Func CreateEditor($Hwnd, $X, $Y, $W, $H)
    Local $GWL_HINSTANCE = -6
    #forceref $GWL_HINSTANCE
    $hLib = LoadLibrary(GetSciLexerDll())
    If @error Then Return SetError(@error, @extended, $hLib)

:) 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • 5 months later...
Posted (edited)

My 2 cents, an easier way for  Sci_GetCurrentWord($Sci)
reference here

$onlyWordCharacters = 1  ; bool
$pos = Sci_GetCurrentPos($Sci)
$start = SendMessage($Sci, $SCI_WORDSTARTPOSITION, $pos, $onlyWordCharacters)
$end = SendMessage($Sci, $SCI_WORDENDPOSITION, $pos, $onlyWordCharacters)+1
$word = Sci_GetTextRange($Sci, $start, $end)

 

Edited by mikell

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...