Announcement

Collapse
No announcement yet.

Let's Build An Action Plugin Compiler Together

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AMSWaves
    replied
    Originally posted by RizlaUK View Post
    its not working, the function crashes the editor, are you sure its setting the structure correctly

    for the short term im going to make a quick dll but could these functions be built into the SCI plugin ?
    no there is no need dlls or anything this is worked i test it now on Win 7 and still worked for testing, test this code on my example and see result (im sure this is worked without any things):
    Code:
    t = SCI.GetTextRange(pointer, 20, -1)
    Dialog.Message("", t )
    Last edited by AMSWaves; 10-02-2009, 06:44 PM.

    Leave a comment:


  • RizlaUK
    replied
    its not working, the function crashes the editor, are you sure its setting the structure correctly

    for the short term im going to make a quick dll but could these functions be built into the SCI plugin ?

    Leave a comment:


  • RizlaUK
    replied
    nice work man, i'll work it in right now

    theres only a handful of functions that need structures, only the search and print functions will be needed now, the GetStyledTextRange only applies to custom lexers so theres really no need for it, but i guess for compleatness its worth having (we could still create a lexer in a container or make a c++, html, java or any editor in AMS now)

    Leave a comment:


  • AMSWaves
    replied
    this function for SCI_GETTEXTRANGE, as you know this want structure but still this possible just with Memory plugin :

    Code:
    function SCI.GetTextRange(sci_pointer, cpMin, cpMax)
    	local nlen = 0
    	if cpMax == -1 then
    		nlen = SCI_SendMessage(sci_pointer, SCI_GETLENGTH) + 1
    	else
    		nlen = (cpMax - cpMin) + 1
    	end
    	local mem = Memory.Allocate(12)
    	local Text = Memory.Allocate(nlen)
    	Memory.PutInt(mem, cpMin)
    	Memory.PutInt(mem+4, cpMax)
    	Memory.PutInt(mem+8, Text)
    	SCI_SendMessage(sci_pointer, SCI_GetTextRange, 0, mem)
    	local ret = Memory.GetString(Text, -1, "Ascii")
    	Memory.Free(mem)
    	Memory.Free(Text)
    	return ret
    end
    im going to create all message that have Structure.
    Last edited by AMSWaves; 10-02-2009, 04:02 PM.

    Leave a comment:


  • RizlaUK
    replied
    what errors ?, what line ?

    Leave a comment:


  • rexzooly
    replied
    Originally posted by RizlaUK View Post
    that include is wrong, i forgot something, use this one

    Code:
    --Cut copy and paste
    function SCI.Cut(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CUT,0,0)
    end
    function SCI.Copy(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_COPY,0,0)
    end
    function SCI.Paste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_PASTE,0,0)
    end
    function SCI.Clear(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CLEAR,0,0)
    end
    function SCI.CanPaste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CANPASTE,0,0)
    end
    I was getting a error on that one.

    Leave a comment:


  • RizlaUK
    replied
    that include is wrong, i forgot something, use this one

    Code:
    --Cut copy and paste
    function SCI.Cut(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CUT,0,0)
    end
    function SCI.Copy(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_COPY,0,0)
    end
    function SCI.Paste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_PASTE,0,0)
    end
    function SCI.Clear(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CLEAR,0,0)
    end
    function SCI.CanPaste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CANPASTE,0,0)
    end
    Last edited by RizlaUK; 02-16-2010, 06:01 AM.

    Leave a comment:


  • rexzooly
    replied
    Originally posted by RizlaUK View Post
    rex, look through the include i attached, its all in there

    Code:
    --Cut copy and paste
    function SCI_Cut(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CUT,0,0)
    end
    function SCI_Copy(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_COPY,0,0)
    end
    function SCI_Paste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_PASTE,0,0)
    end
    function SCI_Clear(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CLEAR,0,0)
    end
    function SCI_CanPaste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CANPASTE,0,0)
    end
    still out of it today sorry thanks :yes

    Leave a comment:


  • rexzooly
    replied
    Originally posted by RizlaUK View Post
    rex, are you kidding, iv been trying to get scintilla working in AMS for years, iv half built a lua editor in PB which is pretty nifty, building this in AMS, like wow, the things i can do ................
    I so agree its clean its mean and its something i love to use :yes i do think it was you that said about it before i wont ever protend to understand all this is
    working as this is something way new to me its not the same lol but it works
    and its great i did a editer that did not run code but showed it sometime back that changed to BBCode me then i lost the source i lost the will to do it again lol

    So i have to say YAY Scintilla is my friend

    Leave a comment:


  • RizlaUK
    replied
    rex, look through the include i attached, its all in there

    Code:
    --Cut copy and paste
    function SCI_Cut(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CUT,0,0)
    end
    function SCI_Copy(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_COPY,0,0)
    end
    function SCI_Paste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_PASTE,0,0)
    end
    function SCI_Clear(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CLEAR,0,0)
    end
    function SCI_CanPaste(Scintilla)
      return SCI_SendMessage(Scintilla,SCI_CANPASTE,0,0)
    end

    Leave a comment:


  • rexzooly
    replied
    That works great thanks AMSWaves, :yes

    How would i past code back in to it ? from a menu function like get all the code in there then update it with new code?

    if already then
    else
    end

    if new then
    else
    end

    Leave a comment:


  • RizlaUK
    replied
    rex, are you kidding, iv been trying to get scintilla working in AMS for years, iv half built a lua editor in PB which is pretty nifty, building this in AMS, like wow, the things i can do ................

    Leave a comment:


  • rexzooly
    replied
    Thanks for the great work i really do see a really good future for this i seen alot of talk about this and now its here its like wow :yes

    Leave a comment:


  • RizlaUK
    replied
    well, cool, i intend to build me a "state of the art" code editor with this, id be happy to build the compiler editor, or the xml/help system

    BTW, i made a wrapper of the SCI falgs to make using functions a little easier (search and replace on my PB include), if someone wants to write the xml file for this, then it will be fully integrated into AMS


    the few functions that are commented out require structures, and im unsure how to handle these in AMS, its not usally something that can be done ??

    AMSWaves, heres the functions i need to replicate in AMS, its only the text range structure stopping me

    Code:
    Procedure gettext(sci,startPos,EndPos,Buffer)
    	tr.TEXTRANGE
    	tr\chrg\cpMin=startPos
    	tr\chrg\cpMax=EndPos
    	tr\lpstrText=Buffer
    	ProcedureReturn SCI_GetTextRange(sci,tr)
    EndProcedure
    
    Procedure.s GetWordInPos(sci,Pos)
    	startPos=SCI_WordStartPosition(sci,Pos,#True)
    	EndPos  =SCI_WordEndPosition  (sci,Pos,#True)
    	len=EndPos-startPos
    	a$=Space(len+1)
    	gettext(sci,startPos,EndPos,@a$)
    	b$ = "1"
    	gettext(sci,startPos - 1,startPos,@b$)
    	If b$ = "."
    		startPos=SCI_WordStartPosition(sci,Pos-Len(a$)-1,#True)
    		EndPos  =SCI_WordEndPosition  (sci,Pos-Len(a$)-1,#True)
    		len=EndPos-startPos
    		c$=Space(len+1)
    		gettext(sci,startPos,EndPos,@c$)
    		a$ = c$ + "." + a$
    	EndIf
    	ProcedureReturn a$
    EndProcedure
    Last edited by RizlaUK; 02-16-2010, 06:02 AM.

    Leave a comment:


  • AMSWaves
    replied
    Originally posted by RizlaUK View Post
    hey, it works great. nice work man, well done, i'll finish the callback now, but i still need the textrange functuion, any chance of wrapppping it in the plugin

    something like:
    Code:
    SCI_GetTextRange(ScintillaID, StartPos, EndPos, *Buffer)
    now, plz, tell me how to draw the objects, how to refresh ?, maybe i can get my listicon working
    i believe everything is possible with memory plugin please post an examp on using SCI_GetTextRange message in any language to me show you power of memory plugin.

    Leave a comment:

Working...
X