From 09daf20b81cdae78772f07c0af22a571d7cc73eb Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 29 Nov 2001 19:24:00 +0000 Subject: Documentation updates galore (up to chapter 7, still need to do chapter 8 and 9, tweek the appendices, and recapture the screenshots...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/Fl_Widget.html | 188 +++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 94 deletions(-) (limited to 'documentation/Fl_Widget.html') diff --git a/documentation/Fl_Widget.html b/documentation/Fl_Widget.html index 394b49c21..99c20db3c 100644 --- a/documentation/Fl_Widget.html +++ b/documentation/Fl_Widget.html @@ -19,15 +19,15 @@

Description

-Fl_Widget is the base class for all widgets in FLTK. You can't -create one of these because the constructor is not public. However you -can subclass it. +Fl_Widget is the base class for all widgets in FLTK. You can't +create one of these because the constructor is not public. However you +can subclass it.

All "property" accessing methods, such as color(), -parent(), or argument() are implemented as trivial inline -functions and thus are as fast and small as accessing fields in a +parent(), or argument() are implemented as trivial inline +functions and thus are as fast and small as accessing fields in a structure. Unless otherwise noted, the property setting methods such as -color(n) or label(s) are also trivial inline functions, -even if they change the widget's appearance. It is up to the user code +color(n) or label(s) are also trivial inline functions, +even if they change the widget's appearance. It is up to the user code to call redraw() after these.

Methods

@@ -95,81 +95,81 @@ to call redraw() after these.

-

Fl_Widget::Fl_Widget(int x, int y, int w, int h, const char* +

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

- This is the protected constructor for an Fl_Widget, but all derived -widgets have a matching public constructor. It takes a value for x(), -y(), w(), h(), and an optional value for label(). + This is the protected constructor for an Fl_Widget, but all derived +widgets have a matching public constructor. It takes a value for x(), +y(), w(), h(), and an optional value for label().

virtual Fl_Widget::~Fl_Widget();

- Destroying single widgets is not very common. It is your -responsibility to either remove() them from any enclosing group, or to -destroy that group immediately after destroying the children. + Destroying single widgets is not very common. It is your +responsibility to either remove() them from any enclosing group, or to +destroy that group immediately after destroying the children.

uchar Fl_Widget::type() const;

- This value is used for Forms compatability and to simulate RTTI. + This value is used for Forms compatability and to simulate RTTI.

short Fl_Widget::x() const
short Fl_Widget::y() const
short Fl_Widget::w() const
short Fl_Widget::h() const

- The position of the upper-left corner of the widget in its enclosing -Fl_Window (not its parent if that is not an Fl_Window), and its -width and height. -

virtual void + The position of the upper-left corner of the widget in its enclosing +Fl_Window (not its parent if that is not an Fl_Window), and its +width and height. +

virtual void Fl_Widget::resize(int x, int y, int w, int h)
void Fl_Widget::position(short x, short y)
void Fl_Widget::size(short w, short h)

- Change the size or position of the widget. This is a virtual function -so the widget may implement its own handling of resizing. The default -version does not do redraw(), that is the parent widget's -responsibility (this is because the parent may know a faster way to -update the display, such as scrolling from the old position). + Change the size or position of the widget. This is a virtual function +so the widget may implement its own handling of resizing. The default +version does not do redraw(), that is the parent widget's +responsibility (this is because the parent may know a faster way to +update the display, such as scrolling from the old position).

position(x,y) is a shortcut for resize(x,y,w(),h()) , and size(w,h) is a shortcut for resize(x(),y(),w,h) .

Fl_Window* Fl_Widget::window() const;

Return a pointer to the Fl_Window - that this widget is in (it will skip any and all parent widgets -between this and the window). Returns NULL if none. Note: -for an Fl_Window, this returns its parent window (if -any), not this window. + that this widget is in (it will skip any and all parent widgets +between this and the window). Returns NULL if none. Note: +for an Fl_Window, this returns its parent window (if +any), not this window.

Fl_Boxtype Fl_Widget::box() const
void Fl_Widget::box(Fl_Boxtype)

- The box() identifies a routine that draws the background of -the widget. See Box Types for the + The box() identifies a routine that draws the background of +the widget. See Box Types for the available types. The default depends on the widget, but is usually -FL_NO_BOX or FL_UP_BOX. +FL_NO_BOX or FL_UP_BOX.

Fl_Color Fl_Widget::color() const
void Fl_Widget::color(Fl_Color)

- This color is passed to the box routine. Color is an index into an + This color is passed to the box routine. Color is an index into an internal table of rgb colors. For most widgets this defaults to FL_GRAY. See the enumeration list for predefined colors. Use -Fl::set_color() to redefine colors. -

Fl_Color +Fl::set_color() to redefine colors. +

Fl_Color Fl_Widget::selection_color() const
void Fl_Widget::selection_color(Fl_Color)

void Fl_Widget::color(Fl_Color, Fl_Color)

- For Forms compatibility a second color is defined. This is usually -used to color the widget when it is selected, although some widgets use + For Forms compatibility a second color is defined. This is usually +used to color the widget when it is selected, although some widgets use this color for other purposes. You can set both colors at once with -color(a,b). +color(a,b).

const char* Fl_Widget::label() const
void Fl_Widget::label(const char*)

- The label is printed somewhere on the widget or next to it. The -string is not copied, the passed pointer is stored unchanged in -the widget. -

void Fl_Widget::label(Fl_Labeltype, + The label is printed somewhere on the widget or next to it. The +string is not copied, the passed pointer is stored unchanged in +the widget. +

void Fl_Widget::label(Fl_Labeltype, const char*)
uchar Fl_Widget::labeltype() const
void Fl_Widget::labeltype(Fl_Labeltype)

- A labeltype identifies a routine that -draws the label of the widget. This can be used for special effects -such as emboss, or to use the label() pointer as another form -of data such as a bitmap. The value FL_NORMAL_LABEL prints -the label as text. + A labeltype identifies a routine that +draws the label of the widget. This can be used for special effects +such as emboss, or to use the label() pointer as another form +of data such as a bitmap. The value FL_NORMAL_LABEL prints +the label as text.

Fl_Align Fl_Widget::align() const
void Fl_Widget::align(Fl_Align)

- How the label is printed next to or inside the widget. The default -value is FL_ALIGN_CENTER, which centers the label. The value + How the label is printed next to or inside the widget. The default +value is FL_ALIGN_CENTER, which centers the label. The value can be any of these constants or'd together:

Fl_Color Fl_Widget::labelcolor() const
void Fl_Widget::labelcolor(Fl_Color)

- This color is passed to the labeltype routine, and is typically the -color of the label text. This defaults to FL_BLACK. + This color is passed to the labeltype routine, and is typically the +color of the label text. This defaults to FL_BLACK.

Fl_Font Fl_Widget::labelfont() const
void Fl_Widget::labelfont(Fl_Font)

Fonts are identified by small 8-bit indexes into a table. See the -enumeration list for predefined typefaces. The default value uses a +enumeration list for predefined typefaces. The default value uses a Helvetica typeface (Arial for Microsoft® Windows®). The function -Fl::set_font() can define new typefaces. +Fl::set_font() can define new typefaces.

uchar Fl_Widget::labelsize() const
void Fl_Widget::labelsize(uchar)

- Fonts are further identified by a point size. The default is 14. -

typedef void (Fl_Callback)(Fl_Widget*, + Fonts are further identified by a point size. The default is 14. +

typedef void (Fl_Callback)(Fl_Widget*, void*)
Fl_Callback* Fl_Widget::callback() const
void Fl_Widget::callback(Fl_Callback*, void* = 0)

- Each widget has a single callback. You can set it or examine it with -these methods. + Each widget has a single callback. You can set it or examine it with +these methods.

void* Fl_Widget::user_data() const
void Fl_Widget::user_data(void*)

- You can also just change the void * second argument to the -callback with the user_data methods. -

void Fl_Widget::callback(void + You can also just change the void * second argument to the +callback with the user_data methods. +

void Fl_Widget::callback(void (*)(Fl_Widget*, long), long = 0)
long Fl_Widget::argument() const
void Fl_Widget::argument(long)

- For convenience you can also define the callback as taking a long + For convenience you can also define the callback as taking a long argument. This is implemented by casting this to a Fl_Callback - and casting the long to a void * and may not be -portable to some machines. + and casting the long to a void * and may not be +portable to some machines.

void Fl_Widget::callback(void (*)(Fl_Widget*))

- For convenience you can also define the callback as taking only one + For convenience you can also define the callback as taking only one argument. This is implemented by casting this to a Fl_Callback - and may not be portable to some machines. + and may not be portable to some machines.

void Fl_Widget::do_callback()
void Fl_Widget::do_callback(Fl_Widget*, void* = 0)
void Fl_Widget::do_callback(Fl_Widget*, long)

- You can cause a widget to do its callback at any time, and even pass -arbitrary arguments. + You can cause a widget to do its callback at any time, and even pass +arbitrary arguments.

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

-Fl_Widget::changed() is a flag that is turned on when the user -changes the value stored in the widget. This is only used by -subclasses of Fl_Widget that store values, but is in the base +Fl_Widget::changed() is a flag that is turned on when the user +changes the value stored in the widget. This is only used by +subclasses of Fl_Widget that store values, but is in the base class so it is easier to scan all the widgets in a panel and -do_callback() on the changed ones in response to an "OK" button. -

Most widgets turn this flag off when they do the callback, and when +do_callback() on the changed ones in response to an "OK" button. +

Most widgets turn this flag off when they do the callback, and when the program sets the stored value.

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

Fl_Widget::when() is a set of bitflags used by subclasses of -Fl_Widget to decide when to do the callback. If the value is zero -then the callback is never done. Other values are described in the -individual widgets. This field is in the base class so that you can -scan a panel and do_callback() on all the ones that don't do -their own callbacks in response to an "OK" button. -

static void +Fl_Widget to decide when to do the callback. If the value is zero +then the callback is never done. Other values are described in the +individual widgets. This field is in the base class so that you can +scan a panel and do_callback() on all the ones that don't do +their own callbacks in response to an "OK" button. +

static void Fl_Widget::default_callback(Fl_Widget*, void*)

- The default callback, which puts a pointer to the widget on the queue + The default callback, which puts a pointer to the widget on the queue returned by Fl::readqueue() -. You may want to call this from your own callback. +. You may want to call this from your own callback.

int Fl_Widget::visible() const
int Fl_Widget::visible_r() const
void Fl_Widget::show()
@@ -252,12 +252,12 @@ An invisible widget never gets redrawn and does not get events. The visible() method returns true if the widget is set to be visible.The visible_r() method returns true if the widget and all of its parents are visible. A widget is only visible if -visible() is true on it and all of its parents. +visible() is true on it and all of its parents.

Changing it will send FL_SHOW or FL_HIDE -events to the widget. Do not change it if the parent is not +events to the widget. Do not change it if the parent is not visible, as this will send false FL_SHOW or FL_HIDE - events to the widget. redraw() is called if necessary on -this or the parent. + events to the widget. redraw() is called if necessary on +this or the parent.

int Fl_Widget::active() const
int Fl_Widget::active_r() const
void Fl_Widget::activate()
@@ -284,11 +284,11 @@ displays rather than input devices. This is the same as (active() && visible() && !output()) but is faster.

void Fl_Widget::redraw()

- Mark the widget as needing its draw() routine called. + Mark the widget as needing its draw() routine called.

uchar Fl_Widget::damage() const

- Non-zero if draw() needs to be called. Actually this is a -bit field that the widget subclass can use to figure out what parts to -draw. + Non-zero if draw() needs to be called. Actually this is a +bit field that the widget subclass can use to figure out what parts to +draw.

Fl_Group *Fl_Widget::parent() const

Returns a pointer to the parent widget. Usually this is a Fl_Group or Fl_Window. Returns

int Fl_Widget::contains(Fl_Widget* b) const

Returns true if b is a child of this widget, or is equal to -this widget. Returns false if b is NULL. -

int Fl_Widget::inside(const Fl_Widget* a) +this widget. Returns false if b is NULL. +

int Fl_Widget::inside(const Fl_Widget* a) const

Returns true if this is a child of a, or is equal to a -. Returns false if a is NULL. +. Returns false if a is NULL.

int Fl_Widget::take_focus()

- Tries to make this widget be the Fl::focus() widget, by first -sending it an FL_FOCUS event, and if it returns non-zero, -setting Fl::focus() to this widget. You should use this -method to assign the focus to an widget. Returns true if the widget + Tries to make this widget be the Fl::focus() widget, by first +sending it an FL_FOCUS event, and if it returns non-zero, +setting Fl::focus() to this widget. You should use this +method to assign the focus to an widget. Returns true if the widget accepted the focus. -- cgit v1.2.3