summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2010-08-24 08:12:50 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2010-08-24 08:12:50 +0000
commit9f1fdb08878f5eb122339372f4e383f716f28009 (patch)
tree1c1fa689a927046c7e739917cd49c019d52f2d68
parentaedfb480ce770d39cb8075d3e7c3f5b62d6f7240 (diff)
made test/editors textsize "configurable" (by macro TS)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7686 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--test/editor.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/editor.cxx b/test/editor.cxx
index 89c83913b..beef18be2 100644
--- a/test/editor.cxx
+++ b/test/editor.cxx
@@ -61,16 +61,17 @@ Fl_Text_Buffer *textbuf = 0;
// Syntax highlighting stuff...
+#define TS 14 // default editor textsize
Fl_Text_Buffer *stylebuf = 0;
Fl_Text_Display::Style_Table_Entry
styletable[] = { // Style table
- { FL_BLACK, FL_COURIER, 14 }, // A - Plain
- { FL_DARK_GREEN, FL_COURIER_ITALIC, 14 }, // B - Line comments
- { FL_DARK_GREEN, FL_COURIER_ITALIC, 14 }, // C - Block comments
- { FL_BLUE, FL_COURIER, 14 }, // D - Strings
- { FL_DARK_RED, FL_COURIER, 14 }, // E - Directives
- { FL_DARK_RED, FL_COURIER_BOLD, 14 }, // F - Types
- { FL_BLUE, FL_COURIER_BOLD, 14 } // G - Keywords
+ { FL_BLACK, FL_COURIER, TS }, // A - Plain
+ { FL_DARK_GREEN, FL_COURIER_ITALIC, TS }, // B - Line comments
+ { FL_DARK_GREEN, FL_COURIER_ITALIC, TS }, // C - Block comments
+ { FL_BLUE, FL_COURIER, TS }, // D - Strings
+ { FL_DARK_RED, FL_COURIER, TS }, // E - Directives
+ { FL_DARK_RED, FL_COURIER_BOLD, TS }, // F - Types
+ { FL_BLUE, FL_COURIER_BOLD, TS } // G - Keywords
};
const char *code_keywords[] = { // List of known C/C++ keywords...
"and",
@@ -773,11 +774,12 @@ Fl_Window* new_view() {
Fl_Menu_Bar* m = new Fl_Menu_Bar(0, 0, 660, 30);
m->copy(menuitems, w);
w->editor = new Fl_Text_Editor(0, 30, 660, 370);
+ w->editor->textfont(FL_COURIER);
+ w->editor->textsize(TS);
w->editor->buffer(textbuf);
w->editor->highlight_data(stylebuf, styletable,
sizeof(styletable) / sizeof(styletable[0]),
'A', style_unfinished_cb, 0);
- w->editor->textfont(FL_COURIER);
w->end();
w->resizable(w->editor);
w->callback((Fl_Callback *)close_cb, w);