diff options
Diffstat (limited to 'fluid/widgets/Code_Editor.cxx')
| -rw-r--r-- | fluid/widgets/Code_Editor.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fluid/widgets/Code_Editor.cxx b/fluid/widgets/Code_Editor.cxx index 583d07c5b..1551ed3e2 100644 --- a/fluid/widgets/Code_Editor.cxx +++ b/fluid/widgets/Code_Editor.cxx @@ -24,8 +24,8 @@ #include <ctype.h> #include "widgets/Code_Editor.h" -using namespace fld; -using namespace fld::widget; + + // ---- Code_Editor implementation @@ -33,7 +33,7 @@ using namespace fld::widget; Lookup table for all supported styles. Every table entry describes a rendering style for the corresponding text. */ -Fl_Text_Display::Style_Table_Entry Code_Editor::styletable[] = { // Style table +Fl_Text_Display::Style_Table_Entry fld::widget::Code_Editor::styletable[] = { // Style table { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments @@ -51,7 +51,7 @@ Fl_Text_Display::Style_Table_Entry Code_Editor::styletable[] = { // Style tabl \param[in] in_len byte length to parse \param[in] in_style starting style letter */ -void Code_Editor::style_parse(const char *in_tbuff, // text buffer to parse +void fld::widget::Code_Editor::style_parse(const char *in_tbuff, // text buffer to parse char *in_sbuff, // style buffer we modify int in_len, // byte length to parse char in_style) { // starting style letter @@ -104,7 +104,7 @@ void Code_Editor::style_parse(const char *in_tbuff, // text buffer to pa /** Update unfinished styles. */ -void Code_Editor::style_unfinished_cb(int, void*) { +void fld::widget::Code_Editor::style_unfinished_cb(int, void*) { } /** @@ -114,7 +114,7 @@ void Code_Editor::style_unfinished_cb(int, void*) { \param[in] nDeleted number of bytes deleted \param[in] cbArg pointer back to the code editor */ -void Code_Editor::style_update(int pos, int nInserted, int nDeleted, +void fld::widget::Code_Editor::style_update(int pos, int nInserted, int nDeleted, int /*nRestyled*/, const char * /*deletedText*/, void *cbArg) { Code_Editor *editor = (Code_Editor*)cbArg; @@ -165,7 +165,7 @@ void Code_Editor::style_update(int pos, int nInserted, int nDeleted, Find the right indentation depth after pressing the Enter key. \param[in] e pointer back to the code editor */ -int Code_Editor::auto_indent(int, Code_Editor* e) { +int fld::widget::Code_Editor::auto_indent(int, Code_Editor* e) { if (e->buffer()->selected()) { e->insert_position(e->buffer()->primary_selection()->start()); e->buffer()->remove_selection(); @@ -203,7 +203,7 @@ int Code_Editor::auto_indent(int, Code_Editor* e) { \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : +fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : Fl_Text_Editor(X, Y, W, H, L) { buffer(new Fl_Text_Buffer); @@ -231,7 +231,7 @@ Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : /** Destroy a Code_Editor widget. */ -Code_Editor::~Code_Editor() { +fld::widget::Code_Editor::~Code_Editor() { Fl_Text_Buffer *buf = mStyleBuffer; mStyleBuffer = 0; delete buf; @@ -246,11 +246,12 @@ Code_Editor::~Code_Editor() { This works by updating the fontsizes in the style table. \param[in] s the new general height of the text font */ -void Code_Editor::textsize(Fl_Fontsize s) { +void fld::widget::Code_Editor::textsize(Fl_Fontsize s) { Fl_Text_Editor::textsize(s); // call base class method // now attempt to update our styletable to honor the new size... int entries = sizeof(styletable) / sizeof(styletable[0]); - for(int iter = 0; iter < entries; iter++) { + int iter; + for (iter = 0; iter < entries; iter++) { styletable[iter].size = s; } } // textsize |
