diff options
| author | Greg Ercolano <erco@seriss.com> | 2014-05-21 06:56:59 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2014-05-21 06:56:59 +0000 |
| commit | 46521bf437f712234904a4295cb75ba15d168b5f (patch) | |
| tree | a89d0c692e005f4bc6c688374ab4333efa79d0ec /test | |
| parent | cb0f80cde7ced7ba1d98c8d1e3c713331ab5b5bf (diff) | |
Implements STR #2621: Add line numbers to Fl_Text_Display.
Applied LZA's patch and included some mods to address TODO items and ABI issues.
Also update CREDITS with LZA and a few other notably absent names.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
| -rw-r--r-- | test/editor.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/editor.cxx b/test/editor.cxx index 1c9db095f..54245ab42 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -515,6 +515,19 @@ void delete_cb(Fl_Widget*, void*) { textbuf->remove_selection(); } +void linenumbers_cb(Fl_Widget *w, void* v) { + EditorWindow* e = (EditorWindow*)v; + Fl_Menu_Bar* m = (Fl_Menu_Bar*)w; + const Fl_Menu_Item* i = m->mvalue(); + if ( i->value() ) { + e->editor->linenumber_width(50); // enable + e->editor->linenumber_size(e->editor->textsize()); + } else { + e->editor->linenumber_width(0); // disable + } + e->redraw(); +} + void find_cb(Fl_Widget* w, void* v) { EditorWindow* e = (EditorWindow*)v; const char *val; @@ -751,6 +764,9 @@ Fl_Menu_Item menuitems[] = { { "&Copy", FL_COMMAND + 'c', (Fl_Callback *)copy_cb }, { "&Paste", FL_COMMAND + 'v', (Fl_Callback *)paste_cb }, { "&Delete", 0, (Fl_Callback *)delete_cb }, + { "Preferences", 0, 0, 0, FL_SUBMENU }, + { "Line Numbers", FL_COMMAND + 'l', (Fl_Callback *)linenumbers_cb, 0, FL_MENU_TOGGLE }, + { 0 }, { 0 }, { "&Search", 0, 0, 0, FL_SUBMENU }, |
