scintilla.mcc, documentation or header file?
  • Caterpillar
    Caterpillar
    ShInKurO
    Posts: 36 from 2008/5/30
    Hi,
    I'm very interested to scintilla.mcc, is there some header file and/or autodoc with which could I dev with it ?

    Nicholas author ? :)
  • »28.07.12 - 08:35
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    r-tea
    Posts: 306 from 2005/3/27
    From: Poland, Zdzies...
    Much improved NoWinEd on the way? :-)

    Quote:

    ShInKurO wrote:
    Hi,
    I'm very interested to scintilla.mcc, is there some header file and/or autodoc with which could I dev with it ?

    Nicholas author ? :)
    Mac mini G4@1,5GHz silent upgrade + Xerox Phaser 3140 + EPSON Perfection 1240U
    Commodore C64C + 2 x 1541II + Datasette + SD-Box

    I miss draggable screens... and do you? I know I'm in a minority unfortunately.
  • »05.01.14 - 21:47
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    Can anyone give me an example of how to use Scintilla.mcc?

    I mean, how to load/save a file etc?
  • »06.01.14 - 19:10
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 162 from 2003/3/17
    Hi,

    I guess that someone is me since I came up with Scintilla.mcc + Scribble in the first place...

    Unfortunately I have never written any developer documentation for the Scintilla.mcc. I agree that ideally this should be included in the SDK together with example code (one day hopefully). However, this should not really be a problem as Scintilla.mcc intentionally keeps the full interface available on other platforms.

    This means that the documentation you can find on Scintilla Documentation is all valid also in the case of the MorphOS implementation. This makes it really easy to just create a Scintilla MUI object and then pass commands to it (there are many very powerful ones as you will notice). You can also easily translate code available for Linux, Windows or so on...

    What you additonally need to know is the following:

    To call a scintilla command you use SCI_Command like this:

    DoMethod(obj, SCI_Command, m, w, l)

    where m is the scintilla command (i.e. SCI_INSERTTEXT)
    w and l are the two parameters of that command. In case the command takes only 0 or 1 parameters then pass 0s.

    Scintilla notifications are implemented using SCI_Notify and standard MUI notifications. An example from Scribble might make this clearer:

    DoMethod(data->Scintilla_MUI, MUIM_Notify, SCI_Notify, MUIV_EveryTime,
    obj, 3, MM_PlayWin_HandleSciMsg, (LONG) MUIV_TriggerValue, FALSE);

    Additonally, there are a few custom additions to the MorphOS port. You might particularly find
    the MA_ActiveEditor attribute useful. Here's an example:

    setmui(data->Scintilla_MUI, MA_ActiveEditor, TRUE);

    I hope this helps but please don't hesitate if you have questions.

    Best,

    Nicholai

    ps.

    By the way, there is no command to load file into Scintilla, you have to load the file from disk yourself and then pass the contents to the Scintilla document buffer with i.e SCI_ADDTEXT or SCI_INSERTTEXT.
  • »06.01.14 - 22:34
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    Thanks!
    Now it works!

    I tried this:
    DoMethod(sci, SCI_Command, SCI_INSERTTEXT, "Hallo", 0)

    But now reading the docs, I found out that, the second argument is the text to add;)

    I wanted to write a small "IDE" for ecx, since Scribble can fold only in c-sources, and building a project for ecx only works with a faked makefile, also the function-lister only works for c sources...

    But after a short reading in the docs, it seems that I have to add all the neat stuff Scribble already has like syntax-highlighting, folding, a function-lister already exists;), hotkey binding etc all by myself;(

    I thought/hoped they could be enabled via an attribute in the mcc;)
  • »07.01.14 - 13:40
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 162 from 2003/3/17
    Yes, it's true that while Scintilla.mcc is really powerful, Scribble includes a whole lot of of functionality of its own and it also uses some undocumented components from the MorphOS SDK. It really took a lot of work to get it to where it is now...

    I have sometimes contemplated if it would be worth breaking out some of the Scribble functionality to an external class available to other applications. However, this would be quite a bit of work and I'm not sure it would be worth the effort at this stage.

    By the way, it is not true that folding in Scribble only works for C/C++. Actually, this depends on the lexer for that particular language. It could however be true that the E lexer does not have this functionality (I'm not at home so I can't check at the moment). If so, this could probably be added without too much difficulty (better ask Leif who wrote this lexer). It would also be possible to improve other aspects of E support but I don't have the time to work on this myself.
  • »07.01.14 - 14:38
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Leif
    Posts: 111 from 2006/5/31
    From: Sweden
    Quote:


    By the way, it is not true that folding in Scribble only works for C/C++. Actually, this depends on the lexer for that particular language. It could however be true that the E lexer does not have this functionality (I'm not at home so I can't check at the moment). If so, this could probably be added without too much difficulty (better ask Leif who wrote this lexer). It would also be possible to improve other aspects of E support but I don't have the time to work on this myself.


    Nope, never implemented that part, never was much of a folding fan unfortunately. Might be folding code from another lexer for similar syntax say Pascal could be used without too much changes, will have to check..
  • »07.01.14 - 18:29
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Leif
    Posts: 111 from 2006/5/31
    From: Sweden
    igracki wrote:

    Quote:


    I wanted to write a small "IDE" for ecx, since Scribble can fold only in c-sources, and building a project for ecx only works with a faked makefile, also the function-lister only works for c sources...



    E function lister should come eventually..
  • »07.01.14 - 18:35
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    Quote:

    Nadir wrote:
    By the way, it is not true that folding in Scribble only works for C/C++. Actually, this depends on the lexer for that particular language. It could however be true that the E lexer does not have this functionality (I'm not at home so I can't check at the moment). If so, this could probably be added without too much difficulty (better ask Leif who wrote this lexer). It would also be possible to improve other aspects of E support but I don't have the time to work on this myself.


    Sorry, didn't really tested, if folding only works for C/C++, thought I read that somewhere, and I didn't get it worked for E sources;)

    The Project-Settings could be tuned a little bit, to specify the build-command, f.e.

    Would you let someone else help you to work on Scribble?

    Quote:

    Leif wrote:
    Nope, never implemented that part, never was much of a folding fan unfortunately. Might be folding code from another lexer for similar syntax say Pascal could be used without too much changes, will have to check..


    Would be nice, if you could add it!

    Quote:

    Leif wrote:
    E function lister should come eventually..


    Well, this is not so important for me, as I wrote an external program (EProcLister) for this job;)
    EProcLister

    But inside Scribble would be better of course!
  • »07.01.14 - 20:14
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 162 from 2003/3/17
    Quote:

    Would you let someone else help you to work on Scribble?


    Well, it is open to other MorphOS developers with source access to the cvs repository but I do not want to extend further than that.
  • »10.01.14 - 08:56
    Profile