Doxygen Documentation WP6 Done, Also completed the documentation of Help_View, Help_Dialog and cleaned up Preferences from ugly stars in comments and also removed redundant get/set text from methods doc. In this increment, we don't bother with the old dox format (comments in header). We have better things to do with our time (like about 40 mores files to doxyfy :-).

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6243 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Fabien Costantini 2008-09-14 20:00:03 +00:00
parent f49e2a7af5
commit 6645d3cb6a
8 changed files with 458 additions and 345 deletions

View File

@ -90,10 +90,11 @@ struct Fl_Help_Target
int y; // Y offset of target int y; // Y offset of target
}; };
// /**
// Fl_Help_View class... The Fl_Help_View widget displays HTML text. Most HTML 2.0
// elements are supported, as well as a primitive implementation of tables.
GIF, JPEG, and PNG images are displayed inline.
*/
class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget
{ {
enum { RIGHT = -1, CENTER, LEFT }; // Alignments enum { RIGHT = -1, CENTER, LEFT }; // Alignments
@ -187,29 +188,64 @@ public:
Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0); Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0);
~Fl_Help_View(); ~Fl_Help_View();
/** This method returns the current directory for the text in the buffer. */
const char *directory() const { if (directory_[0]) return (directory_); const char *directory() const { if (directory_[0]) return (directory_);
else return ((const char *)0); } else return ((const char *)0); }
/** This method returns the current filename for the text in the buffer. */
const char *filename() const { if (filename_[0]) return (filename_); const char *filename() const { if (filename_[0]) return (filename_);
else return ((const char *)0); } else return ((const char *)0); }
int find(const char *s, int p = 0); int find(const char *s, int p = 0);
/**
This method assigns a callback function to use when a link is
followed or a file is loaded (via
Fl_Help_View::load()) that requires a different
file or path. The callback function receives a pointer to the
Fl_Help_View widget and the URI or full pathname
for the file in question. It must return a pathname that can be
opened as a local file or NULL:</P>
<UL><PRE>
const char *fn(Fl_Widget *w, const char *uri);
</PRE></UL>
<P>The link function can be used to retrieve remote or virtual
documents, returning a temporary file that contains the actual
data. If the link function returns NULL, the value of
the Fl_Help_View widget will remain unchanged.</P>
<P>If the link callback cannot handle the URI scheme, it should
return the uri value unchanged or set the value() of the widget
before returning NULL.
*/
void link(Fl_Help_Func *fn) { link_ = fn; } void link(Fl_Help_Func *fn) { link_ = fn; }
int load(const char *f); int load(const char *f);
void resize(int,int,int,int); void resize(int,int,int,int);
/** Gets the size of the Help view */
int size() const { return (size_); } int size() const { return (size_); }
void size(int W, int H) { Fl_Widget::size(W, H); } void size(int W, int H) { Fl_Widget::size(W, H); }
/** Sets the default text color. */
void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; } void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; }
/** Returns the current default text color. */
Fl_Color textcolor() const { return (defcolor_); } Fl_Color textcolor() const { return (defcolor_); }
/** Sets the default text font. */
void textfont(Fl_Font f) { textfont_ = f; format(); } void textfont(Fl_Font f) { textfont_ = f; format(); }
/** Returns the current default text font. */
Fl_Font textfont() const { return (textfont_); } Fl_Font textfont() const { return (textfont_); }
/** Sets the default text size. */
void textsize(Fl_Fontsize s) { textsize_ = s; format(); } void textsize(Fl_Fontsize s) { textsize_ = s; format(); }
/** Gets the default text size. */
Fl_Fontsize textsize() const { return (textsize_); } Fl_Fontsize textsize() const { return (textsize_); }
/** Returns the current document title, or NULL if there is no title. */
const char *title() { return (title_); } const char *title() { return (title_); }
void topline(const char *n); void topline(const char *n);
void topline(int); void topline(int);
/** Returns the current top line in pixels. */
int topline() const { return (topline_); } int topline() const { return (topline_); }
void leftline(int); void leftline(int);
/** Gets the left position. */
int leftline() const { return (leftline_); } int leftline() const { return (leftline_); }
void value(const char *v); void value(const char *v);
/** Returns the current buffer contents. */
const char *value() const { return (value_); } const char *value() const { return (value_); }
void clear_selection(); void clear_selection();
void select_all(); void select_all();

View File

