From c56bb65a9752613a564fac18f0086053edde1ece Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 8 May 2002 12:44:52 +0000 Subject: [PATCH] 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 --- documentation/Fl_Input.html | 224 ++++++++++++++---------- documentation/Fl_Input_.html | 329 +++++++++++++++++++++-------------- src/Makefile | 10 +- 3 files changed, 341 insertions(+), 222 deletions(-) diff --git a/documentation/Fl_Input.html b/documentation/Fl_Input.html index 504bf0697..aba00ad86 100644 --- a/documentation/Fl_Input.html +++ b/documentation/Fl_Input.html @@ -1,10 +1,15 @@ - + + + +

class Fl_Input

+
+

Class Hierarchy

- +

Include Files

- +

Description

-

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. + +

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.

@@ -240,6 +246,7 @@ inserted.
@@ -260,78 +267,115 @@ inserted.
-

Fl_Input::Fl_Input(int x, int y, int w, -int h, const char *label = 0)

- Creates a new Fl_Input widget using the given position, size, -and label string. The default boxtype is FL_DOWN_BOX. -

virtual Fl_Input::~Fl_Input()

- Destroys the widget and any value associated with it. -

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

- 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. -

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 -NULL 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.

-

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

- Change the text and set the mark and the point to the end of it. The -string is not 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 Fl_Input is destroyed or value() is called -again. -

int Fl_Input::size() const

- Returns the number of characters in value(). This may be -greater than strlen(value()) if there are nul characters in -it. -

char Fl_Input::index(int) const

- Same as value()[n], but may be faster in plausible -implementations. No bounds checking is done. -

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

- Controls when callbacks are done. The following values are useful, -the default value is FL_WHEN_RELEASE: - -

Fl_Color Fl_Input::textcolor() const -
void Fl_Input::textcolor(Fl_Color)

- Gets or sets the color of the text in the input field. -

Fl_Font Fl_Input::textfont() const -
void Fl_Input::textfont(Fl_Font)

- Gets or sets the font of the text in the input field. -

uchar Fl_Input::textsize() const -
void Fl_Input::textsize(uchar)

- Gets or sets the size of the text in the input field. -

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

- Get or set the color of the cursor. This is black by default. - +

Fl_Input::Fl_Input(int x, int y, int w, +int h, const char *label = 0)

+ +

Creates a new Fl_Input widget using the given position, size, +and label string. The default boxtype is FL_DOWN_BOX. + +

virtual Fl_Input::~Fl_Input()

+ +

Destroys the widget and any value associated with it. + +

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

+ +

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. + +

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 NULL 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.

+ +

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

+ +

Change the text and set the mark and the point to the end of +it. The string is not 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 +Fl_Input is destroyed or value() is called +again. + +

int Fl_Input::size() const

+ +

Returns the number of characters in value(). This +may be greater than strlen(value()) if there are nul +characters in it. + +

char Fl_Input::index(int) const

+ +

Same as value()[n], but may be faster in plausible +implementations. No bounds checking is done. + +

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

+ +

Controls when callbacks are done. The following values are useful, +the default value is FL_WHEN_RELEASE: + +

+ +

Fl_Color Fl_Input::textcolor() const +
void Fl_Input::textcolor(Fl_Color)

+ +

Gets or sets the color of the text in the input field. + +

Fl_Font Fl_Input::textfont() const +
void Fl_Input::textfont(Fl_Font)

+ +

Gets or sets the font of the text in the input field. + +

uchar Fl_Input::textsize() const +
void Fl_Input::textsize(uchar)

+ +

Gets or sets the size of the text in the input field. + +

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

+ +

Get or set the color of the cursor. This is black by default. + + + diff --git a/documentation/Fl_Input_.html b/documentation/Fl_Input_.html index 3cab358cb..34858f636 100644 --- a/documentation/Fl_Input_.html +++ b/documentation/Fl_Input_.html @@ -1,176 +1,247 @@ - + + + +

class Fl_Input_

+
+

Class Hierarchy

- +

Include Files

- +

Description

-This is a virtual base class below -Fl_Input. It has all the same interfaces, but lacks the -handle() and draw() method. You may want to subclass it -if you are one of those people who likes to change how the editing keys + +

This is a virtual base class below Fl_Input. It has all +the same interfaces, but lacks the handle() and +draw() method. You may want to subclass it if you are +one of those people who likes to change how the editing keys work. -

This can act like any of the subclasses of Fl_Input, by setting -type() to one of the following values:

- +

Methods

+
- -
+ +
- + - + - + - +
-

