class Fl_Input : public Fl_Input_

This is the fltk text input widget. It displays a single line of text and lets the user edit it. Normally it is drawn with an inset box and a white background. The text may contain any characters (even 0), and will correctly display anything, using ^X notation for unprintable control characters and \nnn notation for unprintable characters with the high bit set (it assummes the font can draw any characters in the ISO8859-1 character set).

There are some subclasses with different behavior:

Mouse button 1 Moves the cursor to this point. Drag selects characters. Double click selects words. Triple click selects all text. Shift+click extends the selection.
Mouse button 2 Insert the current X selection at the cursor (unlike Motif this does not move the insertion point to the mouse). If the widget does not have the input focus (and thus no cursor) it puts the cursor where clicked and inserts the selection there.
Mouse button 3 Currently acts like button 1.
Backspace Deletes one character to the left, or deletes the selected region.
Enter May cause the callback, see when().
^A or Home Go to start of line.
^B or Left Move left
^C Copy the selection to the X selection
^D or Delete Deletes one character to the right or deletes the selected region. Due to silly historical X problems, the Delete key will act like Backspace until you type a "real" backspace.
^E or End Go to the end of line.
^F or Right Move right
^K Delete to the end of line (next \n character) or deletes a single \n character. These deletions are all concatenated into the X selection.
^N or Down Move down (for Fl_Multiline_Input only, otherwise it moves to the next input field).
^P or Up Move up (for Fl_Multiline_Input only, otherwise it moves to the previous input field).
^Q or
RightCtrl or
Compose
Start a compose-character sequence. The next one or two keys typed define the character to insert. This also can be used to "quote" control characters.
^U Delete everything.
^V or ^Y Paste the X selection
^X or ^W Copy the region to the X selection and delete it.
^Z or ^_ Undo. This is a single-level undo mechanism, but all adjacent deletions and insertions are concatenated into a single "undo". Often this will undo a lot more than you expected.
Shift+move Move the cursor but also extend the selection.

Fl_Input::Fl_Input(int,int,int,int,const char* = 0);

const char* Fl_Input::value() const;

int Fl_Input::value(const char*);
int Fl_Input::value(const char*, int);

int Fl_Input::static_value(const char*);
int Fl_Input::static_value(const char*, int);

int Fl_Input::size() const;

char Fl_Input::index(int) const;

Fl_When Fl_Widget::when() const;
void Fl_Widget::when(Fl_When);

int Fl_Widget::changed() const;
void Fl_Widget::set_changed();
void Fl_Widget::clear_changed();

Fl_Font Fl_Input::textfont() const;
void Fl_Input::textfont(Fl_Font);
uchar Fl_Input::textsize() const;
void Fl_Input::textsize(uchar);
Fl_Color Fl_Input::textcolor() const;
void Fl_Input::textcolor(Fl_Color);

Fl_Color Fl_Input::cursor_color() const;
void Fl_Input::cursor_color(Fl_Color);

See also the methods for Fl_Input_. These methods are designed so subclasses can edit the text, but can be called directly if your application wants to edit the text or change the cursor position or selection.

class Fl_Float_Input : public Fl_Input

The same as an Fl_Input except if the current text cannot be passed through strtod() it is displayed in red.

You may want a Fl_Value_Input or Fl_Value_Output instead.

Fl_Float_Input::Fl_Float_Input(int x,int y,int w,int h,const char* l = 0);

class Fl_Int_Input : public Fl_Input

The same as an Fl_Input except if the current text cannot be passed through strtol() it is displayed in red.

You may want a Fl_Value_Input or Fl_Value_Output instead, with the step() set to 1.

Fl_Int_Input::Fl_Int_Input(int x,int y,int w,int h,const char* l = 0);

class Fl_Multiline_Input : public Fl_Input

This input field displays '\n' characters as new lines rather than ^J, and accepts the Return, Tab, and up and down arrow keys. This is for editing multiline text.

This is far from the nirvana of text editors, and is probably only good for small bits of text, 10 lines at most. I think fltk can be used to write a powerful text editor, but it is not going to be a built-in feature. Powerful text editors in a toolkit are a big source of bloat.

Fl_Multiline_Input::Fl_Multiline_Input(int x,int y,int w,int h,const char* l = 0);

class Fl_Secret_Input : public Fl_Input

This input field displays asterisks in place of each letter. And you cannot copy the text somewhere else using the X selection mechanism or the cut/paste keys.

Fl_Secret_Input::Fl_Secret_Input(int x,int y,int w,int h,const char* l = 0);

(back to contents)