Re: the source code editor---which one is better?



Sorry Jody, it seems that, by mistake, I send you this reply privately.
:(

Reposting here:

El vie, 06 de 02 de 2004 a las 01:03, Jody Goldberg escribiÃ:
On Thu, Feb 05, 2004 at 09:42:57PM -0200, Leandro A. F. Pereira wrote:

    Scintilla is pretty good, IMO :)        

    http://www.scintilla.org/

Nice.  I'm looking for something to use for editing the vba in excel
files.  Does scintilla have a vba highlighting mode ?

Yes scintilla have support for a really big number of languages
including VB. It also has an API to build new "Lexers" for unsupported
languages.

The highlighting is made by tokens, and you add to any of these tokens
the word's list you want.

I mean one style can be SCI_VBA_KEYWORD, then you set the color for this
token, and use the keyword list of your choice.

How much info do you need to do those cute drop downs for types, how
would that get communicated to the widget ?

To show the drop downs is easy,

gchar words[] ="one two three four";
SendMessage(ScintillaObject, SCI_AUTOCSHOW, 0, (sptr_r) words);

You receive the user's choice on a "sci-notify" signal, connected to the
editor widget by g_signal_connect().

The callback template is:

void
on_editor_notification( GtkWidget* editor,gint scn, gpointer lscn,
gpointer user_data)

Then you get all editor signals:

void
on_editor_notification( GtkWidget* editor,gint scn, gpointer lscn,
gpointer user_data)
{
        struct SCNotification *nt;
        nt = lscn;
        switch (nt->nmhdr.code){
                case SCN_STYLENEEDED:
                case SCN_CHARADDED:
                case SCN_MARGINCLICK:
                case SCN_USERLISTSELECTION: // autocomplete
        }
}

Scintilla for gtk is a widget itself but don't use the normal widget
"API". It uses a message driven interface as the Windows RichTextCtrl as
you've seen in the SendMessage() example.

In the other hand, exists a "porting" of scintilla to the common widget
"API" called GtkScintilla in SourceForge.

Can you give me a feel for how scintilla compares to GtkSourceView ?

Scintilla have been here for a long time and it's far more complete than
GtkSourceView.

Most editor logic is built in as: auto completion, folding, line
numbers, call tips, search & replace, word wrap, etc ...

I use it in the http://cssed.sourceforge.net project and I'm really
happy with the results. It's easy to manage, low memory consuming, fast
and no bugs found in my development.

You can check some screenshots at
http://cssed.sourceforge.net/screenshot to check how it looks, the
folding feature, syntax highlighting, autocompletion, line numbers and
margins are built in the controls.

Feel free to mail me privately about this regards if it's OT here (
Scintilla is not part of Gtk ;)

You can also take code samples from the anjuta project, and cssed
project ( Both use scintilla directly, not GtkScintilla).


regards
-- 
Iago Rubio                http://www.iagorubio.com          
GPGkey pgp.rediris.es id 0x909BD4DD  fingerprint =
D18A B950 5F03 BB9A DD89  AA75 FEDF 1978 909B D4DD
********** iago.rubio(AT)hispalinux.es  **********     
--------------------------------------------------

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]