edelib
2.1.0
|
Editing component for Scheme language. More...
#include <edelib/SchemeEditor.h>
Public Member Functions | |
SchemeEditor (int X, int Y, int W, int H, const char *l=0) | |
void | textsize (int sz) |
virtual int | handle (int e) |
Fl_Text_Buffer * | style_buffer (void) |
void | object_color (int id, int color) |
void | object_color (int id, const char *color) |
void | match_parenthesis (bool m) |
Editing component for Scheme language.
SchemeEditor is extension of Fl_Text_Editor, where is provided syntax higlighting for Scheme-like languages (and the rest of LISP family) with parenthesis matching. It will highligh known Scheme keywords and functions, plus some extensions from edelib-script (see sslib/init-2.ss for those extensions).
There are few caveats you should be aware of, if you are planning to use this component. First, you should not explicitly set editor buffer (via Fl_Text_Editor::buffer) as SchemeEditor will set it when object is constructed. This is needed so class can correctly setup style buffer too (for syntax highlight). If you specify own buffer object, syntax highlight will not work.
The second is how SchemeEditor will use Fl_Text_Editor::add_modify_callback internally to match parenthesis, so if you overwrite it, editor will not highlight them any more.
SchemeEditor | ( | int | X, |
int | Y, | ||
int | W, | ||
int | H, | ||
const char * | l = 0 |
||
) |
Create widget at given position with given size.
|
virtual |
Event handler.
|
inline |
Match or highlight block of parenthesis.
void object_color | ( | int | id, |
int | color | ||
) |
Set color for text object. Object can be keyword, comment, parenthesis, etc. and is setup according to given list:
For example, to draw comments in red color, you would use object_color(2, FL_RED).
void object_color | ( | int | id, |
const char * | color | ||
) |
Set color using html color
|
inline |
Return style buffer.
void textsize | ( | int | sz | ) |
Set text size; applied on all styles.