summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Menu_Item.H145
-rw-r--r--FL/Fl_Tabs.H15
-rw-r--r--FL/Fl_Widget.H847
-rw-r--r--src/Fl_Browser.cxx62
-rw-r--r--src/Fl_Gl_Overlay.cxx2
-rw-r--r--src/Fl_Gl_Window.cxx2
-rw-r--r--src/Fl_Menu_add.cxx2
-rw-r--r--src/Fl_Preferences.cxx2
-rw-r--r--src/Fl_Tabs.cxx6
-rw-r--r--src/Fl_Widget.cxx8
-rw-r--r--src/Fl_mac.cxx4
-rw-r--r--src/fl_boxtype.cxx2
-rw-r--r--src/fl_diamond_box.cxx2
-rw-r--r--src/fl_dnd_win32.cxx2
-rw-r--r--src/fl_draw_image_win32.cxx2
-rw-r--r--src/fl_font_xft.cxx4
-rw-r--r--src/fl_gtk.cxx2
-rw-r--r--src/fl_labeltype.cxx12
-rw-r--r--src/fl_oval_box.cxx2
-rw-r--r--src/fl_plastic.cxx2
-rw-r--r--src/fl_round_box.cxx2
-rw-r--r--src/fl_set_fonts_x.cxx2
22 files changed, 599 insertions, 530 deletions
diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H
index 353c6e22e..dc67dd6d2 100644
--- a/FL/Fl_Menu_Item.H
+++ b/FL/Fl_Menu_Item.H
@@ -101,57 +101,64 @@ class Fl_Menu_;
{0}};
\endcode
produces:
- <P ALIGN=CENTER>\image html menu.gif </P>
+
+ \image html menu.gif
\image latex menu.eps "menu" width=10cm
+
A submenu title is identified by the bit FL_SUBMENU in the
flags field, and ends with a label() that is NULL.
You can nest menus to any depth. A pointer to the first item in the
submenu can be treated as an Fl_Menu array itself. It is also
- possible to make seperate submenu arrays with FL_SUBMENU_POINTER
- flags.
- <P>You should use the method functions to access structure members and
+ possible to make separate submenu arrays with FL_SUBMENU_POINTER flags.
+
+ You should use the method functions to access structure members and
not access them directly to avoid compatibility problems with future
releases of FLTK.
*/
struct FL_EXPORT Fl_Menu_Item {
const char *text; ///< menu item text, returned by label()
- int shortcut_; ///< menu item shortcut
- Fl_Callback *callback_; ///< menu item callback
- void *user_data_; ///< menu item user_data for 3rd party apps
- int flags; ///< menu item flags like FL_MENU_TOGGLE,FL_MENU_RADIO
- uchar labeltype_; ///< how the menu item text looks like
- Fl_Font labelfont_; ///< which font for this menu item text
- Fl_Fontsize labelsize_; ///< size of menu item text
- unsigned labelcolor_; ///< menu item text color
+ int shortcut_; ///< menu item shortcut
+ Fl_Callback *callback_; ///< menu item callback
+ void *user_data_; ///< menu item user_data for 3rd party apps
+ int flags; ///< menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
+ uchar labeltype_; ///< how the menu item text looks like
+ Fl_Font labelfont_; ///< which font for this menu item text
+ Fl_Fontsize labelsize_; ///< size of menu item text
+ unsigned labelcolor_; ///< menu item text color
// advance N items, skipping submenus:
const Fl_Menu_Item *next(int=1) const;
+
/**
- Advance a pointer by n items through a menu array, skipping
- the contents of submenus and invisible items. There are two calls so
+ Advances a pointer by n items through a menu array, skipping
+ the contents of submenus and invisible items. There are two calls so
that you can advance through const and non-const data.
*/
Fl_Menu_Item *next(int i=1) {
return (Fl_Menu_Item*)(((const Fl_Menu_Item*)this)->next(i));}
+
/** Returns the first menu item, same as next(0). */
const Fl_Menu_Item *first() const { return next(0); }
+
/** Returns the first menu item, same as next(0). */
Fl_Menu_Item *first() { return next(0); }
// methods on menu items:
/**
- This is the title of the item. A NULL here indicates the end
- of the menu (or of a submenu). A '&' in the item will print an
- underscore under the next letter, and if the menu is popped up that
- letter will be a "shortcut" to pick that item. To get a
- real '&' put two
- in a row.
+ Returns the title of the item.
+ A NULL here indicates the end of the menu (or of a submenu).
+ A '&' in the item will print an underscore under the next letter,
+ and if the menu is popped up that letter will be a "shortcut" to pick
+ that item. To get a real '&' put two in a row.
*/
const char* label() const {return text;}
+
/** See const char* Fl_Menu_Item::label() const */
void label(const char* a) {text=a;}
+
/** See const char* Fl_Menu_Item::label() const */
void label(Fl_Labeltype a,const char* b) {labeltype_ = a; text = b;}
+
/**
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
@@ -159,6 +166,7 @@ struct FL_EXPORT Fl_Menu_Item {
The value FL_NORMAL_LABEL prints the label as text.
*/
Fl_Labeltype labeltype() const {return (Fl_Labeltype)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
@@ -166,6 +174,7 @@ struct FL_EXPORT Fl_Menu_Item {
The value FL_NORMAL_LABEL prints the label as text.
*/
void labeltype(Fl_Labeltype a) {labeltype_ = a;}
+
/**
This color is passed to the labeltype routine, and is typically the
color of the label text. This defaults to FL_BLACK. If this
@@ -173,43 +182,49 @@ struct FL_EXPORT Fl_Menu_Item {
the menu - this is so that images put in the menu draw correctly.
*/
Fl_Color labelcolor() const {return (Fl_Color)labelcolor_;}
+
/** See Fl_Color Fl_Menu_Item::labelcolor() const */
void labelcolor(unsigned a) {labelcolor_ = a;}
/**
- Fonts are identified by small 8-bit indexes into a table. See the
+ Fonts are identified by small 8-bit indexes into a table. See the
enumeration list for predefined fonts. The default value is a
- Helvetica font. The function
- Fl::set_font() can define new fonts.
+ Helvetica font. The function Fl::set_font() can define new fonts.
*/
Fl_Font labelfont() const {return labelfont_;}
+
/**
- Fonts are identified by small 8-bit indexes into a table. See the
+ Fonts are identified by small 8-bit indexes into a table. See the
enumeration list for predefined fonts. The default value is a
- Helvetica font. The function
- Fl::set_font() can define new fonts.
+ Helvetica font. The function Fl::set_font() can define new fonts.
*/
void labelfont(Fl_Font a) {labelfont_ = a;}
- /** Gets or sets the label font pixel size/height. */
+
/** Gets the label font pixel size/height.*/
Fl_Fontsize labelsize() const {return labelsize_;}
+
/** Sets the label font pixel size/height.*/
void labelsize(Fl_Fontsize a) {labelsize_ = a;}
/**
Each item has space for a callback function and an argument for that
- function. Due to back compatibility, the Fl_Menu_Item itself
+ function. Due to back compatibility, the Fl_Menu_Item itself
is not passed to the callback, instead you have to get it by calling
- ((Fl_Menu_*)w)-&gt;mvalue() where w is the widget argument.
+ ((Fl_Menu_*)w)->mvalue() where w is the widget argument.
*/
Fl_Callback_p callback() const {return callback_;}
+
/** See Fl_Callback_p Fl_MenuItem::callback() const */
void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;}
+
/** See Fl_Callback_p Fl_MenuItem::callback() const */
void callback(Fl_Callback* c) {callback_=c;}
+
/** See Fl_Callback_p Fl_MenuItem::callback() const */
void callback(Fl_Callback0*c) {callback_=(Fl_Callback*)c;}
+
/** See Fl_Callback_p Fl_MenuItem::callback() const */
void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)p;}
+
/**
Get or set the user_data argument that is sent to the
callback function.
@@ -234,21 +249,24 @@ struct FL_EXPORT Fl_Menu_Item {
portable to some machines.
*/
void argument(long v) {user_data_ = (void*)v;}
+
/** Gets what key combination shortcut will trigger the menu item. */
int shortcut() const {return shortcut_;}
+
/**
Sets exactly what key combination will trigger the menu item. The
value is a logical 'or' of a key and a set of shift flags, for instance
FL_ALT+'a' or FL_ALT+FL_F+10 or just 'a'. A value of
zero disables the shortcut.
- <P>The key can be any value returned by
- Fl::event_key(), but will usually be an ASCII letter. Use
- a lower-case letter unless you require the shift key to be held down. </P>
- <P>The shift flags can be any set of values accepted by
- Fl::event_state(). If the bit is on that shift key must
- be pushed. Meta, Alt, Ctrl, and Shift must be off if they are not in
- the shift flags (zero for the other bits indicates a "don't care"
- setting).
+
+ The key can be any value returned by Fl::event_key(), but will usually
+ be an ASCII letter. Use a lower-case letter unless you require the shift
+ key to be held down.
+
+ The shift flags can be any set of values accepted by Fl::event_state().
+ If the bit is on that shift key must be pushed. Meta, Alt, Ctrl,
+ and Shift must be off if they are not in the shift flags (zero for the
+ other bits indicates a "don't care" setting).
*/
void shortcut(int s) {shortcut_ = s;}
/**
@@ -261,8 +279,7 @@ struct FL_EXPORT Fl_Menu_Item {
int submenu() const {return flags&(FL_SUBMENU|FL_SUBMENU_POINTER);}
/**
Returns true if a checkbox will be drawn next to this item. This is
- true if FL_MENU_TOGGLE or FL_MENU_RADIO is set in the
- flags.
+ true if FL_MENU_TOGGLE or FL_MENU_RADIO is set in the flags.
*/
int checkbox() const {return flags&FL_MENU_TOGGLE;}
/**
@@ -272,26 +289,32 @@ struct FL_EXPORT Fl_Menu_Item {
item with FL_MENU_DIVIDER turned on.
*/
int radio() const {return flags&FL_MENU_RADIO;}
- /** Returns the current value of the check or radio item. */
+ /** Returns the current value of the check or radio item. */
int value() const {return flags&FL_MENU_VALUE;}
/**
Turns the check or radio item "on" for the menu item. Note that this
- does not turn off any adjacent radio items like set_only()
- does.
+ does not turn off any adjacent radio items like set_only() does.
*/
void set() {flags |= FL_MENU_VALUE;}
- /** Turns the check or radio item "off" for the menu item. */
+
+ /** Turns the check or radio item "off" for the menu item. */
void clear() {flags &= ~FL_MENU_VALUE;}
+
void setonly();
- /** Gets the visibility of an item. */
+
+ /** Gets the visibility of an item. */
int visible() const {return !(flags&FL_MENU_INVISIBLE);}
- /** Makes an item visible in the menu. */
+
+ /** Makes an item visible in the menu. */
void show() {flags &= ~FL_MENU_INVISIBLE;}
- /** Hides an item in the menu. */
+
+ /** Hides an item in the menu. */
void hide() {flags |= FL_MENU_INVISIBLE;}
- /** Get whether or not the item can be picked. */
+
+ /** Gets whether or not the item can be picked. */
int active() const {return !(flags&FL_MENU_INACTIVE);}
- /** Allows a menu item to be picked. */
+
+ /** Allows a menu item to be picked. */
void activate() {flags &= ~FL_MENU_INACTIVE;}
/**
Prevents a menu item from being picked. Note that this will also cause
@@ -302,8 +325,10 @@ struct FL_EXPORT Fl_Menu_Item {
int activevisible() const {return !(flags & (FL_MENU_INACTIVE|FL_MENU_INVISIBLE));}
// compatibility for FLUID so it can set the image of a menu item...
+
/** compatibility api for FLUID, same as a->label(this) */
void image(Fl_Image* a) {a->label(this);}
+
/** compatibility api for FLUID, same as a.label(this) */
void image(Fl_Image& a) {a.label(this);}
@@ -327,39 +352,47 @@ struct FL_EXPORT Fl_Menu_Item {
const Fl_Menu_Item* find_shortcut(int *ip=0) const;
/**
- Call the Fl_Menu_Item item's callback, and provide the
- Fl_Widget argument (and optionally override the user_data()
- argument). You must first check that callback() is non-zero
+ Calls the Fl_Menu_Item item's callback, and provides the
+ Fl_Widget argument (and optionally overrides the user_data()
+ argument). You must first check that callback() is non-zero
before calling this.
*/
void do_callback(Fl_Widget* o) const {callback_(o, user_data_);}
+
/**
- Call the Fl_Menu_Item item's callback, and provide the
- Fl_Widget argument (and optionally override the user_data()
- argument). You must first check that callback() is non-zero
+ Calls the Fl_Menu_Item item's callback, and provides the
+ Fl_Widget argument (and optionally overrides the user_data()
+ argument). You must first check that callback() is non-zero
before calling this.
*/
void do_callback(Fl_Widget* o,void* arg) const {callback_(o, arg);}
+
/**
- Call the Fl_Menu_Item item's callback, and provide the
- Fl_Widget argument (and optionally override the user_data()
+ Calls the Fl_Menu_Item item's callback, and provides the
+ Fl_Widget argument (and optionally overrides the user_data()
argument). You must first check that callback() is non-zero
before calling this.
*/
void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)arg);}
// back-compatibility, do not use:
+
/** back compatibility only \deprecated. */
int checked() const {return flags&FL_MENU_VALUE;}
+
/** back compatibility only \deprecated. */
void check() {flags |= FL_MENU_VALUE;}
+
/** back compatibility only \deprecated. */
void uncheck() {flags &= ~FL_MENU_VALUE;}
+
int add(const char*, int shortcut, Fl_Callback*, void* =0, int = 0);
+
/** See int add(const char*, int shortcut, Fl_Callback*, void*, int) */
int add(const char*a, const char* b, Fl_Callback* c,
void* d = 0, int e = 0) {
return add(a,fl_old_shortcut(b),c,d,e);}
+
int size() const ;
};
diff --git a/FL/Fl_Tabs.H b/FL/Fl_Tabs.H
index 17bf1b69f..56100a41b 100644
--- a/FL/Fl_Tabs.H
+++ b/FL/Fl_Tabs.H
@@ -38,24 +38,23 @@
interface that allows you to put lots and lots of buttons and
switches in a panel, as popularized by many toolkits.
- <P ALIGN=CENTER>\image html tabs.gif </P>
- \image latex tabs.eps "Fl_Tabs" width=8cm
+ \image html tabs.gif
+ \image latex tabs.eps "Fl_Tabs" width=8cm
- <P>Clicking the tab makes a child visible() by calling
+ Clicking the tab makes a child visible() by calling
show() on it, and all other children are made invisible
by calling hide() on them. Usually the children are Fl_Group widgets
containing several widgets themselves.
- <P>Each child makes a card, and it's label() is printed
+ Each child makes a card, and its label() is printed
on the card tab, including the label font and style. The
selection color of that child is used to color the tab, while
- the color of the child determines the background color of the
- pane.
+ the color of the child determines the background color of the pane.
- <P>The size of the tabs is controlled by the bounding box of the
+ The size of the tabs is controlled by the bounding box of the
children (there should be some space between the children and
the edge of the Fl_Tabs), and the tabs may be placed
- "inverted" on the bottom, this is determined by which
+ "inverted" on the bottom - this is determined by which
gap is larger. It is easiest to lay this out in fluid, using the
fluid browser to select each child group and resize them until
the tabs look the way you want them to.
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 5f51924e5..c5986e0d0 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -42,18 +42,18 @@ class Fl_Image;
typedef void (Fl_Callback )(Fl_Widget*, void*);
/** Default callback type pointer definition for all fltk widgets */
typedef Fl_Callback* Fl_Callback_p; // needed for BORLAND
-/** One parameter Callback type definition passing only the widget */
+/** One parameter callback type definition passing only the widget */
typedef void (Fl_Callback0)(Fl_Widget*);
/** Callback type definition passing the widget and a long data value */
typedef void (Fl_Callback1)(Fl_Widget*, long);
/** This struct stores all information for a text or mixed graphics label.
- *
- * \todo For FLTK1.3, the Fl_Label type will become a widget by itself. That way
- * we will be avoiding a lot of code duplication by handling labels in
- * a similar fashion to widgets containing text. We also provide an easy
- * interface for very complex labels, containing html or vector graphics.
+
+ \todo For FLTK 1.3, the Fl_Label type will become a widget by itself. That way
+ we will be avoiding a lot of code duplication by handling labels in
+ a similar fashion to widgets containing text. We also provide an easy
+ interface for very complex labels, containing html or vector graphics.
*/
struct FL_EXPORT Fl_Label {
/** label text */
@@ -70,23 +70,23 @@ struct FL_EXPORT Fl_Label {
Fl_Fontsize size;
/** text color */
unsigned color;
- /** draw the label aligned to the given box */
+ /** Draws the label aligned to the given box */
void draw(int,int,int,int, Fl_Align) const ;
void measure(int &w, int &h) const ;
};
/** 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 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 to call
- * redraw() after these.
+
+ 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 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 to call redraw() after these.
*/
class FL_EXPORT Fl_Widget {
friend class Fl_Group;
@@ -114,24 +114,25 @@ class FL_EXPORT Fl_Widget {
protected:
- /** Creates a widget at the given position and size.
- * The Fl_Widget is a protected constructor, but all derived widgets have a
- * matching public constructor. It takes a value for x(), y(), w(), h(), and
- * an optional value for label().
- *
- * \param[in] x, y the position of the widget relative to the enclosing window
- * \param[in] w, h size of the widget in pixels
- * \param[in] label optional text for the widget label
+ /** Creates a widget at the given position and size.
+
+ The Fl_Widget is a protected constructor, but all derived widgets have a
+ matching public constructor. It takes a value for x(), y(), w(), h(), and
+ an optional value for label().
+
+ \param[in] x, y the position of the widget relative to the enclosing window
+ \param[in] w, h size of the widget in pixels
+ \param[in] label optional text for the widget label
*/
Fl_Widget(int x, int y, int w, int h, Fl_CString label=0L);
- /** Internal use only. Use position(int,int), size(int, int) or resize(int,int,int,int) instead. */
+ /** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
void x(int v) {x_ = v;}
- /** Internal use only. Use position(int,int), size(int, int) or resize(int,int,int,int) instead. */
+ /** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
void y(int v) {y_ = v;}
- /** Internal use only. Use position(int,int), size(int, int) or resize(int,int,int,int) instead. */
+ /** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
void w(int v) {w_ = v;}
- /** Internal use only. Use position(int,int), size(int, int) or resize(int,int,int,int) instead. */
+ /** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
void h(int v) {h_ = v;}
/** Gets the widget flags mask */
int flags() const {return flags_;}
@@ -140,7 +141,7 @@ protected:
/** Clears a flag in the flags mask */
void clear_flag(int c) {flags_ &= ~c;}
/** flags possible values enumeration.
- See activate(),output(), visible(), changed(), set_visible_focus()
+ See activate(), output(), visible(), changed(), set_visible_focus()
*/
enum {
INACTIVE=1, ///< the widget can't receive focus, and is disabled but potentially visible
@@ -149,7 +150,7 @@ protected:
SHORTCUT_LABEL=64, ///< the label contains a shortcut we need to draw
CHANGED=128, ///< the widget value changed
VISIBLE_FOCUS=512, ///< accepts keyboard focus navigation if the widget can have the focus
- COPIED_LABEL = 1024 ///< the widget label is internally copied, its destruction is handled by the widget
+ COPIED_LABEL=1024 ///< the widget label is internally copied, its destruction is handled by the widget
};
void draw_box() const;
void draw_box(Fl_Boxtype, Fl_Color) const;
@@ -162,378 +163,401 @@ protected:
public:
- /** Destroys the widget.
- * Destroying single widgets is not very common, and it is your responsibility
- * to either remove() them from any enclosing group or destroy that group
- * \em immediately after destroying the children. You almost always want to
- * destroy the parent group instead which will destroy all of the child widgets
- * and groups in that group.
+ /** Destroys the widget.
+ Destroying single widgets is not very common, and it is your responsibility
+ to either remove() them from any enclosing group or destroy that group
+ \em immediately after destroying the children. You almost always want to
+ destroy the parent group instead which will destroy all of the child widgets
+ and groups in that group.
*/
virtual ~Fl_Widget();
- /** Draw the widget.
- * Never call this function directly. FLTK will schedule redrawing whenever
- * needed. If your widget must be redrawn as soon as possible, call redraw()
- * instead.
- *
- * Override this function to draw your own widgets.
+ /** Draws the widget.
+ Never call this function directly. FLTK will schedule redrawing whenever
+ needed. If your widget must be redrawn as soon as possible, call redraw()
+ instead.
+
+ Override this function to draw your own widgets.
*/
virtual void draw() = 0;
/** Handles the specified event.
- * You normally don't call this method directly, but instead let FLTK do
- * it when the user interacts with the widget.
- *
- * When implemented in a new widget, this function must return 0 if the
- * widget does not use the event or 1 otherwise.<BR>
- * Most of the time, you want to call the inherited handle() method in
- * your overriden method so that you don't short-circuit events that you
- * don't handle. In this last case you should return the callee retval.
- *
- * \param[in] event the kind of event received
- * \retval 0 if the event was not used or understood
- * \retval 1 if the event was used and can be deleted
- * \see Fl_Event
+ You normally don't call this method directly, but instead let FLTK do
+ it when the user interacts with the widget.
+
+ When implemented in a new widget, this function must return 0 if the
+ widget does not use the event or 1 otherwise.
+
+ Most of the time, you want to call the inherited handle() method in
+ your overriden method so that you don't short-circuit events that you
+ don't handle. In this last case you should return the callee retval.
+
+ \param[in] event the kind of event received
+ \retval 0 if the event was not used or understood
+ \retval 1 if the event was used and can be deleted
+ \see Fl_Event
*/
virtual int handle(int event);
/** Returns a pointer to the parent widget.
- * Usually this is a Fl_Group or Fl_Window.
- * \retval NULL if the widget has no parent
- * \see Fl_Group::add(Fl_Widget*)
+ Usually this is a Fl_Group or Fl_Window.
+ \retval NULL if the widget has no parent
+ \see Fl_Group::add(Fl_Widget*)
*/
Fl_Group* parent() const {return parent_;}
- /** Internal use only. Use Fl_Group::add(Fl_Widget*) instead. */
- void parent(Fl_Group* p) {parent_ = p;} // for hacks only, Fl_Group::add()
+ /** Internal use only - "for hacks only".
+
+ It is \em STRONGLY recommended not to use this method, because it
+ short-circuits Fl_Group's normal widget adding and removing methods,
+ if the widget is already a child widget of another Fl_Group.
+
+ Use Fl_Group::add(Fl_Widget*) and/or Fl_Group::remove(Fl_Widget*) instead.
+ */
+ void parent(Fl_Group* p) {parent_ = p;} // for hacks only, use Fl_Group::add()
/** Gets the widget type.
- * Returns the widget type value, which is used for Forms
- * compatibility and to simulate RTTI.
+ Returns the widget type value, which is used for Forms compatibility
+ and to simulate RTTI.
+
+ \todo Explain "simulate RTTI" (currently only used to decide if a widget
+ is a window, i.e. type()>=FL_WINDOW ?). Is type() really used in a way
+ that ensures "Forms compatibility" ?
*/
uchar type() const {return type_;}
/** Sets the widget type.
- * This is used for Forms compatibility.
+ This is used for Forms compatibility.
*/
void type(uchar t) {type_ = t;}
/** Gets the widget position in its window.
- * \return the x position relative to the window
+ \return the x position relative to the window
*/
int x() const {return x_;}
/** Gets the widget position in its window.
- * \return the y position relative to the window
+ \return the y position relative to the window
*/
int y() const {return y_;}
/** Gets the widget width.
- * \return the width of the widget in pixels.
+ \return the width of the widget in pixels.
*/
int w() const {return w_;}
/** Gets the widget height.
- * \return the height of the widget in pixels.
+ \return the height of the widget in pixels.
*/
int h() const {return h_;}
- /** Change the size or position of the widget.
- * This is a virtual function so that the widget may implement its
- * own handling of resizing. The default version does <I>not</I>
- * call the redraw() method, but instead relies on the parent widget
- * to do so because the parent may know a faster way to update the
- * display, such as scrolling from the old position.
- *
- * Some window managers under X11 call resize() a lot more often
- * than needed. Please verify that the position or size of a widget
- * did actually change before doing any extensive calculations.
- *
- * 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).
- *
- * \param[in] x, y new position relative to the parent window
- * \param[in] w, h new size
- * \see position(int, int), size(int, int)
+ /** Changes the size or position of the widget.
+
+ This is a virtual function so that the widget may implement its
+ own handling of resizing. The default version does \e not
+ call the redraw() method, but instead relies on the parent widget
+ to do so because the parent may know a faster way to update the
+ display, such as scrolling from the old position.
+
+ Some window managers under X11 call resize() a lot more often
+ than needed. Please verify that the position or size of a widget
+ did actually change before doing any extensive calculations.
+
+ 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).
+
+ \param[in] x, y new position relative to the parent window
+ \param[in] w, h new size
+ \see position(int,int), size(int,int)
*/
virtual void resize(int x, int y, int w, int h);
/** Internal use only. */
int damage_resize(int,int,int,int);
- /** Reposition the window or widget.
- * position(X,Y) is a shortcut for resize(X,Y,w(),h()).
- *
- * \param[in] X, Y new position relative to the parent window
- * \see resize(int, int, int, int), size(int, int)
+ /** Repositions the window or widget.
+ position(X, Y) is a shortcut for resize(X, Y, w(), h()).
+
+ \param[in] X, Y new position relative to the parent window
+ \see resize(int,int,int,int), size(int,int)
*/
void position(int X,int Y) {resize(X,Y,w_,h_);}
/** Change the size of the widget.
- * size(w,h) is a shortcut for resize(x(),y(),w,h).
- *
- * \param[in] W, H new size
- * \see position(int, int), resize(int, int, int, int)
+ size(W, H) is a shortcut for resize(x(), y(), W, H).
+
+ \param[in] W, H new size
+ \see position(int,int), resize(int,int,int,int)
*/
void size(int W,int H) {resize(x_,y_,W,H);}
/** Gets the label alignment.
- * \return label alignment
- * \see label(), align(Fl_Align), Fl_Align
- * \todo This function should not take uchar as an argument. Apart from the fact that uchar is too short
- * with only 8 bits, it does not provide type safety (in which case we don't need to declare Fl_Type
- * an enum to begin with).
+ \return label alignment
+ \see label(), align(Fl_Align), Fl_Align
+ \todo This function should not take uchar as an argument.
+ Apart from the fact that uchar is too short with only 8 bits,
+ it does not provide type safety (in which case we don't need
+ to declare Fl_Align an enum to begin with).
+ *NOTE* The current (FLTK 1.3) implementation (Dec 2008) is such that
+ Fl_Align is (typedef'd to be) "unsigned" (int), but Fl_Widget's
+ "align_" member variable is a bit field of 8 bits only !
*/
Fl_Align align() const {return align_;}
/** Sets the label alignment.
- * This controls how the label is displayed next to or inside the widget.
- * The default value is FL_ALIGN_CENTER, which centers the label inside the widget.
- * \param[in] alignment new label alignment
- * \see align(), Fl_Align
+ This controls how the label is displayed next to or inside the widget.
+ The default value is FL_ALIGN_CENTER, which centers the label inside
+ the widget.
+ \param[in] alignment new label alignment
+ \see align(), Fl_Align
*/
void align(Fl_Align alignment) {align_ = alignment;}
- /** Gets the box type for the widget.
- * \return the current box type
- * \see box(Fl_Boxtype), Fl_Boxtype
+ /** Gets the box type of the widget.
+ \return the current box type
+ \see box(Fl_Boxtype), Fl_Boxtype
*/
Fl_Boxtype box() const {return (Fl_Boxtype)box_;}
/** Sets the box type for the widget.
- * This identifies a routine that draws the background of the widget.
- * See Fl_Boxtype for the available types. The default depends on the widget,
- * but is usually FL_NO_BOX or FL_UP_BOX.
- * \param[in] new_box the new box type
- * \see box(), Fl_Boxtype
+ This identifies a routine that draws the background of the widget.
+ See Fl_Boxtype for the available types. The default depends on the
+ widget, but is usually FL_NO_BOX or FL_UP_BOX.
+ \param[in] new_box the new box type
+ \see box(), Fl_Boxtype
*/
void box(Fl_Boxtype new_box) {box_ = new_box;}
/** Gets the background color of the widget.
- * \return current background color
- * \see color(unsigned), color(unsigned, unsigned)
+ \return current background color
+ \see color(unsigned), color(unsigned, unsigned)
*/
Fl_Color color() const {return (Fl_Color)color_;}
/** Sets the background color of the widget.
- * The color is passed to the box routine. The color is either an index into an
- * internal table of RGB colors or an RGB color value generated using fl_rgb_color().
- * The default for most widgets is FL_BACKGROUND_COLOR. Use Fl::set_color() to
- * redefine colors in the color map.
- * \param[in] bg background color
- * \see color(), color(unsigned, unsigned), selection_color(unsigned)
+ The color is passed to the box routine. The color is either an index into
+ an internal table of RGB colors or an RGB color value generated using
+ fl_rgb_color().
+
+ The default for most widgets is FL_BACKGROUND_COLOR. Use Fl::set_color()
+ to redefine colors in the color map.
+ \param[in] bg background color
+ \see color(), color(unsigned, unsigned), selection_color(unsigned)
*/
void color(unsigned bg) {color_ = bg;}
/** Gets the selection color.
- * \return the current selection color
- * \see selection_color(unsigned), color(unsigned, unsigned)
+ \return the current selection color
+ \see selection_color(unsigned), color(unsigned, unsigned)
*/
Fl_Color selection_color() const {return (Fl_Color)color2_;}
- /** Gets or sets the selection color.
- * The selection color is defined for Forms compatibility and 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(int, int).
- * \param[in] a the new selection color
- * \see selection_color(), color(unsigned, unsigned)
+ /** Sets the selection color.
+ The selection color is defined for Forms compatibility and 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(unsigned bg, unsigned sel).
+ \param[in] a the new selection color
+ \see selection_color(), color(unsigned, unsigned)
*/
void selection_color(unsigned a) {color2_ = a;}
/** Sets the background and selection color of the widget.
- * The two color form sets both the background and selection colors.
- * \param[in] bg background color
- * \param[in] sel selection color
- * \see color(unsigned), selection_color(unsigned)
+
+ The two color form sets both the background and selection colors.
+ \param[in] bg background color
+ \param[in] sel selection color
+ \see color(unsigned), selection_color(unsigned)
*/
void color(unsigned bg, unsigned sel) {color_=bg; color2_=sel;}
/** Get the current label text.
- * \return a pointer to the current label text
- * \see label(Fl_CString), copy_label(Fl_CString)
+ \return a pointer to the current label text
+ \see label(Fl_CString), copy_label(Fl_CString)
*/
const char* label() const {return label_.value;}
- /** Get or set the current label pointer.
- * The label is shown somewhere on or next to the widget. The passed pointer
- * is stored unchanged in the widget (the string is \em not copied), so if
- * you need to set the label to a formatted value, make sure the buffer is
- * static, global, or allocated. The copy_label() method can be used
- * to make a copy of the label string automatically.
- * \param[in] text pointer to new label text
- * \see copy_label()
+ /** Sets the current label pointer.
+
+ The label is shown somewhere on or next to the widget. The passed pointer
+ is stored unchanged in the widget (the string is \em not copied), so if
+ you need to set the label to a formatted value, make sure the buffer is
+ static, global, or allocated. The copy_label() method can be used
+ to make a copy of the label string automatically.
+ \param[in] text pointer to new label text
+ \see copy_label()
*/
void label(const char* text);
/** Sets the current label.
- * Unlike label(), this method allocates a copy of the label
- * string instead of using the original string pointer.
- * \param[in] new_label the new label text
- * \see label()
+ Unlike label(), this method allocates a copy of the label
+ string instead of using the original string pointer.
+ \param[in] new_label the new label text
+ \see label()
*/
void copy_label(Fl_CString new_label);
/** Shortcut to set the label text and type in one call.
- * \see label(FL_CString), labeltype(Fl_Labeltype)
+ \see label(FL_CString), labeltype(Fl_Labeltype)
*/
- void label(Fl_Labeltype a,const char* b) {label_.type = a; label_.value = b;}
+ void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
/** Gets the label type.
- * \return the current label type.
- * \see Fl_Labeltype
+ \return the current label type.
+ \see Fl_Labeltype
*/
Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;}
/** Sets the label type.
- * The label type identifies the function that draws the label of the widget.
- * This is generally used for special effects such as embossing or for using
- * the label() pointer as another form of data such as an icon. The value
- * FL_NORMAL_LABEL prints the label as plain text.
- * \param[in] a new label type
- * \see Fl_Labeltype
+ The label type identifies the function that draws the label of the widget.
+ This is generally used for special effects such as embossing or for using
+ the label() pointer as another form of data such as an icon. The value
+ FL_NORMAL_LABEL prints the label as plain text.
+ \param[in] a new label type
+ \see Fl_Labeltype
*/
void labeltype(Fl_Labeltype a) {label_.type = a;}
/** Gets the label color.
- * The default color is FL_FOREGROUND_COLOR.
- * \return the current label color
+ The default color is FL_FOREGROUND_COLOR.
+ \return the current label color
*/
Fl_Color labelcolor() const {return (Fl_Color)label_.color;}
/** Sets the label color.
- * The default color is FL_FOREGROUND_COLOR.
- * \param[in] c the new label color
+ The default color is FL_FOREGROUND_COLOR.
+ \param[in] c the new label color
*/
void labelcolor(unsigned c) {label_.color=c;}
/** Gets the font to use.
- * Fonts are identified by indexes into a table. The default value uses a
- * Helvetica typeface (Arial for Microsoft&reg; Windows&reg;). The function
- * Fl::set_font() can define new typefaces.
- * \return current font used by the label
- * \see Fl_Font
+ Fonts are identified by indexes into a table. The default value uses a
+ Helvetica typeface (Arial for Microsoft&reg; Windows&reg;). The function
+ Fl::set_font() can define new typefaces.
+ \return current font used by the label
+ \see Fl_Font
*/
Fl_Font labelfont() const {return label_.font;}
/** Sets the font to use.
- * Fonts are identified by indexes into a table. The default value uses a
- * Helvetica typeface (Arial for Microsoft&reg; Windows&reg;). The function
- * Fl::set_font() can define new typefaces.
- * \param[in] f the new font for the label
- * \see Fl_Font
+ Fonts are identified by indexes into a table. The default value uses a
+ Helvetica typeface (Arial for Microsoft&reg; Windows&reg;). The
+ function Fl::set_font() can define new typefaces.
+ \param[in] f the new font for the label
+ \see Fl_Font
*/
void labelfont(Fl_Font f) {label_.font=f;}
/** Gets the font size in pixels.
- * The default size is 14 pixels.
- * \return the current font size
+ The default size is 14 pixels.
+ \return the current font size
*/
Fl_Fontsize labelsize() const {return label_.size;}
- /** Gets or sets the font size in pixels.
- * The default size is 14 pixels.
- * \param[in] pix the new font size
+ /** Sets the font size in pixels.
+ \param[in] pix the new font size
+ \see Fl_Fontsize labelsize()
*/
void labelsize(Fl_Fontsize pix) {label_.size=pix;}
- /** Gets or sets the image to use as part of the widget label.
- * This image is used when drawing the widget in the active state.
- * \return the current image
+ /** Gets the image that is used as part of the widget label.
+ This image is used when drawing the widget in the active state.
+ \return the current image
*/
Fl_Image* image() {return label_.image;}
- /** Gets or sets the image to use as part of the widget label.
- * This image is used when drawing the widget in the active state.
- * \param[in] img the new image for the label
+ /** Sets the image to use as part of the widget label.
+ This image is used when drawing the widget in the active state.
+ \param[in] img the new image for the label
*/
void image(Fl_Image* img) {label_.image=img;}
- /** Gets or sets the image to use as part of the widget label.
- * This image is used when drawing the widget in the active state.
- * \param[in] img the new image for the label
+ /** Sets the image to use as part of the widget label.
+ This image is used when drawing the widget in the active state.
+ \param[in] img the new image for the label
*/
void image(Fl_Image& img) {label_.image=&img;}
- /** Gets the image to use as part of the widget label.
- * This image is used when drawing the widget in the inactive state.
- * \return the current deactivated image for this widget
+ /** Gets the image that is used as part of the widget label.
+ This image is used when drawing the widget in the inactive state.
+ \return the current image for the deactivated widget
*/
Fl_Image* deimage() {return label_.deimage;}
/** Sets the image to use as part of the widget label.
- * This image is used when drawing the widget in the inactive state.
- * \param[in] img the new image for the deactivated widget
+ This image is used when drawing the widget in the inactive state.
+ \param[in] img the new image for the deactivated widget
*/
void deimage(Fl_Image* img) {label_.deimage=img;}
/** Sets the image to use as part of the widget label.
- * This image is used when drawing the widget in the inactive state.
- * \param[in] img the new image for the deactivated widget
+ This image is used when drawing the widget in the inactive state.
+ \param[in] img the new image for the deactivated widget
*/
void deimage(Fl_Image& img) {label_.deimage=&img;}
/** Gets the current tooltip text.
- * \return a pointer to the tooltip text or NULL
+ \return a pointer to the tooltip text or NULL
*/
const char *tooltip() const {return tooltip_;}
/** Sets the current tooltip text.
- * Sets a string of text to display in a popup tooltip window when the user
- * hovers the mouse over the widget. The string is <I>not</I> copied, so
- * make sure any formatted string is stored in a static, global,
- * or allocated buffer.
- *
- * If no tooltip is set, the tooltip of the parent is inherited. Setting a
- * tooltip for a group and setting no tooltip for a child will show the
- * group's tooltip instead. To avoid this behavior, you can set the child's
- * tooltip to an empty string ("").
- * \param[in] t new tooltip
+ Sets a string of text to display in a popup tooltip window when the user
+ hovers the mouse over the widget. The string is <I>not</I> copied, so
+ make sure any formatted string is stored in a static, global,
+ or allocated buffer.
+
+ If no tooltip is set, the tooltip of the parent is inherited. Setting a
+ tooltip for a group and setting no tooltip for a child will show the
+ group's tooltip instead. To avoid this behavior, you can set the child's
+ tooltip to an empty string ("").
+ \param[in] t new tooltip
*/
void tooltip(const char *t);
/** Gets the current callback function for the widget.
- * Each widget has a single callback.
- * \return current callback
+ Each widget has a single callback.
+ \return current callback
*/
Fl_Callback_p callback() const {return callback_;}
/** Sets the current callback function for the widget.
- * Each widget has a single callback.
- * \param[in] cb new callback
- * \param[in] p user data
+ Each widget has a single callback.
+ \param[in] cb new callback
+ \param[in] p user data
*/
void callback(Fl_Callback* cb, void* p) {callback_=cb; user_data_=p;}
/** Sets the current callback function for the widget.
- * Each widget has a single callback.
- * \param[in] cb new callback
+ Each widget has a single callback.
+ \param[in] cb new callback
*/
void callback(Fl_Callback* cb) {callback_=cb;}
/** Sets the current callback function for the widget.
- * Each widget has a single callback.
- * \param[in] cb new callback
+ Each widget has a single callback.
+ \param[in] cb new callback
*/
void callback(Fl_Callback0*cb) {callback_=(Fl_Callback*)cb;}
/** Sets the current callback function for the widget.
- * Each widget has a single callback.
- * \param[in] cb new callback
- * \param[in] p user data
+ Each widget has a single callback.
+ \param[in] cb new callback
+ \param[in] p user data
*/
void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb; user_data_=(void*)p;}
/** Gets the user data for this widget.
- * Gets the current user data (void *) argument
- * that is passed to the callback function.
- * \return user data as a pointer
+ Gets the current user data (void *) argument
+ that is passed to the callback function.
+ \return user data as a pointer
*/
void* user_data() const {return user_data_;}
/** Sets the user data for this widget.
- * Sets the new user data (void *) argument
- * that is passed to the callback function.
- * \param[in] v new user data
+ Sets the new user data (void *) argument
+ that is passed to the callback function.
+ \param[in] v new user data
*/
void user_data(void* v) {user_data_ = v;}
@@ -542,259 +566,254 @@ public:
long argument() const {return (long)user_data_;}
/** Sets the current user data (long) argument that is passed to the callback function.
- * \todo The user data value must be implemented using a \em union to avoid 64 bit machine incompatibilities.
+ \todo The user data value must be implemented using a \em union to avoid
+ 64 bit machine incompatibilities.
*/
void argument(long v) {user_data_ = (void*)v;}
- /**
- Controls when callbacks are done. The following values are useful,
- the default value is FL_WHEN_RELEASE:
-
- <UL>
-
- <LI>0: The callback is not done, but
- changed() is turned on.</LI>
-
- <LI>FL_WHEN_CHANGED: The callback is done each
- time the text is changed by the user.</LI>
-
- <LI>FL_WHEN_RELEASE: 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 changed()
- when the OK button on a panel is pressed.</LI>
-
- <LI>FL_WHEN_ENTER_KEY: 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 Fl_Mulitline_Input), this changes the
- behavior.</LI>
-
- <LI>FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The
- Enter key will do the callback even if the text has not
- changed. Useful for command fields.</LI>
-
- </UL>
- Return the conditions under which the callback is called.
- \return set of flags
+ /** Returns the conditions under which the callback is called.
+
+ You can set the flags with when(uchar), the default value is
+ FL_WHEN_RELEASE.
+
+ \return set of flags
+ \see when(uchar)
*/
Fl_When when() const {return (Fl_When)when_;}
- /** Flags used to decide when a callback is called.
- * 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.
- * \param[in] i set of flags
+ /** Sets the flags used to decide when a callback is called.
+
+ This controls when callbacks are done. The following values are useful,
+ the default value is FL_WHEN_RELEASE:
+
+ \li 0: The callback is not done, but changed() is turned on.
+ \li FL_WHEN_CHANGED: The callback is done each time the text is
+ changed by the user.</LI>
+ \li FL_WHEN_RELEASE: 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 changed() when the OK button on a panel is pressed.
+ \li FL_WHEN_ENTER_KEY: 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 Fl_Mulitline_Input) - this changes the behavior.
+ \li FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The Enter key will do the
+ callback even if the text has not changed. Useful for command fields.
+ 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.
+ \param[in] i set of flags
*/
void when(uchar i) {when_ = i;}
- /** Returns whether a widget is visble.
- * \retval 0 if the widget is not drawn and hence invisible.
- * \see show(), hide(), visible_r()
+ /** Returns whether a widget is visible.
+ \retval 0 if the widget is not drawn and hence invisible.
+ \see show(), hide(), visible_r()
*/
int visible() const {return !(flags_&INVISIBLE);}
/** Returns whether a widget and all its parents are visible.
- * \retval 0 if the widget or any of its parents are invisible.
- * \see show(), hide(), visible()
+ \retval 0 if the widget or any of its parents are invisible.
+ \see show(), hide(), visible()
*/
int visible_r() const;
/** Makes a widget visible.
- * 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 <I>and all of its parents</I>.
- *
- * Changing it will send FL_SHOW or FL_HIDE events to
- * the widget. <I>Do not change it if the parent is not visible, as this
- * will send false FL_SHOW or FL_HIDE events to the
- * widget</I>. redraw() is called if necessary on this or the parent.
- *
- * \see hide(), visible(), visible_r()
+ 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 <I>and all of its parents</I>.
+
+ Changing it will send FL_SHOW or FL_HIDE events to
+ the widget. <I>Do not change it if the parent is not visible, as this
+ will send false FL_SHOW or FL_HIDE events to the widget</I>.
+ redraw() is called if necessary on this or the parent.
+
+ \see hide(), visible(), visible_r()
*/
virtual void show();
/** Makes a widget invisible.
- * \see show(), visible(), visible_r()
+ \see show(), visible(), visible_r()
*/
virtual void hide();
/** Makes the widget visible.
- * You must still redraw the parent widget to see a change in the
- * window. Normally you want to use the show() method instead.
+ You must still redraw the parent widget to see a change in the
+ window. Normally you want to use the show() method instead.
*/
void set_visible() {flags_ &= ~INVISIBLE;}
/** Hides the widget.
- * You must still redraw the parent to see a change in the window.
- * Normally you want to use the hide() method instead.
+ You must still redraw the parent to see a change in the window.
+ Normally you want to use the hide() method instead.
*/
void clear_visible() {flags_ |= INVISIBLE;}
/** Returns whether the widget is active.
- * \retval 0 if the widget is inactive
- * \see active_r(), activate(), deactivate()
+ \retval 0 if the widget is inactive
+ \see active_r(), activate(), deactivate()
*/
int active() const {return !(flags_&INACTIVE);}
- /** active_r() returns whether the widget and all of its
- * parents are active.
- * \retval 0 if this or any of the parent widgets are inactive
- * \see active(), activate(), deactivate()
+ /** Returns whether the widget and all of its parents are active.
+ \retval 0 if this or any of the parent widgets are inactive
+ \see active(), activate(), deactivate()
*/
int active_r() const;
- /** Activate a widget.
- * Changing this value will send FL_ACTIVATE to the widget if
- * active_r() is true.
- * \see active(), active_r(), deactivate()
+ /** Activates the widget.
+ Changing this value will send FL_ACTIVATE to the widget if
+ active_r() is true.
+ \see active(), active_r(), deactivate()
*/
void activate();
- /** Deactivate a widget.
- * Inactive widgets will be drawn "grayed out", e.g. with less contrast
- * than the active widget. Inactive widgets will not receive any keyboard
- * or mouse button events. Other events (including FL_ENTER, FL_MOVE,
- * FL_LEAVE, FL_SHORTCUT, and others) will still be sent. A widget is
- * only active if active() is true on it <I>and all of its parents</I>.
- *
- * Changing this value will send FL_DEACTIVATE to the widget if
- * active_r() is true.
- *
- * Currently you cannot deactivate Fl_Window widgets.
- *
- * \see activate(), active(), active_r()
+ /** Deactivates the widget.
+ Inactive widgets will be drawn "grayed out", e.g. with less contrast
+ than the active widget. Inactive widgets will not receive any keyboard
+ or mouse button events. Other events (including FL_ENTER, FL_MOVE,
+ FL_LEAVE, FL_SHORTCUT, and others) will still be sent. A widget is
+ only active if active() is true on it <I>and all of its parents</I>.
+
+ Changing this value will send FL_DEACTIVATE to the widget if
+ active_r() is true.
+
+ Currently you cannot deactivate Fl_Window widgets.
+
+ \see activate(), active(), active_r()
*/
void deactivate();
- /** Return if a widget is used for output only.
- * output() means the same as !active() except it does not change how the
- * widget is drawn. The widget will not receive any events. This is useful
- * for making scrollbars or buttons that work as displays rather than input devices.
- * \retval 0 if the widget is used for input and output
- * \see set_output(), clear_output()
+ /** Returns if a widget is used for output only.
+ output() means the same as !active() except it does not change how the
+ widget is drawn. The widget will not receive any events. This is useful
+ for making scrollbars or buttons that work as displays rather than input
+ devices.
+ \retval 0 if the widget is used for input and output
+ \see set_output(), clear_output()
*/
int output() const {return (flags_&OUTPUT);}
- /** Set a widget to output only.
- * \see output(), clear_output()
+ /** Sets a widget to output only.
+ \see output(), clear_output()
*/
void set_output() {flags_ |= OUTPUT;}
- /** Set a widget to accept input.
- * \see set_output(), output()
+ /** Sets a widget to accept input.
+ \see set_output(), output()
*/
void clear_output() {flags_ &= ~OUTPUT;}
/** Returns if the widget is able to take events.
- * This is the same as (active() && !output()
- * && visible()) but is faster.
- * \retval 0 if the widget takes no events
+ This is the same as (active() && !output()
+ && visible()) but is faster.
+ \retval 0 if the widget takes no events
*/
int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
/**
- * Check if the widget value changed since the last callback.
- * "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 the program
- * sets the stored value.
- *
- * \retval 0 if the value did not change
- * \see set_changed(), clear_changed()`
+ Check if the widget value changed since the last callback.
+
+ "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
+ the program sets the stored value.
+
+ \retval 0 if the value did not change
+ \see set_changed(), clear_changed()
*/
int changed() const {return flags_&CHANGED;}
- /** Mark the value of the widget as changed.
- * \see changed(), clear_changed()
+ /** Marks the value of the widget as changed.
+ \see changed(), clear_changed()
*/
void set_changed() {flags_ |= CHANGED;}
- /** Mark the value of the widget as unchanged.
- * \see changed(), set_changed()
+ /** Marks the value of the widget as unchanged.
+ \see changed(), set_changed()
*/
void clear_changed() {flags_ &= ~CHANGED;}
- /** Give the widget the keyboard 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 a widget.
- * \return true if the widget accepted the focus.
+ /** Gives the widget the keyboard 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 a widget.
+ \return true if the widget accepted the focus.
*/
int take_focus();
/** Enables keyboard focus navigation with this widget.
- * Note, however, that this will not necessarily mean that the widget will
- * accept focus, but for widgets that can accept focus, this method enables
- * it if it has been disabled.
- * \see visible_focus(), clear_visible_focus(), visible_focus(int)
+ Note, however, that this will not necessarily mean that the widget will
+ accept focus, but for widgets that can accept focus, this method enables
+ it if it has been disabled.
+ \see visible_focus(), clear_visible_focus(), visible_focus(int)
*/
void set_visible_focus() { flags_ |= VISIBLE_FOCUS; }
/** Disables keyboard focus navigation with this widget.
- * Normally, all widgets participate in keyboard focus navigation.
- * \see set_visible_focus(), visible_focus(), visible_focus(int)
+ Normally, all widgets participate in keyboard focus navigation.
+ \see set_visible_focus(), visible_focus(), visible_focus(int)
*/
void clear_visible_focus() { flags_ &= ~VISIBLE_FOCUS; }
/** Modifies keyboard focus navigation.
- * \param[in] v set or clear visible focus
- * \see set_visible_focus(), clear_visible_focus(), visible_focus()
+ \param[in] v set or clear visible focus
+ \see set_visible_focus(), clear_visible_focus(), visible_focus()
*/
void visible_focus(int v) { if (v) set_visible_focus(); else clear_visible_focus(); }
/** Check whether this widget has a visible focus.
- * \retval 0 if this widget has no visible focus.
- * \see visible_focus(int), set_visible_focus(), clear_visible_focus()
+ \retval 0 if this widget has no visible focus.
+ \see visible_focus(int), set_visible_focus(), clear_visible_focus()
*/
int visible_focus() { return flags_ & VISIBLE_FOCUS; }
/** Sets the default callback for all widgets.
- * Sets 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.
- * \param[in] cb the new callback
- * \param[in] d user data associated with that callback
- * \see callback(), do_callback(), Fl::readqueu()
+ Sets 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.
+ \param[in] cb the new callback
+ \param[in] d user data associated with that callback
+ \see callback(), do_callback(), Fl::readqueu()
*/
static void default_callback(Fl_Widget *cb, void *d);
- /** Call the widget callback.
- * Causes a widget to invoke its callback function, optionally
- * with arbitrary arguments.
- * \see callback()
+ /** Calls the widget callback.
+ Causes a widget to invoke its callback function, optionally
+ with arbitrary arguments.
+ \see callback()
*/
void do_callback() {callback_(this,user_data_); if (callback_ != default_callback) clear_changed();}
- /** Call the widget callback.
- * Causes a widget to invoke its callback function, optionally
- * with arbitrary arguments.
- * \param[in] o call the callback with \em o as the widget argument
- * \param[in] arg call the callback with \em arg as the user data argument
- * \see callback()
+ /** Calls the widget callback.
+ Causes a widget to invoke its callback function, optionally
+ with arbitrary arguments.
+ \param[in] o call the callback with \em o as the widget argument
+ \param[in] arg call the callback with \em arg as the user data argument
+ \see callback()
*/
void do_callback(Fl_Widget* o,void* arg=0) {callback_(o,arg); if (callback_ != default_callback) clear_changed();}
- /** Call the widget callback.
- * Causes a widget to invoke its callback function, optionally
- * with arbitrary arguments.
- * \param[in] o call the callback with \em o as the widget argument
- * \param[in] arg call the callback with \em arg as the user data argument
- * \see callback()
+ /** Calls the widget callback.
+ Causes a widget to invoke its callback function, optionally
+ with arbitrary arguments.
+ \param[in] o call the callback with \em o as the widget argument
+ \param[in] arg call the callback with \em arg as the user data argument
+ \see callback()
*/
void do_callback(Fl_Widget* o,long arg) {callback_(o,(void*)arg); if (callback_ != default_callback) clear_changed();}
@@ -806,73 +825,83 @@ public:
static int test_shortcut(const char*);
/** Checks if w is a child of this widget.
- * \param[in] w potential child widget
- * \return Returns 1 if \em w is a child of this widget, or is
- * equal to this widget. Returns 0 if \em w is NULL.
+ \param[in] w potential child widget
+ \return Returns 1 if \em w is a child of this widget, or is
+ equal to this widget. Returns 0 if \em w is NULL.
*/
int contains(const Fl_Widget *w) const ;
- /** Check if this widget is a child of w.
- * Returns 1 if this widget is a child of \em w, or is
- * equal to \em w. Returns 0 if \em w is NULL.
- * \param[in] w the possible parent widget.
- * \see contains()
+ /** Checks if this widget is a child of w.
+ Returns 1 if this widget is a child of \em w, or is
+ equal to \em w. Returns 0 if \em w is NULL.
+ \param[in] w the possible parent widget.
+ \see contains()
*/
int inside(const Fl_Widget* w) const {return w ? w->contains(this) : 0;}
- /** Schedule the drawing of the widget.
- * Marks the widget as needing its draw() routine called.
+ /** Schedules the drawing of the widget.
+ Marks the widget as needing its draw() routine called.
*/
void redraw();
- /** Schedule the drawing of the label.
- * Marks the widget or the parent as needing a redraw for the label area of a widget.
+ /** Schedules the drawing of the label.
+ Marks the widget or the parent as needing a redraw for the label area
+ of a widget.
*/
void redraw_label();
/** Returns non-zero if draw() needs to be called.
- * The damage value is actually a bit field that the widget
- * subclass can use to figure out what parts to draw.
- * \return a bitmap of flags describing the kind of damage to the widget
- * \see damage(uchar), clear_damage(uchar)
+ The damage value is actually a bit field that the widget
+ subclass can use to figure out what parts to draw.
+ \return a bitmap of flags describing the kind of damage to the widget
+ \see damage(uchar), clear_damage(uchar)
*/
uchar damage() const {return damage_;}
- /** Clear damage flags.
- * Damage flags are cleared when parts of the widget drawing is repaired.
- * \param[in] c bitmask of flags to clear
- * \see damage(uchar), damage()
+ /** Clears the damage flags.
+ Damage flags are cleared when parts of the widget drawing is repaired.
+ \param[in] c bitmask of flags to clear
+ \see damage(uchar), damage()
*/
void clear_damage(uchar c = 0) {damage_ = c;}
- /** Set the damage bits for the widget.
- * Setting damage bits will schedule the widget for the next redraw.
- * \param[in] c bitmask of flags to set
- * \see damage(), clear_damage(uchar)
+ /** Sets the damage bits for the widget.
+ Setting damage bits will schedule the widget for the next redraw.
+ \param[in] c bitmask of flags to set
+ \see damage(), clear_damage(uchar)
*/
void damage(uchar c);
- /** Set the damage bits for an area inside the widget.
- * Setting damage bits will schedule the widget for the next redraw.
- * \param[in] c bitmask of flags to set
- * \param[in] x, y, w, h size of damaged area
- * \see damage(), clear_damage(uchar)
+ /** Sets the damage bits for an area inside the widget.
+ Setting damage bits will schedule the widget for the next redraw.
+ \param[in] c bitmask of flags to set
+ \param[in] x, y, w, h size of damaged area
+ \see damage(), clear_damage(uchar)
*/
void damage(uchar c, int x, int y, int w, int h);
void draw_label(int, int, int, int, Fl_Align) const;
- /** Sets width ww, height hh accordingly with the labeltype size, label with images will return w() h() of the image. */
+
+ /** Sets width ww and height hh accordingly with the labeltype size.
+ Labels with images will return w() and h() of the image.
+ */
void measure_label(int& ww, int& hh) {label_.measure(ww, hh);}
/** Returns a pointer to the primary Fl_Window widget.
- * \retval NULL if no window is associated with this widget.
- * \note for an Fl_Window widget, this returns its <I>parent</I> window (if any), not <I>this</I> window.
+ \retval NULL if no window is associated with this widget.
+ \note for an Fl_Window widget, this returns its <I>parent</I> window
+ (if any), not <I>this</I> window.
*/
Fl_Window* window() const ;
- /** For back compatibility only. */
+ /** For back compatibility only.
+ \deprecated Use selection_color() instead.
+ */
Fl_Color color2() const {return (Fl_Color)color2_;}
- /** For back compatibility only. */
+
+ /** For back compatibility only.
+ \deprecated Use selection_color(unsigned) instead.
+ */
void color2(unsigned a) {color2_ = a;}
};
diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx
index b519c0f92..84e0d69cd 100644
--- a/src/Fl_Browser.cxx
+++ b/src/Fl_Browser.cxx
@@ -34,12 +34,11 @@
// I modified this from the original Forms data to use a linked list
// so that the number of items in the browser and size of those items
-// is unlimited. The only problem is that the old browser used an
+// is unlimited. The only problem is that the old browser used an
// index number to identify a line, and it is slow to convert from/to
-// a pointer. I use a cache of the last match to try to speed this
-// up.
+// a pointer. I use a cache of the last match to try to speed this up.
-// Also added the ability to "hide" a line. This set's it's height to
+// Also added the ability to "hide" a line. This sets its height to
// zero, so the Fl_Browser_ cannot pick it.
#define SELECTED 1
@@ -69,7 +68,7 @@ void Fl_Browser::item_select(void* l, int v) {
}
/**
- Return entry for line number \p line.
+ Return entry for line number \a line.
*/
FL_BLINE* Fl_Browser::find_line(int line) const {
int n; FL_BLINE* l;
@@ -89,7 +88,7 @@ FL_BLINE* Fl_Browser::find_line(int line) const {
}
/**
- Returns line number corresponding to data \p v,
+ Returns line number corresponding to data \a v,
zero if not found.
*/
int Fl_Browser::lineno(void* v) const {
@@ -141,7 +140,7 @@ FL_BLINE* Fl_Browser::_remove(int line) {
}
/**
- Remove line n and make the browser one line shorter.
+ Remove line \a line and make the browser one line shorter.
*/
void Fl_Browser::remove(int line) {
if (line < 1 || line > lines) return;
@@ -149,8 +148,8 @@ void Fl_Browser::remove(int line) {
}
/**
- Insert a new line \p t \e before line \p n. If \p n &gt;
- size() then the line is added to the end.
+ Insert a new line \a t \e before line \a n.
+ If \a n > size() then the line is added to the end.
*/
void Fl_Browser::insert(int line, FL_BLINE* t) {
if (!first) {
@@ -184,7 +183,7 @@ void Fl_Browser::insert(int line, FL_BLINE* t) {
/**
Insert a new entry \e before given line.
- \param[in] line if \p line > size(), the entry will be added at the end.
+ \param[in] line if \a line > size(), the entry will be added at the end.
\param[in] newtext text entry for the new line.
\param[in] d pointer to data associated with the new line.
*/
@@ -199,7 +198,7 @@ void Fl_Browser::insert(int line, const char* newtext, void* d) {
}
/**
- Line from is removed and reinserted at to; to
+ Line \a from is removed and reinserted at \a to; \a to
is calculated after the line is removed.
*/
void Fl_Browser::move(int to, int from) {
@@ -208,8 +207,8 @@ void Fl_Browser::move(int to, int from) {
}
/**
- Sets the text for line \p line to text \p newtext.
- Does nothing if \p line is out of range.
+ Sets the text for line \a line to text \a newtext.
+ Does nothing if \a line is out of range.
*/
void Fl_Browser::text(int line, const char* newtext) {
if (line < 1 || line > lines) return;
@@ -234,8 +233,8 @@ void Fl_Browser::text(int line, const char* newtext) {
}
/**
- Sets the data for line \p n to \p d.
- Does nothing if \n is out of range.
+ Sets the data for line \a line to \a d.
+ Does nothing if \a line is out of range.
*/
void Fl_Browser::data(int line, void* d) {
if (line < 1 || line > lines) return;
@@ -300,7 +299,7 @@ int Fl_Browser::item_width(void* v) const {
const int* i = column_widths();
int ww = 0;
- while (*i) { // add up all tab-seperated fields
+ while (*i) { // add up all tab-separated fields
char* e;
e = strchr(str, column_char());
if (!e) break; // last one occupied by text
@@ -357,7 +356,7 @@ void Fl_Browser::item_draw(void* v, int X, int Y, int W, int H) const {
char* str = ((FL_BLINE*)v)->txt;
const int* i = column_widths();
- while (W > 6) { // do each tab-seperated field
+ while (W > 6) { // do each tab-separated field
int w1 = W; // width for this field
char* e = 0; // pointer to end of field or null if none
if (*i) { // find end of field and temporarily replace with 0
@@ -423,7 +422,7 @@ void Fl_Browser::item_draw(void* v, int X, int Y, int W, int H) const {
fl_color(lcol);
fl_draw(str, X+3, Y, w1-6, H, e ? Fl_Align(talign|FL_ALIGN_CLIP) : talign, 0, 0);
if (!e) break; // no more fields...
- *e = column_char(); // put the seperator back
+ *e = column_char(); // put the separator back
X += w1;
W -= w1;
str = e+1;
@@ -437,7 +436,7 @@ static const int no_columns[1] = {0};
\param[in] X,Y,W,H position and size.
\param[in] L label string, may be NULL.
*/
-Fl_Browser::Fl_Browser(int X, int Y, int W, int H, const char*L)
+Fl_Browser::Fl_Browser(int X, int Y, int W, int H, const char *L)
: Fl_Browser_(X, Y, W, H, L) {
column_widths_ = no_columns;
lines = 0;
@@ -449,7 +448,7 @@ Fl_Browser::Fl_Browser(int X, int Y, int W, int H, const char*L)
}
/**
- Update browser so that line is shown at given position.
+ Updates the browser so that \a line is shown at position \pos.
\param[in] line line number.
\param[in] pos position.
*/
@@ -486,7 +485,7 @@ int Fl_Browser::topline() const {
}
/**
- Remove all the lines in the browser.
+ Removes all the lines in the browser.
*/
void Fl_Browser::clear() {
for (FL_BLINE* l = first; l;) {
@@ -501,9 +500,9 @@ void Fl_Browser::clear() {
}
/**
- Add a new line to the end of the browser. The text is copied using
+ Adds a new line to the end of the browser. The text is copied using
the strdup() function. It may also be NULL to make a
- blank line. The void * argument is returned as the data()
+ blank line. The void * argument \a d is returned as the data()
of the new item.
*/
void Fl_Browser::add(const char* newtext, void* d) {
@@ -520,7 +519,7 @@ const char* Fl_Browser::text(int line) const {
}
/**
- Returns the data for line \p n, or NULL is \p n is out of range.
+ Returns the data for line \p line, or NULL if \p line is out of range.
*/
void* Fl_Browser::data(int line) const {
if (line < 1 || line > lines) return 0;
@@ -528,7 +527,7 @@ void* Fl_Browser::data(int line) const {
}
/**
- Sets the selection state of entry.
+ Sets the selection state of entry \a line.
\param[in] line line number.
\param[in] v new selection state.
\returns 1 if the state changed, 0 if not.
@@ -538,13 +537,13 @@ int Fl_Browser::select(int line, int v) {
return Fl_Browser_::select(find_line(line), v);
}
-/** Return 1 if line n is selected, 0 if it not selected.*/
+/** Returns 1 if line \a line is selected, 0 if it is not selected.*/
int Fl_Browser::selected(int line) const {
if (line < 1 || line > lines) return 0;
return find_line(line)->flags & SELECTED;
}
-/** Makes line n visible for selection.*/
+/** Makes line \a line visible for selection. */
void Fl_Browser::show(int line) {
FL_BLINE* t = find_line(line);
if (t->flags & NOTDISPLAYED) {
@@ -555,7 +554,7 @@ void Fl_Browser::show(int line) {
}
/**
- Makes line n invisible, preventing selection by the user.
+ Makes line \a line invisible, preventing selection by the user.
The line can still be selected under program control.
*/
void Fl_Browser::hide(int line) {
@@ -569,6 +568,9 @@ void Fl_Browser::hide(int line) {
/**
For back compatibility.
+
+ This calls show(line) if \a v is true, and hide(line) otherwise.
+ \see show(int line), hide(int line)
*/
void Fl_Browser::display(int line, int v) {
if (line < 1 || line > lines) return;
@@ -576,7 +578,7 @@ void Fl_Browser::display(int line, int v) {
}
/**
- Returns a non-zero value if line is visible.
+ Returns a non-zero value if line \a line is visible.
*/
int Fl_Browser::visible(int line) const {
if (line < 1 || line > lines) return 0;
@@ -584,7 +586,7 @@ int Fl_Browser::visible(int line) const {
}
/**
- Gets browser value.
+ Gets the browser's value.
\returns line number of current selection, or 0 if no selection.
*/
int Fl_Browser::value() const {
diff --git a/src/Fl_Gl_Overlay.cxx b/src/Fl_Gl_Overlay.cxx
index f9a2c7bed..433de4a88 100644
--- a/src/Fl_Gl_Overlay.cxx
+++ b/src/Fl_Gl_Overlay.cxx
@@ -43,7 +43,7 @@ void Fl_Gl_Window::make_overlay() {overlay = this;}
#else
// Methods on Fl_Gl_Window that create an overlay window. Because
-// many programs don't need the overlay, this is seperated into this
+// many programs don't need the overlay, this is separated into this
// source file so it is not linked in if not used.
// Under X this is done by creating another window, of class _Fl_Gl_Overlay
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index db6fe011d..a7a98f5bc 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -336,7 +336,7 @@ void Fl_Gl_Window::flush() {
if (overlay == this) {
// don't draw if only the overlay is damaged:
if (damage1_ || damage() != FL_DAMAGE_OVERLAY || !save_valid) draw();
- // we use a seperate context for the copy because rasterpos must be 0
+ // we use a separate context for the copy because rasterpos must be 0
// and depth test needs to be off:
static GLContext ortho_context = 0;
static Fl_Gl_Window* ortho_window = 0;
diff --git a/src/Fl_Menu_add.cxx b/src/Fl_Menu_add.cxx
index b100fcdc8..3cc0e8797 100644
--- a/src/Fl_Menu_add.cxx
+++ b/src/Fl_Menu_add.cxx
@@ -273,7 +273,7 @@ int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
/**
This is a Forms (and SGI GL library) compatible add function, it
- adds many menu items, with '|' seperating the menu items, and tab
+ adds many menu items, with '|' separating the menu items, and tab
separating the menu item names from an optional shortcut string.
The passed string is split at any '|' characters and then
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index f96f90ccb..43f3002ff 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -107,7 +107,7 @@ Fl_Preferences::Fl_Preferences( const char *path, const char *vendor, const char
Use the \a group argument to name the group that you would like to access.
\a Group can also contain a path to a group further down the hierarchy by
- seperating group names with a forward slash '/'.
+ separating group names with a forward slash '/'.
\param[in] parent reference object for the new group
\param[in] group name of the group to access (may contain '/'s)
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index fac59eef7..9877beb28 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -29,7 +29,7 @@
// This is the "file card tabs" interface to allow you to put lots and lots
// of buttons and switches in a panel, as popularized by many toolkits.
-// Each child widget is a card, and it's label() is printed on the card tab.
+// Each child widget is a card, and its label() is printed on the card tab.
// Clicking the tab makes that card visible.
#include <stdio.h>
@@ -43,7 +43,7 @@
// return the left edges of each tab (plus a fake left edge for a tab
// past the right-hand one). These position are actually of the left
-// edge of the slope. They are either seperated by the correct distance
+// edge of the slope. They are either separated by the correct distance
// or by EXTRASPACE or by zero.
// Return value is the index of the selected item.
@@ -411,7 +411,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
<P>The destructor <I>also deletes all the children</I>. This
allows a whole tree to be deleted at once, without having to
keep a pointer to all the children in the user code. A kludge
- has been done so the Fl_Tabs and all of it's children
+ has been done so the Fl_Tabs and all of its children
can be automatic (local) variables, but you must declare the
Fl_Tabs widget <I>first</I> so that it is destroyed last.
*/
diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx
index b0df5afa0..b0c9ce694 100644
--- a/src/Fl_Widget.cxx
+++ b/src/Fl_Widget.cxx
@@ -64,8 +64,8 @@ void Fl_Widget::default_callback(Fl_Widget *o, void * /*v*/) {
}
/**
All Fl_Widgets that don't have a callback defined use a
- default callback that puts a pointer to the widget in this queue, and
- this method reads the oldest widget out of this queue.
+ default callback that puts a pointer to the widget in this queue,
+ and this method reads the oldest widget out of this queue.
*/
Fl_Widget *Fl::readqueue() {
if (obj_tail==obj_head) return 0;
@@ -80,7 +80,7 @@ int Fl_Widget::handle(int) {
return 0;
}
-/** default font size for widgets */
+/** Default font size for widgets */
Fl_Fontsize FL_NORMAL_SIZE = 14;
Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
@@ -147,7 +147,7 @@ Fl_Widget::~Fl_Widget() {
fl_throw_focus(this);
}
-/** Draws a focus box for the widget at position X,Y and SIZE W,H . */
+/** Draws a focus box for the widget at position X,Y with size W,H. */
void
Fl_Widget::draw_focus(Fl_Boxtype B, int X, int Y, int W, int H) const {
if (!Fl::visible_focus()) return;
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx
index b56a949ee..7edb07bea 100644
--- a/src/Fl_mac.cxx
+++ b/src/Fl_mac.cxx
@@ -1833,7 +1833,7 @@ static OSErr fillCurrentDragData(DragReference dragRef)
GetFlavorDataSize( dragRef, itemRef, 'TEXT', &itemSize );
GetFlavorData( dragRef, itemRef, 'TEXT', dst, &itemSize, 0L );
dst += itemSize;
- *dst++ = '\n'; // add our element seperator
+ *dst++ = '\n'; // add our element separator
}
ret = GetFlavorFlags( dragRef, itemRef, 'hfs ', &flags );
if ( ret == noErr )
@@ -1844,7 +1844,7 @@ static OSErr fillCurrentDragData(DragReference dragRef)
dst += itemSize;
if ( itemSize>1 && ( hfs.fileType=='fold' || hfs.fileType=='disk' ) )
*dst++ = '/';
- *dst++ = '\n'; // add our element seperator
+ *dst++ = '\n'; // add our element separator
}
}
diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx
index 3cac9d21d..dd397782c 100644
--- a/src/fl_boxtype.cxx
+++ b/src/fl_boxtype.cxx
@@ -31,7 +31,7 @@
*/
// Box drawing code for the common box types and the table of
-// boxtypes. Other box types are in seperate files so they are not
+// boxtypes. Other box types are in separate files so they are not
// linked in if not used.
#include <FL/Fl.H>
diff --git a/src/fl_diamond_box.cxx b/src/fl_diamond_box.cxx
index d9183b6f5..4da503b0f 100644
--- a/src/fl_diamond_box.cxx
+++ b/src/fl_diamond_box.cxx
@@ -26,7 +26,7 @@
//
// Box drawing code for an obscure box type.
-// These box types are in seperate files so they are not linked
+// These box types are in separate files so they are not linked
// in if not used.
// The diamond box draws best if the area is square!
diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx
index 26fd47bb4..cab08175b 100644
--- a/src/fl_dnd_win32.cxx
+++ b/src/fl_dnd_win32.cxx
@@ -233,7 +233,7 @@ private:
fmt.dwAspect = DVASPECT_CONTENT;
fmt.lindex = -1;
fmt.cfFormat = CF_HDROP;
- // if it is a pathname list, send an FL_PASTE with a \n seperated list of filepaths
+ // if it is a pathname list, send an FL_PASTE with a \n separated list of filepaths
if ( data->GetData( &fmt, &medium )==S_OK )
{
HDROP hdrop = (HDROP)medium.hGlobal;
diff --git a/src/fl_draw_image_win32.cxx b/src/fl_draw_image_win32.cxx
index 05fc7ee8c..f688a6e1d 100644
--- a/src/fl_draw_image_win32.cxx
+++ b/src/fl_draw_image_win32.cxx
@@ -39,7 +39,7 @@
// Micro$oft picked a bottom-up and BGR storage format for their
// DIB images. I'm pretty certain there is a way around this, but
// I can't find any other than the brute-force method of drawing
-// each line as a seperate image. This may also need to be done
+// each line as a separate image. This may also need to be done
// if the delta is any amount other than 1, 3, or 4.
////////////////////////////////////////////////////////////////
diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx
index 341a6faad..e6ddbdd3e 100644
--- a/src/fl_font_xft.cxx
+++ b/src/fl_font_xft.cxx
@@ -36,7 +36,7 @@
// available to use this code. You will just get normal Xlib fonts
// (Xft calls them "core" fonts) The Xft algorithms for choosing
// these is about as good as the FLTK ones (I hope to fix it so it is
-// exactly as good...), plus it can cache it's results and share them
+// exactly as good...), plus it can cache its results and share them
// between programs, so using this should be a win in all cases. Also
// it should be obvious by comparing this file and fl_font_x.cxx that
// it is a lot easier to program with Xft than with Xlib.
@@ -172,7 +172,7 @@ static XftFont* fontopen(const char* name, bool core) {
char *curr = local_name; // points to first name in string
char *nxt; // next name in string
do {
- nxt = strchr(curr, ','); // find comma seperator
+ nxt = strchr(curr, ','); // find comma separator
if (nxt) {
*nxt = 0; // terminate first name
nxt++; // first char of next name
diff --git a/src/fl_gtk.cxx b/src/fl_gtk.cxx
index c0930c63b..91b1584f3 100644
--- a/src/fl_gtk.cxx
+++ b/src/fl_gtk.cxx
@@ -29,7 +29,7 @@
//
// Box drawing code for an obscure box type.
-// These box types are in seperate files so they are not linked
+// These box types are in separate files so they are not linked
// in if not used.
#include <FL/Fl.H>
diff --git a/src/fl_labeltype.cxx b/src/fl_labeltype.cxx
index c7116855e..0c3ecd894 100644
--- a/src/fl_labeltype.cxx
+++ b/src/fl_labeltype.cxx
@@ -102,7 +102,9 @@ void Fl_Label::measure(int& W, int& H) const {
f(this, W, H);
}
-/** The normal call for a draw() method */
+/** Draws the widget's label at the defined label position.
+ This is the normal call for a widget's draw() method.
+ */
void Fl_Widget::draw_label() const {
int X = x_+Fl::box_dx(box());
int W = w_-Fl::box_dw(box());
@@ -110,14 +112,18 @@ void Fl_Widget::draw_label() const {
draw_label(X, y_+Fl::box_dy(box()), W, h_-Fl::box_dh(box()));
}
-/** draw() can use this instead to change the bounding box */
+/** Draws the label in an arbitrary bounding box.
+ draw() can use this instead of draw_label(void) to change the bounding box
+ */
void Fl_Widget::draw_label(int X, int Y, int W, int H) const {
// quit if we are not drawing a label inside the widget:
if ((align()&15) && !(align() & FL_ALIGN_INSIDE)) return;
draw_label(X,Y,W,H,align());
}
-/** Anybody can call this to force the label to draw anywhere */
+/** Draws the label in an arbitrary bounding box with an arbitrary alignment.
+ Anybody can call this to force the label to draw anywhere.
+ */
void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const {
if (flags()&SHORTCUT_LABEL) fl_draw_shortcut = 1;
Fl_Label l1 = label_;
diff --git a/src/fl_oval_box.cxx b/src/fl_oval_box.cxx
index f9cbb1fc8..7d30a4069 100644
--- a/src/fl_oval_box.cxx
+++ b/src/fl_oval_box.cxx
@@ -26,7 +26,7 @@
//
-// Less-used box types are in seperate files so they are not linked
+// Less-used box types are in separate files so they are not linked
// in if not used.
#include <FL/Fl.H>
diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx
index 86216e3cc..873ddab86 100644
--- a/src/fl_plastic.cxx
+++ b/src/fl_plastic.cxx
@@ -29,7 +29,7 @@
//
// Box drawing code for an obscure box type.
-// These box types are in seperate files so they are not linked
+// These box types are in separate files so they are not linked
// in if not used.
#include <FL/Fl.H>
diff --git a/src/fl_round_box.cxx b/src/fl_round_box.cxx
index 275012481..914e348e9 100644
--- a/src/fl_round_box.cxx
+++ b/src/fl_round_box.cxx
@@ -26,7 +26,7 @@
//
// Box drawing code for an obscure box type.
-// These box types are in seperate files so they are not linked
+// These box types are in separate files so they are not linked
// in if not used.
#include <FL/Fl.H>
diff --git a/src/fl_set_fonts_x.cxx b/src/fl_set_fonts_x.cxx
index 8f93aa54f..acbb8c8df 100644
--- a/src/fl_set_fonts_x.cxx
+++ b/src/fl_set_fonts_x.cxx
@@ -112,7 +112,7 @@ const char* Fl::get_font_name(Fl_Font fnum, int* ap) {
}
*o = 0;
- } else { // standard dash-seperated font:
+ } else { // standard dash-separated font:
// get the family:
const char *x = fl_font_word(p,2); if (*x) x++; if (*x=='*') x++;