Fl_Input_::Fl_Input_(int x, int y, int + +

Fl_Input_::Fl_Input_(int x, int y, int w, int h, const char *label = 0)

- Creates a new Fl_Input_ widget using the given position, -size, and label string. The default boxtype is FL_DOWN_BOX. -

virtual Fl_Input_::~Fl_Input_()

- The destructor removes the widget and any value associated with it. -

int Fl_Input_::wordboundary(int i) + +

Creates a new Fl_Input_ widget using the given +position, size, and label string. The default boxtype is +FL_DOWN_BOX. + +

virtual Fl_Input_::~Fl_Input_()

+ +

The destructor removes the widget and any value associated with it. + +

int Fl_Input_::wordboundary(int i) const

- Returns true if position i is at the start or end of a word. -

int Fl_Input_::lineboundary(int i) + +

Returns true if position i is at the start or end of a word. + +

int Fl_Input_::lineboundary(int i) const

- Returns true if position i is at the start or end of a line. -

void Fl_Input_::drawtext(int,int,int,int) -

- Draw the text in the passed bounding box. If damage() -FL_DAMAGE_ALL is true, this assumes the area has already been -erased to color(). Otherwise it does minimal update and -erases the area itself. -

void Fl_Input_::handletext(int + +

Returns true if position i is at the start or end of a line. + +

void Fl_Input_::drawtext(int,int,int,int)

+ +

Draw the text in the passed bounding box. If damage() +& FL_DAMAGE_ALL is true, this assumes the area has +already been erased to color(). Otherwise it does +minimal update and erases the area itself. + +

void Fl_Input_::handletext(int e,int,int,int,int)

- Default handler for all event types. Your handle() method -should call this for all events that it does not handle completely. - You must pass it the same bounding box as passed to draw(). - Handles FL_PUSH, FL_DRAG, FL_RELEASE to -select text, handles FL_FOCUS and FL_UNFOCUS to show -and hide the cursor. -

int + +

Default handler for all event types. Your handle() +method should call this for all events that it does not handle +completely. You must pass it the same bounding box as passed to +draw(). Handles FL_PUSH, FL_DRAG, +FL_RELEASE to select text, handles FL_FOCUS +and FL_UNFOCUS to show and hide the cursor. + +

int Fl_Input_::up_down_position(int i, int keepmark=0)

- Do the correct thing for arrow keys. Sets the position (and mark if -keepmark is zero) to somewhere in the same line as i, such -that pressing the arrows repeatedly will cause the point to move up and -down. -

void + +

Do the correct thing for arrow keys. Sets the position (and +mark if keepmark is zero) to somewhere in the same line +as i, such that pressing the arrows repeatedly will cause +the point to move up and down. + +

void Fl_Input_::maybe_do_callback()

- Does the callback if changed() is true or if when() -FL_WHEN_NOT_CHANGED is non-zero. You should call this at any -point you think you should generate a callback. + +

Does the callback if changed() is true or if +when() & FL_WHEN_NOT_CHANGED is non-zero. You +should call this at any point you think you should generate a +callback. +

void Fl_Input_::maximum_size(int m)
int Fl_Input_::maximum_size() const

+

Sets or returns the maximum length of the input field. -

int Fl_Input_::position() const -
int Fl_Input_::position(int new_position, int new_mark) -
int Fl_Input_::position(int new_position_and_new_mark)

- The input widget maintains two pointers into the string. The -"position" is where the cursor is. The "mark" is the other end of the -selected text. If they are equal then there is no selection. Changing -this does not affect the clipboard (use copy() to do that). -

Changing these values causes a redraw(). The new values -are bounds checked. The return value is non-zero if the new position -is different than the old one. position(n) is the same as -position(n,n). mark(n) is the same as -position(position(),n).

-

int Fl_Input_::mark() const + +

int Fl_Input_::position() const +
int Fl_Input_::position(int new_position, int new_mark) +
int Fl_Input_::position(int new_position_and_new_mark)

+ +

The input widget maintains two pointers into the string. The +"position" is where the cursor is. The +"mark" is the other end of the selected text. If they +are equal then there is no selection. Changing this does not +affect the clipboard (use copy() to do that). + +

Changing these values causes a redraw(). The new +values are bounds checked. The return value is non-zero if the +new position is different than the old one. position(n) +is the same as position(n,n). mark(n) is the +same as position(position(),n).

+ +

int Fl_Input_::mark() const
int Fl_Input_::mark(int new_mark)

- Gets or sets the current selection mark. mark(n) is the same -as position(position(),n). -

int Fl_Input_::replace(int a, int b, + +

Gets or sets the current selection mark. mark(n) is +the same as position(position(),n). + +

int Fl_Input_::replace(int a, int b, const char *insert, int length=0)

- This call does all editing of the text. It deletes the region between -a and b (either one may be less or equal to the other), -and then inserts the string insert at that point and leaves -the mark() and position() after the insertion. Does -the callback if when() FL_WHEN_CHANGED and there is a change. -

Set start and end equal to not delete anything. - Set insert to NULL to not insert anything.

-

length must be zero or strlen(insert), this saves -a tiny bit of time if you happen to already know the length of the -insertion, or can be used to insert a portion of a string or a string -containing nul's.

-

a and b are clamped to the 0..size() - range, so it is safe to pass any values.

-

cut() and insert() are just inline functions that -call replace().

-

int Fl_Input_::cut() + +

This call does all editing of the text. It deletes the region +between a and b (either one may be less or +equal to the other), and then inserts the string insert +at that point and leaves the mark() and +position() after the insertion. Does the callback if +when() & FL_WHEN_CHANGED and there is a change. + +

Set start and end equal to not delete +anything. Set insert to NULL to not insert +anything.

+ +

length must be zero or strlen(insert), this +saves a tiny bit of time if you happen to already know the +length of the insertion, or can be used to insert a portion of a +string or a string containing nul's.

+ +

a and b are clamped to the +0..size() range, so it is safe to pass any values.

+ +

cut() and insert() are just inline +functions that call replace().

+ +

int Fl_Input_::cut()
int Fl_Input_::cut(int n)
int Fl_Input_::cut(int a, int b);

-Fl_Input_::cut() deletes the current selection. cut(n) - deletes n characters after the position(). -cut(-n) deletes n characters before the position() -. cut(a,b) deletes the characters between offsets a - and b. A, b, and n are all clamped -to the size of the string. The mark and point are left where the -deleted text was. -

If you want the data to go into the clipboard, do -Fl_Input_::copy() before calling Fl_Input_::cut(), or do -Fl_Input_::copy_cuts() afterwards.

-

int Fl_Input_::insert(const char *t,int + +

Fl_Input_::cut() deletes the current selection. +cut(n) deletes n characters after the +position(). cut(-n) deletes n +characters before the position(). cut(a,b) +deletes the characters between offsets a and +b. A, b, and n are all +clamped to the size of the string. The mark and point are left +where the deleted text was. + +

If you want the data to go into the clipboard, do +Fl_Input_::copy() before calling +Fl_Input_::cut(), or do Fl_Input_::copy_cuts() +afterwards.

+ +

int Fl_Input_::insert(const char *t,int l=0)

- Insert the string t at the current position, and leave the -mark and position after it. If l is not zero then it is -assumed to be strlen(t). -

int Fl_Input_::copy()

- Put the current selection between mark() and position() - into the clipboard. Does not replace the old clipboard contents if -position() and mark() are equal. -

int Fl_Input_::undo()

- Does undo of several previous calls to replace(). Returns -non-zero if any change was made. -

int Fl_Input_::copy_cuts()

- Copy all the previous contiguous cuts from the undo information to the -clipboard. This is used to make ^K work. + +

Insert the string t at the current position, and +leave the mark and position after it. If l is not zero +then it is assumed to be strlen(t). + +

int Fl_Input_::copy()

+ +

Put the current selection between mark() and +position() into the clipboard. Does not replace the +old clipboard contents if position() and +mark() are equal. + +

int Fl_Input_::undo()

+ +

Does undo of several previous calls to replace(). +Returns non-zero if any change was made. + +

int Fl_Input_::copy_cuts()

+ +

Copy all the previous contiguous cuts from the undo +information to the clipboard. This is used to make ^K work. + +

int Fl_Input::input_type() const +
void Fl_Input::input_type(int)

+ +

Gets or sets the input field type. + +

int Fl_Input::readonly() const +
void Fl_Input::readonly(int)

+ +

Gets or sets the read-only state of the input field. + + + diff --git a/src/Makefile b/src/Makefile index d446616dc..5edf01141 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.18.2.14.2.41 2002/04/30 21:50:16 easysw Exp $" +# "$Id: Makefile,v 1.18.2.14.2.42 2002/05/08 12:44:52 easysw Exp $" # # Library makefile for the Fast Light Tool Kit (FLTK). # @@ -239,7 +239,11 @@ libfltk_gl_s.a: $(GLOBJECTS) chmod +x libfltk_gl_s.a clean : - -@ rm -f *.o $(DSONAME) $(GLDSONAME) $(LIBRARY) $(CLEAN) libfltk.so libfltk_gl.so + -@ rm -f *.o $(DSONAME) $(FLDSONAME) $(GLDSONAME) \ + ../lib/$(LIBNAME) ../lib/$(FLLIBNAME) ../lib/$(GLLIBNAME) \ + libfltk.so libfltk_forms.so libfltk_gl.so \ + libfltk.sl libfltk_forms.sl libfltk_gl.sl \ + $(CLEAN) depend: $(CPPFILES) $(FLCPPFILES) $(GLCPPFILES) $(CFILES) makedepend -Y -I.. -f makedepend $(CPPFILES) $(GLCPPFILES) $(CFILES) @@ -429,5 +433,5 @@ uninstall: # -# End of "$Id: Makefile,v 1.18.2.14.2.41 2002/04/30 21:50:16 easysw Exp $". +# End of "$Id: Makefile,v 1.18.2.14.2.42 2002/05/08 12:44:52 easysw Exp $". #