ActiveState Community

scimoz API, examples

Posted by rfobic on 2008-10-08 02:02
OS: All / Any

Hi,

I'm trying to create some extension to komodo actually several of them...
I looked into open komodo wiki and tried to search some docs but there's not that much I could find regarding that, there is something about it in the help but still only a basics.

What I'm interested in is:

* How can I show hide line numbers.
* Is it possible to highlight parts in editor, (Somehow to add some formatting to the already highlighted text. Example: I want to make function names underlined in javascript editor when I mouseover them if ctrl button is pressed)
* how to listen events I cant manage it now with oncommand nor with onkeypress
* view > type I found buffer, editor, terminal but can't really understand what's difference.
* whose hell is terminalHandler, how to create my own
* maybe it's possible to add some pages on wiki regardin ghow to set event listeners, how to override, default styling tec...

Thanks

rfobic | Wed, 2008-10-08 03:00

Is there way to get the error, warning lines, index?

ericp | Wed, 2008-10-08 10:02

There is some info in our on-line help, but the two main sources
are the Documentation section at scintilla.org, and the
ISciMoz.idl file we ship in .../sdk/idl -- the conversion between
IDL method names and Scintilla message names should be straightforward.

So for example, this hides the line number margin:

scimoz.setMarginWidthN(0, 0)

and this shows it:

scimoz.setMarginWidthN(0, w)

where w = scimoz.getMarginWidthN(0) before the margin was hidden.

It's a big API. I'd recommend tackling it a bit at a time,
and also browse other Komodo extensions that also work with
the scimoz API, read the code, and try modifying them or
incorporating their code in your own (as long as the license
allows it).

To highlight parts of the editor, you can use indicators (see the
Scintilla docs). We're currently using indicators 15 through 26, and
expect to reach 31 over time, leaving indicators 0 through 14 for
others. See the code in koDocumentSettingsManager.py for an
example of setting up indicators, and koLintDisplayer.py for
code that shows how to apply indicators to a region of text.

You should be able to write a Mozilla event listener to get keypress
events.

view > type - best to keep reading the code, and draw up the
inheritance hierarchy among the various views.

I'm not sure what you mean by terminalHandler.

There are other extensions showing how to get errors and
warnings. You can find them at http://community.activestate.com/addons