summaryrefslogtreecommitdiff
path: root/FL/Fl_Text_Editor.H
diff options
context:
space:
mode:
Diffstat (limited to 'FL/Fl_Text_Editor.H')
-rw-r--r--FL/Fl_Text_Editor.H22
1 files changed, 22 insertions, 0 deletions
diff --git a/FL/Fl_Text_Editor.H b/FL/Fl_Text_Editor.H
index 8b1902746..3457acbf7 100644
--- a/FL/Fl_Text_Editor.H
+++ b/FL/Fl_Text_Editor.H
@@ -36,6 +36,13 @@
// key will match in any state
#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.
+*/
class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
public:
typedef int (*Key_Func)(int key, Fl_Text_Editor* editor);
@@ -50,21 +57,36 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
Fl_Text_Editor(int X, int Y, int W, int H, const char* l = 0);
~Fl_Text_Editor() { remove_all_key_bindings(); }
virtual int handle(int e);
+ /**
+ Sets the current insert mode; if non-zero, new text
+ is inserted before the current cursor position. Otherwise, new
+ text replaces text at the current cursor position.
+ */
void insert_mode(int b) { insert_mode_ = b; }
+ /**
+ Gets the current insert mode; if non-zero, new text
+ is inserted before the current cursor position. Otherwise, new
+ text replaces text at the current cursor position.
+ */
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" */
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);
+ /** Removes the key binding associated with the key "key" of state "state". */
void remove_key_binding(int key, int state)
{ remove_key_binding(key, state, &key_bindings); }
void remove_all_key_bindings(Key_Binding** list);
+ /** Removes all of the key bindings associated with the text editor or list. */
void remove_all_key_bindings() { remove_all_key_bindings(&key_bindings); }
void add_default_key_bindings(Key_Binding** list);
Key_Func bound_key_function(int key, int state, Key_Binding* list);
+ /** Returns the function associated with a key binding. */
Key_Func bound_key_function(int key, int state)
{ return bound_key_function(key, state, key_bindings); }
+ /** Sets the default key function for unassigned keys. */
void default_key_function(Key_Func f) { default_key_function_ = f; }
// functions for the built in default bindings