mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 08:32:07 +08:00
Add documentation for readonly() and input_type().
Fix "make distclean" so that it removes all of the library files. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2204 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+134
-90
@@ -1,10 +1,15 @@
|
||||
<HTML><BODY>
|
||||
<HTML>
|
||||
<BODY>
|
||||
|
||||
<!-- NEW PAGE -->
|
||||
|
||||
<H2><A name=Fl_Input>class Fl_Input</A></H2>
|
||||
|
||||
<HR>
|
||||
|
||||
<H3>Class Hierarchy</H3>
|
||||
<UL>
|
||||
<PRE>
|
||||
|
||||
<UL><PRE>
|
||||
<A href=Fl_Input_.html#Fl_Input_>Fl_Input_</A>
|
||||
|
|
||||
+----<B>Fl_Input</B>
|
||||
@@ -12,22 +17,23 @@
|
||||
+----<A href="Fl_File_Input.html">Fl_File_Input</A>, <A href=Fl_Float_Input.html#Fl_Float_Input>Fl_Float_Input</A>,
|
||||
<A href=Fl_Int_Input.html#Fl_Int_Input>Fl_Int_Input</A>, <A href=Fl_Multiline_Input.html#Fl_Multiline_Input>Fl_Multiline_Input</A>,
|
||||
<A href=Fl_Output.html#Fl_Output>Fl_Output</A>, <A href=Fl_Secret_Input.html#Fl_Secret_Input>Fl_Secret_Input</A>
|
||||
</PRE>
|
||||
</UL>
|
||||
</PRE></UL>
|
||||
|
||||
<H3>Include Files</H3>
|
||||
<UL>
|
||||
<PRE>
|
||||
|
||||
<UL><PRE>
|
||||
#include <FL/Fl_Input.H>
|
||||
</PRE>
|
||||
</UL>
|
||||
</PRE></UL>
|
||||
|
||||
<H3>Description</H3>
|
||||
<P>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 assumes the font can draw any characters in the
|
||||
ISO-8859-1 character set.
|
||||
|
||||
<P>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 assumes the
|
||||
font can draw any characters in the ISO-8859-1 character set.
|
||||
|
||||
<CENTER><TABLE border=1 WIDTH=90% summary="Fl_Input keyboard and mouse bindings.">
|
||||
|
||||
@@ -240,6 +246,7 @@ inserted.
|
||||
</TD><TD align=left valign=top>
|
||||
<UL>
|
||||
<LI><A href=#Fl_Input.index>index</A></LI>
|
||||
<LI><A href=#Fl_Input.readonly>readonly</A></LI>
|
||||
<LI><A href=#Fl_Input.size>size</A></LI>
|
||||
</UL>
|
||||
</TD><TD align=left valign=top>
|
||||
@@ -260,78 +267,115 @@ inserted.
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
<H4><A name=Fl_Input.Fl_Input>Fl_Input::Fl_Input(int x, int y, int w,
|
||||
int h, const char *label = 0)</A></H4>
|
||||
Creates a new <TT>Fl_Input</TT> widget using the given position, size,
|
||||
and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>.
|
||||
<H4><A name=Fl_Input.~Fl_Input>virtual Fl_Input::~Fl_Input()</A></H4>
|
||||
Destroys the widget and any value associated with it.
|
||||
<H4><A name=Fl_Input.value>const char *Fl_Input::value() const
|
||||
<BR> int Fl_Input::value(const char*)
|
||||
<BR> int Fl_Input::value(const char*, int)</A></H4>
|
||||
The first form returns the current value, which is a pointer to the
|
||||
internal buffer and is valid only until the next event is handled.
|
||||
<P>The second two forms change the text and set the mark and the point
|
||||
to the end of it. The string is copied to the internal buffer. Passing <TT>
|
||||
NULL</TT> is the same as "". This returns non-zero if the new value is
|
||||
different than the current one. You can use the second version to
|
||||
directly set the length if you know it already or want to put nul's in
|
||||
the text. </P>
|
||||
<H4><A name=Fl_Input.static_value>int Fl_Input::static_value(const
|
||||
char*)
|
||||
<BR> int Fl_Input::static_value(const char*, int)</A></H4>
|
||||
Change the text and set the mark and the point to the end of it. The
|
||||
string is <I>not</I> copied. If the user edits the string it is copied
|
||||
to the internal buffer then. This can save a great deal of time and
|
||||
memory if your program is rapidly changing the values of text fields,
|
||||
but this will only work if the passed string remains unchanged until
|
||||
either the <TT>Fl_Input</TT> is destroyed or <TT>value()</TT> is called
|
||||
again.
|
||||
<H4><A name=Fl_Input.size>int Fl_Input::size() const</A></H4>
|
||||
Returns the number of characters in <TT>value()</TT>. This may be
|
||||
greater than <TT>strlen(value())</TT> if there are nul characters in
|
||||
it.
|
||||
<H4><A name=Fl_Input.index>char Fl_Input::index(int) const</A></H4>
|
||||
Same as <TT>value()[n]</TT>, but may be faster in plausible
|
||||
implementations. No bounds checking is done.
|
||||
<H4><A name=Fl_Input.when>Fl_When Fl_Widget::when() const
|
||||
<BR> void Fl_Widget::when(Fl_When)</A></H4>
|
||||
Controls when callbacks are done. The following values are useful,
|
||||
the default value is <TT>FL_WHEN_RELEASE</TT>:
|
||||
<UL>
|
||||
<LI><TT>0</TT>: The callback is not done, but <TT>changed()</TT> is
|
||||
turned on. </LI>
|
||||
<LI><TT>FL_WHEN_CHANGED</TT>: The callback is done each time the text
|
||||
is changed by the user. </LI>
|
||||
<LI><TT>FL_WHEN_RELEASE</TT>: The callback will be done when this
|
||||
widget loses the focus, including when the window is unmapped. This
|
||||
is a useful value for text fields in a panel where doing the callback
|
||||
on every change is wasteful. However the callback will also happen if
|
||||
the mouse is moved out of the window, which means it should not do
|
||||
anything visible (like pop up an error message). You might do better
|
||||
setting this to zero, and scanning all the items for <TT>changed()</TT>
|
||||
when the OK button on a panel is pressed. </LI>
|
||||
<LI><TT>FL_WHEN_ENTER_KEY</TT>: If the user types the Enter key, the
|
||||
entire text is selected, and the callback is done if the text has
|
||||
changed. Normally the Enter key will navigate to the next field (or
|
||||
insert a newline for a <TT>Fl_Mulitline_Input</TT>), this changes the
|
||||
behavior. </LI>
|
||||
<LI><TT>FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED</TT>: The Enter key will
|
||||
do the callback even if the text has not changed. Useful for command
|
||||
fields. </LI>
|
||||
</UL>
|
||||
<H4><A name=Fl_Input.textcolor>Fl_Color Fl_Input::textcolor() const
|
||||
<BR> void Fl_Input::textcolor(Fl_Color)</A></H4>
|
||||
Gets or sets the color of the text in the input field.
|
||||
<H4><A name=Fl_Input.textfont>Fl_Font Fl_Input::textfont() const
|
||||
<BR> void Fl_Input::textfont(Fl_Font)</A></H4>
|
||||
Gets or sets the font of the text in the input field.
|
||||
<H4><A name=Fl_Input.textsize>uchar Fl_Input::textsize() const
|
||||
<BR> void Fl_Input::textsize(uchar)</A></H4>
|
||||
Gets or sets the size of the text in the input field.
|
||||
<H4><A name=Fl_Input.cursor_color>Fl_Color Fl_Input::cursor_color()
|
||||
const
|
||||
<BR> void Fl_Input::cursor_color(Fl_Color)</A></H4>
|
||||
Get or set the color of the cursor. This is black by default.
|
||||
|
||||
</BODY></HTML>
|
||||
<H4><A name="Fl_Input.Fl_Input">Fl_Input::Fl_Input(int x, int y, int w,
|
||||
int h, const char *label = 0)</A></H4>
|
||||
|
||||
<P>Creates a new <TT>Fl_Input</TT> widget using the given position, size,
|
||||
and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>.
|
||||
|
||||
<H4><A name="Fl_Input.~Fl_Input">virtual Fl_Input::~Fl_Input()</A></H4>
|
||||
|
||||
<P>Destroys the widget and any value associated with it.
|
||||
|
||||
<H4><A name="Fl_Input.value">const char *Fl_Input::value() const
|
||||
<BR>int Fl_Input::value(const char*)
|
||||
<BR>int Fl_Input::value(const char*, int)</A></H4>
|
||||
|
||||
<P>The first form returns the current value, which is a pointer
|
||||
to the internal buffer and is valid only until the next event is
|
||||
handled.
|
||||
|
||||
<P>The second two forms change the text and set the mark and the
|
||||
point to the end of it. The string is copied to the internal
|
||||
buffer. Passing <TT>NULL</TT> is the same as "".
|
||||
This returns non-zero if the new value is different than the
|
||||
current one. You can use the second version to directly set the
|
||||
length if you know it already or want to put nul's in the
|
||||
text.</P>
|
||||
|
||||
<H4><A name="Fl_Input.static_value">int Fl_Input::static_value(const
|
||||
char*)
|
||||
<BR>int Fl_Input::static_value(const char*, int)</A></H4>
|
||||
|
||||
<P>Change the text and set the mark and the point to the end of
|
||||
it. The string is <I>not</I> copied. If the user edits the
|
||||
string it is copied to the internal buffer then. This can save a
|
||||
great deal of time and memory if your program is rapidly
|
||||
changing the values of text fields, but this will only work if
|
||||
the passed string remains unchanged until either the
|
||||
<TT>Fl_Input</TT> is destroyed or <TT>value()</TT> is called
|
||||
again.
|
||||
|
||||
<H4><A name="Fl_Input.size">int Fl_Input::size() const</A></H4>
|
||||
|
||||
<P>Returns the number of characters in <TT>value()</TT>. This
|
||||
may be greater than <TT>strlen(value())</TT> if there are nul
|
||||
characters in it.
|
||||
|
||||
<H4><A name="Fl_Input.index">char Fl_Input::index(int) const</A></H4>
|
||||
|
||||
<P>Same as <TT>value()[n]</TT>, but may be faster in plausible
|
||||
implementations. No bounds checking is done.
|
||||
|
||||
<H4><A name="Fl_Input.when">Fl_When Fl_Widget::when() const
|
||||
<BR>void Fl_Widget::when(Fl_When)</A></H4>
|
||||
|
||||
<P>Controls when callbacks are done. The following values are useful,
|
||||
the default value is <TT>FL_WHEN_RELEASE</TT>:
|
||||
|
||||
<UL>
|
||||
|
||||
<LI><TT>0</TT>: The callback is not done, but
|
||||
<TT>changed()</TT> is turned on.</LI>
|
||||
|
||||
<LI><TT>FL_WHEN_CHANGED</TT>: The callback is done each
|
||||
time the text is changed by the user.</LI>
|
||||
|
||||
<LI><TT>FL_WHEN_RELEASE</TT>: The callback will be done
|
||||
when this widget loses the focus, including when the
|
||||
window is unmapped. This is a useful value for text
|
||||
fields in a panel where doing the callback on every
|
||||
change is wasteful. However the callback will also
|
||||
happen if the mouse is moved out of the window, which
|
||||
means it should not do anything visible (like pop up an
|
||||
error message). You might do better setting this to
|
||||
zero, and scanning all the items for <TT>changed()</TT>
|
||||
when the OK button on a panel is pressed.</LI>
|
||||
|
||||
<LI><TT>FL_WHEN_ENTER_KEY</TT>: If the user types the
|
||||
Enter key, the entire text is selected, and the callback
|
||||
is done if the text has changed. Normally the Enter key
|
||||
will navigate to the next field (or insert a newline for
|
||||
a <TT>Fl_Mulitline_Input</TT>), this changes the
|
||||
behavior.</LI>
|
||||
|
||||
<LI><TT>FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED</TT>: The
|
||||
Enter key will do the callback even if the text has not
|
||||
changed. Useful for command fields.</LI>
|
||||
|
||||
</UL>
|
||||
|
||||
<H4><A name="Fl_Input.textcolor">Fl_Color Fl_Input::textcolor() const
|
||||
<BR>void Fl_Input::textcolor(Fl_Color)</A></H4>
|
||||
|
||||
<P>Gets or sets the color of the text in the input field.
|
||||
|
||||
<H4><A name="Fl_Input.textfont">Fl_Font Fl_Input::textfont() const
|
||||
<BR>void Fl_Input::textfont(Fl_Font)</A></H4>
|
||||
|
||||
<P>Gets or sets the font of the text in the input field.
|
||||
|
||||
<H4><A name="Fl_Input.textsize">uchar Fl_Input::textsize() const
|
||||
<BR>void Fl_Input::textsize(uchar)</A></H4>
|
||||
|
||||
<P>Gets or sets the size of the text in the input field.
|
||||
|
||||
<H4><A name="Fl_Input.cursor_color">Fl_Color Fl_Input::cursor_color()
|
||||
const
|
||||
<BR>void Fl_Input::cursor_color(Fl_Color)</A></H4>
|
||||
|
||||
<P>Get or set the color of the cursor. This is black by default.
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
Reference in New Issue
Block a user