Tool Questions:

Working on new editor enhancements?
User avatar
skywalk
Addict
Addict
Posts: 4218
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Tool Questions:

Post by skywalk »

Hi,
I am attempting to automate some menial tasks in my code.

Can I move the cursor location in the IDE with a Tool?
And can it move to another File if it is loaded in the IDE?

I know I can query the cursor (Line x Column), but can I change it?


Apologize if this has been asked, just haven't found a lot of documentation on the Tool creation process.
Last edited by skywalk on Tue Jul 08, 2014 12:25 am, edited 1 time in total.
User avatar
skywalk
Addict
Addict
Posts: 4218
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Tool Questions:

Post by skywalk »

Hi,
This simple tool code crashes the IDE.
**Save your work before trying.**

PB v4.51 x86 XP Pro SP3, Compiler options: Unicode OFF

Anybody have success communicating with the IDE Scintilla windows?

Code: Select all

Define.i hSCI, hIDE, ri, ri2, *buf
Define.s r
hIDE = Val(GetEnvironmentVariable("PB_TOOL_MainWindow"))
hSCI = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
r = "hIDE = " + Str(hIDE) + #CR$ +  "hSCI = " + Str(hSCI) + #CR$
MessageRequester("CBPaster", r) 
If hSCI   
  ri = SendMessage_(hSCI, #SCI_GETTEXTLENGTH, 0, 0) + 1
  r = "TextLength = " + Str(ri) + #CR$
  MessageRequester("CBPaster", r) 
  r = Space(ri)
  *buf = @r
  ri2 = SendMessage_(hSCI, #SCI_GETTEXT, ri, *buf)  ; <--- IDE CRASH HERE :(
                                                 ; or
  ri2 = SendMessage_(hSCI, #SCI_GETTEXT, ri, @r)  ; <--- IDE CRASH HERE :(
  MessageRequester("CBPaster", r) 
EndIf
End
Post Reply