@ -30,6 +30,16 @@
#include "Fl_Button.H" #include "Fl_Button.H"
/**
<P>This subclass displays the &quot;on&quot; state by turning on a light,
rather than drawing pushed in. The shape of the &quot;light&quot;
is initially set to FL_DOWN_BOX. The color of the light when
on is controlled with selection_color(), which defaults to FL_YELLOW.
Buttons generate callbacks when they are clicked by the user. You
control exactly when and how by changing the values for type() and when().
<P ALIGN=CENTER>\image html Fl_Light_Button.gif</P>
*/
class FL_EXPORT Fl_Light_Button : public Fl_Button { class FL_EXPORT Fl_Light_Button : public Fl_Button {
protected: protected:
virtual void draw(); virtual void draw();

View File

@ -26,7 +26,7 @@
// //
/** \file /** \file
* Preferences definitions for the Fast Light Tool Kit (FLTK). Preferences definitions for the Fast Light Tool Kit (FLTK).
*/ */
#ifndef Fl_Preferences_H #ifndef Fl_Preferences_H
@ -41,29 +41,29 @@
/** /**
* <tt>Fl_Preferences </tt>provides methods to store user <tt>Fl_Preferences </tt>provides methods to store user
* settings between application starts. It is similar to the settings between application starts. It is similar to the
* Registry on WIN32 and Preferences on MacOS, and provides a Registry on WIN32 and Preferences on MacOS, and provides a
* simple configuration mechanism for UNIX. simple configuration mechanism for UNIX.
*
* <tt>Fl_Preferences </tt>uses a hierarchy to store data. It <tt>Fl_Preferences </tt>uses a hierarchy to store data. It
* bundles similar data into groups and manages entries into those bundles similar data into groups and manages entries into those
* groups as name/value pairs. groups as name/value pairs.
*
* Preferences are stored in text files that can be edited Preferences are stored in text files that can be edited
* manually. The file format is easy to read and relatively manually. The file format is easy to read and relatively
* forgiving. Preferences files are the same on all platforms. User forgiving. Preferences files are the same on all platforms. User
* comments in preference files are preserved. Filenames are unique comments in preference files are preserved. Filenames are unique
* for each application by using a vendor/application naming for each application by using a vendor/application naming
* scheme. The user must provide default values for all entries to scheme. The user must provide default values for all entries to
* ensure proper operation should preferences be corrupted or not ensure proper operation should preferences be corrupted or not
* yet exist. yet exist.
*
* Entries can be of any length. However, the size of each Entries can be of any length. However, the size of each
* preferences file should be kept under 100k for performance preferences file should be kept under 100k for performance
* reasons. One application can have multiple preferences files. reasons. One application can have multiple preferences files.
* Extensive binary data however should be stored in separate Extensive binary data however should be stored in separate
* files; see getUserdataPath(). files; see getUserdataPath().
*/ */
class FL_EXPORT Fl_Preferences class FL_EXPORT Fl_Preferences
{ {
@ -71,7 +71,7 @@ class FL_EXPORT Fl_Preferences
public: public:
/** /**
* Define the scope of the preferences. Define the scope of the preferences.
*/ */
enum Root { enum Root {
SYSTEM=0, ///< Preferences are used system-wide SYSTEM=0, ///< Preferences are used system-wide
@ -80,345 +80,345 @@ public:
// enum Type { win32, macos, fltk }; // enum Type { win32, macos, fltk };
/** /**
* The constructor creates a group that manages name/value pairs and The constructor creates a group that manages name/value pairs and
* child groups. Groups are ready for reading and writing at any time. child groups. Groups are ready for reading and writing at any time.
* The <tt>root</tt> argument is either <tt>Fl_Preferences::USER</tt> The <tt>root</tt> argument is either <tt>Fl_Preferences::USER</tt>
* or <tt>Fl_Preferences::SYSTEM</tt>. or <tt>Fl_Preferences::SYSTEM</tt>.
*
* This constructor creates the <i>base</i> instance for all This constructor creates the <i>base</i> instance for all
* following entries and reads existing databases into memory. The following entries and reads existing databases into memory. The
* <tt>vendor</tt> argument is a unique text string identifying the <tt>vendor</tt> argument is a unique text string identifying the
* development team or vendor of an application. A domain name or development team or vendor of an application. A domain name or
* an EMail address are great unique names, e.g. an EMail address are great unique names, e.g.
* "researchATmatthiasm.com" or "fltk.org". The "researchATmatthiasm.com" or "fltk.org". The
* <tt>application</tt> argument can be the working title or final <tt>application</tt> argument can be the working title or final
* name of your application. Both <tt>vendor</tt> and name of your application. Both <tt>vendor</tt> and
* <tt>application</tt> must be valid relative UNIX pathnames and <tt>application</tt> must be valid relative UNIX pathnames and
* may contain '/'s to create deeper file structures. may contain '/'s to create deeper file structures.
*
* \param[in] root can be USER or SYSTEM for user specific or system wide preferences \param[in] root can be USER or SYSTEM for user specific or system wide preferences
* \param[in] vendor unique text describing the company or author of this file \param[in] vendor unique text describing the company or author of this file
* \param[in] application unique text describing the application \param[in] application unique text describing the application
*/ */
Fl_Preferences( Root root, const char *vendor, const char *application ); Fl_Preferences( Root root, const char *vendor, const char *application );
/** /**
* This constructor is used to create or read a preferences file at an This constructor is used to create or read a preferences file at an
* arbitrary position in the file system. The file name is generated arbitrary position in the file system. The file name is generated
* as <tt><i>path</i>/<i>application</i>.prefs</tt>. If <i>application</i> as <tt><i>path</i>/<i>application</i>.prefs</tt>. If <i>application</i>
* is 0, <i>path</i> must contain the full file name. is 0, <i>path</i> must contain the full file name.
*
* \param[in] path path to the directory that contains the preferences file \param[in] path path to the directory that contains the preferences file
* \param[in] vendor unique text describing the company or author of this file \param[in] vendor unique text describing the company or author of this file
* \param[in] application unique text describing the application \param[in] application unique text describing the application
*/ */
Fl_Preferences( const char *path, const char *vendor, const char *application ); Fl_Preferences( const char *path, const char *vendor, const char *application );
/** /**
* This constructor generates a new group of preference entries This constructor generates a new group of preference entries
* inside the group or file <i>parent</i>. The <tt>group</tt> argument inside the group or file <i>parent</i>. The <tt>group</tt> argument
* identifies a group of entries. It can contain '/'s to get quick identifies a group of entries. It can contain '/'s to get quick
* access to individual elements inside the hierarchy. access to individual elements inside the hierarchy.
*
* \param[in] parent reference object for the new group \param[in] parent reference object for the new group
* \param[in] group name of the group to access (may contain '/'s) \param[in] group name of the group to access (may contain '/'s)
*/ */
Fl_Preferences( Fl_Preferences &parent, const char *group ); Fl_Preferences( Fl_Preferences &parent, const char *group );
/** /**
* \see Fl_Preferences( Fl_Preferences&, const char *group ) \see Fl_Preferences( Fl_Preferences&, const char *group )
*/ */
Fl_Preferences( Fl_Preferences*, const char *group ); Fl_Preferences( Fl_Preferences*, const char *group );
/** /**
* The destructor removes allocated resources. When used on the The destructor removes allocated resources. When used on the
* <i>base</i> preferences group, the destructor flushes all <i>base</i> preferences group, the destructor flushes all
* changes to the preferences file and deletes all internal changes to the preferences file and deletes all internal
* databases. databases.
*/ */
~Fl_Preferences(); ~Fl_Preferences();
/** /**
* Returns the number of groups that are contained within a Returns the number of groups that are contained within a
* group. group.
*
* \return 0 for no groups at all \return 0 for no groups at all
*/ */
int groups(); int groups();
/** /**
* Returns the name of the Nth group. There is no guaranteed Returns the name of the Nth group. There is no guaranteed
* order of group names. The index must be within the range given order of group names. The index must be within the range given
* by <tt>groups()</tt>. by <tt>groups()</tt>.
*
* \param[in] index number indexing the requested group \param[in] index number indexing the requested group
* \return cstring pointer to the group name \return cstring pointer to the group name
*/ */
const char *group( int index ); const char *group( int index );
/** /**
* Returns non-zero if a group with this name exists. Returns non-zero if a group with this name exists.
* Groupnames are relative to the Preferences node and can contain a path. Groupnames are relative to the Preferences node and can contain a path.
* <tt>"."</tt> describes the current node, <tt>"./"</tt> describes the topmost node. <tt>"."</tt> describes the current node, <tt>"./"</tt> describes the topmost node.
* By preceding a groupname with a <tt>"./"</tt>, its path becomes relative to the topmost node. By preceding a groupname with a <tt>"./"</tt>, its path becomes relative to the topmost node.
*
* \param[in] group name of group that is searched for \param[in] group name of group that is searched for
* \return 0 if group was not found \return 0 if group was not found
*/ */
char groupExists( const char *group ); char groupExists( const char *group );
/** /**
* Deletes a group. Deletes a group.
*
* \param[in] group name of the group to delete \param[in] group name of the group to delete
* \return 0 if call failed \return 0 if call failed
*/ */
char deleteGroup( const char *group ); char deleteGroup( const char *group );
/** /**
* Returns the number of entries (name/value pairs) in a group. Returns the number of entries (name/value pairs) in a group.
*
* \return number of entries \return number of entries
*/ */
int entries(); int entries();
/** /**
* Returns the name of an entry. There is no guaranteed order of Returns the name of an entry. There is no guaranteed order of
* entry names. The index must be within the range given by entry names. The index must be within the range given by
* <tt>entries()</tt>. <tt>entries()</tt>.
*
* \param[in] index number indexing the requested entry \param[in] index number indexing the requested entry
* \return pointer to value cstring \return pointer to value cstring
*/ */
const char *entry( int index ); const char *entry( int index );
/** /**
* Returns non-zero if an entry with this name exists. Returns non-zero if an entry with this name exists.
*
* \param[in] entry name of entry that is searched for \param[in] entry name of entry that is searched for
* \return 0 if entry was not found \return 0 if entry was not found
*/ */
char entryExists( const char *entry ); char entryExists( const char *entry );
/** /**
* Removes a single entry (name/value pair). Removes a single entry (name/value pair).
*
* \param[in] entry name of entry to delete \param[in] entry name of entry to delete
* \return 0 if deleting the entry failed \return 0 if deleting the entry failed
*/ */
char deleteEntry( const char *entry ); char deleteEntry( const char *entry );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, int value ); char set( const char *entry, int value );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, float value ); char set( const char *entry, float value );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \param[in] precision number of decimal digits to represent value \param[in] precision number of decimal digits to represent value
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, float value, int precision ); char set( const char *entry, float value, int precision );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, double value ); char set( const char *entry, double value );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \param[in] precision number of decimal digits to represent value \param[in] precision number of decimal digits to represent value
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, double value, int precision ); char set( const char *entry, double value, int precision );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, const char *value ); char set( const char *entry, const char *value );
/** /**
* Sets an entry (name/value pair). The return value indicates if there Sets an entry (name/value pair). The return value indicates if there
* was a problem storing the data in memory. However it does not was a problem storing the data in memory. However it does not
* reflect if the value was actually stored in the preferences reflect if the value was actually stored in the preferences
* file. file.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[in] value set this entry to \a value \param[in] value set this entry to \a value
* \param[in] size of data array \param[in] size of data array
* \return 0 if setting the value failed \return 0 if setting the value failed
*/ */
char set( const char *entry, const void *value, int size ); char set( const char *entry, const void *value, int size );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). (non-zero) or the default was used (0).
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \return 0 if the default value was used \return 0 if the default value was used
*/ */
char get( const char *entry, int &value, int defaultValue ); char get( const char *entry, int &value, int defaultValue );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). (non-zero) or the default was used (0).
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \return 0 if the default value was used \return 0 if the default value was used
*/ */
char get( const char *entry, float &value, float defaultValue ); char get( const char *entry, float &value, float defaultValue );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). (non-zero) or the default was used (0).
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \return 0 if the default value was used \return 0 if the default value was used
*/ */
char get( const char *entry, double &value, double defaultValue ); char get( const char *entry, double &value, double defaultValue );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). get() allocates memory of (non-zero) or the default was used (0). get() allocates memory of
* sufficient size to hold the value. The buffer must be free'd by sufficient size to hold the value. The buffer must be free'd by
* the developer using '<tt>free(value)</tt>'. the developer using '<tt>free(value)</tt>'.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \return 0 if the default value was used \return 0 if the default value was used
*/ */
char get( const char *entry, char *&value, const char *defaultValue ); char get( const char *entry, char *&value, const char *defaultValue );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). (non-zero) or the default was used (0).
* '<tt>maxSize</tt>' is the maximum length of text that will be read. '<tt>maxSize</tt>' is the maximum length of text that will be read.
* The text buffer must allow for one additional byte for a trailling zero. The text buffer must allow for one additional byte for a trailling zero.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \param[in] maxSize maximum length of value plus one byte for a trailing zero \param[in] maxSize maximum length of value plus one byte for a trailing zero
* \return 0 if the default value was used \return 0 if the default value was used
*/ */
char get( const char *entry, char *value, const char *defaultValue, int maxSize ); char get( const char *entry, char *value, const char *defaultValue, int maxSize );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). get() allocates memory of (non-zero) or the default was used (0). get() allocates memory of
* sufficient size to hold the value. The buffer must be free'd by sufficient size to hold the value. The buffer must be free'd by
* the developer using '<tt>free(value)</tt>'. the developer using '<tt>free(value)</tt>'.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \param[in] defaultSize size of default value array \param[in] defaultSize size of default value array
* \return 0 if the default value was used \return 0 if the default value was used
*/ */
char get( const char *entry, void *&value, const void *defaultValue, int defaultSize ); char get( const char *entry, void *&value, const void *defaultValue, int defaultSize );
/** /**
* Reads an entry from the group. A default value must be Reads an entry from the group. A default value must be
* supplied. The return value indicates if the value was available supplied. The return value indicates if the value was available
* (non-zero) or the default was used (0). (non-zero) or the default was used (0).
* '<tt>maxSize</tt>' is the maximum length of text that will be read. '<tt>maxSize</tt>' is the maximum length of text that will be read.
*
* \param[in] entry name of entry \param[in] entry name of entry
* \param[out] value returned from preferences or default value if none was set \param[out] value returned from preferences or default value if none was set
* \param[in] defaultValue default value to be used if no preference was set \param[in] defaultValue default value to be used if no preference was set
* \param[in] defaultSize size of default value array \param[in] defaultSize size of default value array
* \param[in] maxSize maximum length of value \param[in] maxSize maximum length of value
* \return 0 if the default value was used \return 0 if the default value was used
*
* \todo maxSize should receive the number of bytes that were read. \todo maxSize should receive the number of bytes that were read.
*/ */
char get( const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize ); char get( const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize );
/** /**
* Returns the size of the value part of an entry. Returns the size of the value part of an entry.
*
* \return size of value \return size of value
*/ */
int size( const char *entry ); int size( const char *entry );
/** /**
* Creates a path that is related to the preferences file and Creates a path that is related to the preferences file and
* that is usable for application data beyond what is covered by that is usable for application data beyond what is covered by
* Fl_Preferences. Fl_Preferences.
*
* \param[out] path buffer for user data path \param[out] path buffer for user data path
* \param[in] pathlen size of path buffer \param[in] pathlen size of path buffer
* \return 0 if path was not created or pathname can't fit into buffer \return 0 if path was not created or pathname can't fit into buffer
*/ */
char getUserdataPath( char *path, int pathlen ); char getUserdataPath( char *path, int pathlen );
/** /**
* Write all preferences to disk. This function works only with Write all preferences to disk. This function works only with
* the base preference group. This function is rarely used as the base preference group. This function is rarely used as
* deleting the base preferences flushes automatically. deleting the base preferences flushes automatically.
*/ */
void flush(); void flush();
@ -426,15 +426,15 @@ public:
// char import( const char *filename ); // char import( const char *filename );
/** /**
* 'Name' provides a simple method to create numerical or more complex 'Name' provides a simple method to create numerical or more complex
* procedural names for entries and groups on the fly. procedural names for entries and groups on the fly.
*
* Example: <tt>prefs.set(Fl_Preferences::Name("File%d",i),file[i]);</tt>. Example: <tt>prefs.set(Fl_Preferences::Name("File%d",i),file[i]);</tt>.
*
* See <tt>test/preferences.cxx</tt> as a sample for writing arrays into preferences.<p> See <tt>test/preferences.cxx</tt> as a sample for writing arrays into preferences.<p>
* 'Name' is actually implemented as a class inside Fl_Preferences. It casts 'Name' is actually implemented as a class inside Fl_Preferences. It casts
* into <tt>const char*</tt> and gets automatically destroyed after the enclosing call into <tt>const char*</tt> and gets automatically destroyed after the enclosing call
* ends. ends.
*/ */
class FL_EXPORT Name { class FL_EXPORT Name {
@ -443,18 +443,18 @@ public:
public: public:
/** /**
* Create a numerical name. Create a numerical name.
*/ */
Name( unsigned int n ); Name( unsigned int n );
/** /**
* Create a name using 'printf' style formatting. Create a name using 'printf' style formatting.
*/ */
Name( const char *format, ... ); Name( const char *format, ... );
/** /**
* Return the Name as a c-string. Return the Name as a c-string.
* \internal \internal
*/ */
operator const char *() { return data_; } operator const char *() { return data_; }
~Name(); ~Name();

View File

@ -14,7 +14,7 @@ In Progress Work List (add your WP and name here):
- WP3 (engelsman) - WP3 (engelsman)
- WP4 (Fabien) DONE - WP4 (Fabien) DONE
- WP5 (Fabien) DONE - WP5 (Fabien) DONE
- WP6 (Fabien) - WP6 (Fabien) DONE
- WP7 - WP7
- WP8 - WP8
- WP9 - WP9
@ -156,10 +156,6 @@ widgets.html
Enumerations.H (Albrecht) work in progress ! Enumerations.H (Albrecht) work in progress !
Fl_Adjuster.H Fl_Adjuster.H
Fl_Adjuster.cxx Fl_Adjuster.cxx
Fl_BMP_Image.H
Fl_BMP_Image.cxx
Fl_Bitmap.H
Fl_Bitmap.cxx
Fl_Box.H Fl_Box.H
Fl_Box.cxx Fl_Box.cxx
Fl_Button.H Fl_Button.H
@ -185,31 +181,18 @@ Fl_Float_Input.H
Fl_Font.H Fl_Font.H
Fl_FormsBitmap.H Fl_FormsBitmap.H
Fl_FormsPixmap.H Fl_FormsPixmap.H
Fl_GIF_Image.H
Fl_GIF_Image.cxx
Fl_Gl_Choice.H Fl_Gl_Choice.H
Fl_Gl_Choice.cxx Fl_Gl_Choice.cxx
Fl_Help_Dialog.H
Fl_Help_Dialog.cxx
Fl_Help_View.H
Fl_Help_View.cxx
Fl_Hold_Browser.H
Fl_Hor_Fill_Slider.H Fl_Hor_Fill_Slider.H
Fl_Hor_Nice_Slider.H Fl_Hor_Nice_Slider.H
Fl_Hor_Slider.H Fl_Hor_Slider.H
Fl_Hor_Value_Slider.H Fl_Hor_Value_Slider.H
Fl_Image.H
Fl_Image.cxx
Fl_Input.H Fl_Input.H
Fl_Input.cxx Fl_Input.cxx
Fl_Input_.H Fl_Input_.H
Fl_Input_.cxx Fl_Input_.cxx
Fl_Input_Choice.H Fl_Input_Choice.H
Fl_Int_Input.H Fl_Int_Input.H
Fl_JPEG_Image.H
Fl_JPEG_Image.cxx
Fl_Light_Button.H
Fl_Light_Button.cxx
Fl_Line_Dial.H Fl_Line_Dial.H
Fl_Menu.H Fl_Menu.H
Fl_Menu.cxx Fl_Menu.cxx
@ -232,17 +215,8 @@ Fl_Multiline_Output.H
Fl_Nice_Slider.H Fl_Nice_Slider.H
Fl_Object.H Fl_Object.H
Fl_Output.H Fl_Output.H
Fl_PNG_Image.H
Fl_PNG_Image.cxx
Fl_PNM_Image.H
Fl_PNM_Image.cxx
Fl_Pixmap.H
Fl_Pixmap.cxx
Fl_Preferences.H
Fl_Preferences.cxx
Fl_Progress.H Fl_Progress.H
Fl_Progress.cxx Fl_Progress.cxx
Fl_RGB_Image.H
Fl_Radio_Button.H Fl_Radio_Button.H
Fl_Radio_Light_Button.H Fl_Radio_Light_Button.H
Fl_Radio_Round_Button.H Fl_Radio_Round_Button.H
@ -261,8 +235,6 @@ Fl_Scrollbar.H
Fl_Scrollbar.cxx Fl_Scrollbar.cxx
Fl_Secret_Input.H Fl_Secret_Input.H
Fl_Select_Browser.H Fl_Select_Browser.H
Fl_Shared_Image.H
Fl_Shared_Image.cxx
Fl_Simple_Counter.H Fl_Simple_Counter.H
Fl_Slider.H Fl_Slider.H
Fl_Slider.cxx Fl_Slider.cxx
@ -298,11 +270,7 @@ Fl_Window_hotspot.cxx
Fl_Window_iconize.cxx Fl_Window_iconize.cxx
Fl_Wizard.H Fl_Wizard.H
Fl_Wizard.cxx Fl_Wizard.cxx
Fl_XBM_Image.H
Fl_XBM_Image.cxx
Fl_XColor.H Fl_XColor.H
Fl_XPM_Image.H
Fl_XPM_Image.cxx
Fl_abort.cxx Fl_abort.cxx
Fl_get_key.cxx Fl_get_key.cxx
Fl_get_key_mac.cxx Fl_get_key_mac.cxx

119
src/Fl_Help_Dialog_Dox.cxx Normal file
View File

@ -0,0 +1,119 @@
//
// "$Id"
//
// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// Fl_Help_Dialog (autogenerated class) doxygen documentation placeholder
/** \class Fl_Help_Dialog
The Fl_Help_Dialog widget displays a standard help dialog window
using the Fl_Help_View widget.
<CENTER>\image html Fl_Help_Dialog.gif</CENTER>
*/
/** \fn Fl_Help_Dialog::Fl_Help_Dialog()
The constructor creates the dialog pictured above.*/
/** \fn Fl_Help_Dialog::~Fl_Help_Dialog()
The destructor destroys the widget and frees all memory that has been
allocated for the current file.
*/
/** \fn void Fl_Help_Dialog::hide()
Hides the Fl_Help_Dialog window.*/
/** \fn void Fl_Help_Dialog::load(const char *f)
Loads the specified HTML file into the Fl_Help_View widget.
The filename can also contain a target name ("filename.html#target").
*/
/** \fn void Fl_Help_Dialog::position(int x, int y)
Set the screen position of the dialog.*/
/** \fn void Fl_Help_Dialog::resize(int xx, int yy, int ww, int hh)
Change the position and size of the dialog.*/
/** \fn void Fl_Help_Dialog::show()
Shows the Fl_Help_Dialog window.*/
/** \fn void Fl_Help_Dialog::textsize(uchar s)
Sets or gets the default text size for the help view.*/
/** \fn uchar Fl_Help_Dialog::textsize()
Sets or gets the default text size for the help view.*/
/** \fn void Fl_Help_Dialog::topline(const char *n)
Sets the top line in the Fl_Help_View widget to the named or
numbered line.
*/
/** \fn void Fl_Help_Dialog::topline(int n)
Sets the top line in the Fl_Help_View widget to the named or
numbered line.
*/
/** \fn void Fl_Help_Dialog::value(const char *v)
The first form sets the current buffer to the string provided and
reformats the text. It also clears the history of the "back" and
"forward" buttons. The second form returns the current buffer contents.
*/
/** \fn const char *Fl_Help_Dialog::value() const
The first form sets the current buffer to the string provided and
reformats the text. It also clears the history of the "back" and
"forward" buttons. The second form returns the current buffer contents.
*/
/** \fn int Fl_Help_Dialog::visible()
Returns 1 if the Fl_Help_Dialog window is visible.*/
/** \fn int Fl_Help_Dialog::x()
Returns the position and size of the help dialog.*/
/** \fn int Fl_Help_Dialog::y()
Returns the position and size of the help dialog.*/
/** \fn int Fl_Help_Dialog::w()
Returns the position and size of the help dialog.*/
/** \fn int Fl_Help_Dialog::h()
Returns the position and size of the help dialog.*/
/** \fn void Fl_Help_Dialog::show()
Shows the main Help Dialog Window
Delegates call to encapsulated window_ void Fl_Window::show() method */
/** \fn void Fl_Help_Dialog::show(int argc, char **argv)
Shows the main Help Dialog Window
Delegates call to encapsulated window_ void Fl_Window::show(int argc, char **argv) instance method */
/** \fn void Fl_Help_Dialog::textsize(Fl_Fontsize s)
Sets the internal Fl_Help_View instance text size.
Delegates call to encapsulated view_ void Fl_Help_View::textsize(Fl_Fontsize s) instance method */
//
// End of "$Id".
//

View File

@ -1002,10 +1002,8 @@ Fl_Help_View::draw()
} }
//
// 'Fl_Help_View::find()' - Find the specified string...
//
/** Find the specified string s at starting position p, return the matching pos or -1 if not found */
int // O - Matching position or -1 if not found int // O - Matching position or -1 if not found
Fl_Help_View::find(const char *s, // I - String to find Fl_Help_View::find(const char *s, // I - String to find
int p) // I - Starting position int p) // I - Starting position
@ -2729,12 +2727,13 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp)
leftline(0); leftline(0);
} }
/** Removes the current text selection. */
void Fl_Help_View::clear_selection() void Fl_Help_View::clear_selection()
{ {
if (current_view==this) if (current_view==this)
clear_global_selection(); clear_global_selection();
} }
/** Selects All the text in the view. */
void Fl_Help_View::select_all() void Fl_Help_View::select_all()
{ {
clear_global_selection(); clear_global_selection();
@ -3007,10 +3006,10 @@ Fl_Help_View::handle(int event) // I - Event to handle
return (Fl_Group::handle(event)); return (Fl_Group::handle(event));
} }
// /**
// 'Fl_Help_View::Fl_Help_View()' - Build a Fl_Help_View widget. The constructor creates the Fl_Help_View widget at the specified
// position and size.
*/
Fl_Help_View::Fl_Help_View(int xx, // I - Left position Fl_Help_View::Fl_Help_View(int xx, // I - Left position
int yy, // I - Top position int yy, // I - Top position
int ww, // I - Width in pixels int ww, // I - Width in pixels
@ -3078,6 +3077,10 @@ Fl_Help_View::Fl_Help_View(int xx, // I - Left position
// //
Fl_Help_View::~Fl_Help_View() Fl_Help_View::~Fl_Help_View()
/**
The destructor destroys the widget and frees all memory that has been
allocated for the current file.
*/
{ {
clear_selection(); clear_selection();
free_data(); free_data();
@ -3090,6 +3093,7 @@ Fl_Help_View::~Fl_Help_View()
int // O - 0 on success, -1 on error int // O - 0 on success, -1 on error
Fl_Help_View::load(const char *f)// I - Filename to load (may also have target) Fl_Help_View::load(const char *f)// I - Filename to load (may also have target)
/** This method loads the specified file or URL.*/
{ {
FILE *fp; // File to read from FILE *fp; // File to read from
long len; // Length of file long len; // Length of file
@ -3211,10 +3215,7 @@ Fl_Help_View::resize(int xx, // I - New left position
} }
// /** Scroll the text to the indicated position, given a named destination */
// 'Fl_Help_View::topline()' - Set the top line to the named target.
//
void void
Fl_Help_View::topline(const char *n) // I - Target name Fl_Help_View::topline(const char *n) // I - Target name
{ {
@ -3235,10 +3236,8 @@ Fl_Help_View::topline(const char *n) // I - Target name
} }
//
// 'Fl_Help_View::topline()' - Set the top line by number.
//
/** Scroll the text to the indicated position, given a pixel line. */
void void
Fl_Help_View::topline(int t) // I - Top line number Fl_Help_View::topline(int t) // I - Top line number
{ {
@ -3260,10 +3259,9 @@ Fl_Help_View::topline(int t) // I - Top line number
} }
//
// 'Fl_Help_View::leftline()' - Set the left position.
//
/** Sets the left position. */
void void
Fl_Help_View::leftline(int l) // I - Left position Fl_Help_View::leftline(int l) // I - Left position
{ {
@ -3283,10 +3281,7 @@ Fl_Help_View::leftline(int l) // I - Left position
} }
// /** Sets the current help text buffer to the string provided and reformats the text. */
// 'Fl_Help_View::value()' - Set the help text directly.
//
void void
Fl_Help_View::value(const char *v) // I - Text to view Fl_Help_View::value(const char *v) // I - Text to view
{ {

View File

@ -157,6 +157,11 @@ int Fl_Light_Button::handle(int event) {
} }
} }
/**
Creates a new Fl_Light_Button widget using the given
position, size, and label string.
<P>The destructor deletes the check button.
*/
Fl_Light_Button::Fl_Light_Button(int X, int Y, int W, int H, const char* l) Fl_Light_Button::Fl_Light_Button(int X, int Y, int W, int H, const char* l)
: Fl_Button(X, Y, W, H, l) { : Fl_Button(X, Y, W, H, l) {
type(FL_TOGGLE_BUTTON); type(FL_TOGGLE_BUTTON);

View File

@ -212,9 +212,7 @@ char Fl_Preferences::deleteEntry( const char *key )
} }
/**
* read an entry from the group
*/
char Fl_Preferences::get( const char *key, int &value, int defaultValue ) char Fl_Preferences::get( const char *key, int &value, int defaultValue )
{ {
const char *v = node->get( key ); const char *v = node->get( key );
@ -223,9 +221,7 @@ char Fl_Preferences::get( const char *key, int &value, int defaultValue )
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, int value ) char Fl_Preferences::set( const char *key, int value )
{ {
sprintf( nameBuffer, "%d", value ); sprintf( nameBuffer, "%d", value );
@ -234,9 +230,7 @@ char Fl_Preferences::set( const char *key, int value )
} }
/**
* read an entry from the group
*/
char Fl_Preferences::get( const char *key, float &value, float defaultValue ) char Fl_Preferences::get( const char *key, float &value, float defaultValue )
{ {
const char *v = node->get( key ); const char *v = node->get( key );
@ -245,9 +239,7 @@ char Fl_Preferences::get( const char *key, float &value, float defaultValue )
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, float value ) char Fl_Preferences::set( const char *key, float value )
{ {
sprintf( nameBuffer, "%g", value ); sprintf( nameBuffer, "%g", value );
@ -256,9 +248,7 @@ char Fl_Preferences::set( const char *key, float value )
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, float value, int precision ) char Fl_Preferences::set( const char *key, float value, int precision )
{ {
sprintf( nameBuffer, "%.*g", precision, value ); sprintf( nameBuffer, "%.*g", precision, value );
@ -267,9 +257,7 @@ char Fl_Preferences::set( const char *key, float value, int precision )
} }
/**
* read an entry from the group
*/
char Fl_Preferences::get( const char *key, double &value, double defaultValue ) char Fl_Preferences::get( const char *key, double &value, double defaultValue )
{ {
const char *v = node->get( key ); const char *v = node->get( key );
@ -278,9 +266,7 @@ char Fl_Preferences::get( const char *key, double &value, double defaultValue )
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, double value ) char Fl_Preferences::set( const char *key, double value )
{ {
sprintf( nameBuffer, "%g", value ); sprintf( nameBuffer, "%g", value );
@ -289,9 +275,7 @@ char Fl_Preferences::set( const char *key, double value )
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, double value, int precision ) char Fl_Preferences::set( const char *key, double value, int precision )
{ {
sprintf( nameBuffer, "%.*g", precision, value ); sprintf( nameBuffer, "%.*g", precision, value );
@ -373,9 +357,7 @@ char Fl_Preferences::get( const char *key, char *&text, const char *defaultValue
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, const char *text ) char Fl_Preferences::set( const char *key, const char *text )
{ {
const char *s = text ? text : ""; const char *s = text ? text : "";
@ -474,9 +456,7 @@ char Fl_Preferences::get( const char *key, void *&data, const void *defaultValue
} }
/**
* set an entry (name/value pair)
*/
char Fl_Preferences::set( const char *key, const void *data, int dsize ) char Fl_Preferences::set( const char *key, const void *data, int dsize )
{ {
char *buffer = (char*)malloc( dsize*2+1 ), *d = buffer;; char *buffer = (char*)malloc( dsize*2+1 ), *d = buffer;;