From c56bb65a9752613a564fac18f0086053edde1ece Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 8 May 2002 12:44:52 +0000 Subject: 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 | 329 ++++++++++++++++++++++++++----------------- 1 file changed, 200 insertions(+), 129 deletions(-) (limited to 'documentation/Fl_Input_.html') 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. + + + -- cgit v1.2.3