diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-08-13 10:07:17 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-08-13 10:07:17 +0000 |
| commit | 0650563c7b36b47780e0a5a50cab91e2f18be1fd (patch) | |
| tree | 577e5b6452f45337a3b95aab3ed0224869614d16 /FL | |
| parent | 9bedf7ab8ffa0e6ca314d01e298d74d62cb106a3 (diff) | |
Document Fl_Text_Editor::global_key_bindings and related methods.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10830 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Text_Editor.H | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/FL/Fl_Text_Editor.H b/FL/Fl_Text_Editor.H index 44e881a9d..c688f6260 100644 --- a/FL/Fl_Text_Editor.H +++ b/FL/Fl_Text_Editor.H @@ -31,18 +31,18 @@ #define FL_TEXT_EDITOR_ANY_STATE (-1L) /** - This is the FLTK text editor widget. It allows the user to - edit multiple lines of text and supports highlighting and - scrolling. The buffer that is displayed in the widget is managed - by the Fl_Text_Buffer - class. + This is the FLTK text editor widget. + + It allows the user to edit multiple lines of text and supports highlighting + and scrolling. The buffer that is displayed in the widget is managed + by the Fl_Text_Buffer class. */ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display { public: - /** Key function binding callback type */ + /** Key function binding callback type. */ typedef int (*Key_Func)(int key, Fl_Text_Editor* editor); - /** Simple linked list associating a key/state to a function */ + /** Simple linked list item associating a key/state to a function. */ struct Key_Binding { int key; ///< the key pressed int state; ///< the state of key modifiers @@ -67,7 +67,7 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display { int insert_mode() { return insert_mode_; } void add_key_binding(int key, int state, Key_Func f, Key_Binding** list); - /** Adds a key of state "state" with the function "function" */ + /** Adds a \p key of state \p state with the function \p f. */ void add_key_binding(int key, int state, Key_Func f) { add_key_binding(key, state, f, &key_bindings); } void remove_key_binding(int key, int state, Key_Binding** list); @@ -119,7 +119,18 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display { #ifndef FL_DOXYGEN int insert_mode_; Key_Binding* key_bindings; +#endif + + /** Global key binding list. + + Derived classes can add key bindings for all Fl_Text_Editor widgets + by adding a Key_Binding to this list. + + \see add_key_binding(int key, int state, Key_Func f, Key_Binding** list); + */ static Key_Binding* global_key_bindings; + +#ifndef FL_DOXYGEN Key_Func default_key_function_; #endif }; |
