Class Hierarchy
Fl_Text_Display
|
+----Fl_Text_Editor
Include Files
#include <FL/Fl_Text_Editor.H>
Description
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.
Methods
The constructor creates a new text editor widget.
The destructor frees all memory used by the text editor widget.
Adds all of the default editor key bindings to the specified key binding list.
Adds a single key binding to the specified or current key binding list.
Returns the function associated with a key binding.
Sets the default key function for unassigned keys.
Sets or 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.
Does a backspace in the current buffer.
Does a copy of selected text in the current buffer.
Extends the current selection in the direction indicated by
control key c .
Moves the current text cursor in the direction indicated by
control key c .
Does a cut of selected text in the current buffer.
Inserts the text associated with the key c .
Does a delete of selected text or the current character in
the current buffer.
Moves the text cursor down one line.
Moves the text cursor to the end of the current line.
Inserts a newline at the current cursor position.
Moves the text cursor to the beginning of the current line.
Ignores the keypress.
Toggles the insert mode in the text editor.
Moves the text cursor to the left in the buffer.
Moves the text cursor in the direction indicated by key
c .
Moves the text cursor down one page.
Moves the text cursor up one page.
Pastes the contents of the clipboard at the current text cursor position.
Moves the text cursor one character to the right.
Selects all text in the buffer.
Extends the current selection in the direction of key c .
Moves the text cursor up one line.
Removes all of the key bindings associated with the text editor or list.
Removes a single key binding from the text editor or list.
From mariwan, 01:27 Jul 08, 2005 (score=3)
To make the cursor blinks: try this code
*****************************************************************start
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Text_Buffer.H>
#include <FL/Fl_Text_Editor.H>
Fl_Text_Editor *txtedit;
class text: public Fl_Text_Editor
{
public:
text(int x,int y,int w,int h,char *l );
};
int getSetOrNot=0;
void SetCurser(void*)
{
getSetOrNot=!getSetOrNot;
txtedit->show_cursor(getSetOrNot);
Fl::repeat_timeout(0.5,SetCurser);
}
int
main (int argc, char *argv[])
{
Fl_Window *window;
Fl_Text_Editor *t;
Fl_Text_Buffer *b;
b=new Fl_Text_Buffer;
window = new Fl_Window (10, 10,400,300,"Hello Text Editor");
getSetOrNot=1;
t = new Fl_Text_Editor (11, 20, 380, 280, "See Me");
txtedit=t;
t->buffer(b);
Fl::add_timeout(0.5,SetCurser);
t->box (FL_UP_BOX);
window->end ();
window->show (argc, argv);
return Fl::run();
}
*****************************************************************End
[ Reply ] From thomas, 07:21 Feb 19, 2004 (score=2)
Don't try to change the used Buffer twice.
like:
Fl_Text_Buffer* fl_text = new Fl_Text_Buffer(10000);
out_description->buffer(fl_text);
//change fl_text
...
out_description->buffer(fl_text); // Here it hangs at runtime
Why I try that? The Update of the edit windows is done automatic, but I don't know it.
[ Reply ] |