diff options
| author | Fabien Costantini <fabien@onepost.net> | 2008-09-15 16:39:05 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2008-09-15 16:39:05 +0000 |
| commit | b8955a9ced0270ec7aa7052e6e0852cae140ca27 (patch) | |
| tree | 2432866aeda02a7c0cfa93e04a2d0c3b802a6033 /FL/Fl_Spinner.H | |
| parent | 09f3094aef152ece5bf802983d54f1642d803e0d (diff) | |
Doxygen documentation WP11 Done!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6255 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Spinner.H')
| -rw-r--r-- | FL/Fl_Spinner.H | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index 3ff59affb..3d65dfebc 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -40,10 +40,11 @@ # include <stdlib.h> -// -// Fl_Spinner widget class... -// - +/** + This widget is a combination of the input + widget and repeat buttons. The user can either type into the + input area or use the buttons to change the value. +*/ class Fl_Spinner : public Fl_Group { double value_; // Current value @@ -114,6 +115,11 @@ class Fl_Spinner : public Fl_Group public: + /** + Creates a new Fl_Spinner widget using the given position, size, + and label string. + <P>Inherited destructor Destroys the widget and any value associated with it. + */ Fl_Spinner(int X, int Y, int W, int H, const char *L = 0) : Fl_Group(X, Y, W, H, L), input_(X, Y, W - H / 2 - 2, H), @@ -140,7 +146,9 @@ class Fl_Spinner : public Fl_Group down_button_.callback((Fl_Callback *)sb_cb, this); } + /** Sets or returns the format string for the value. */ const char *format() { return (format_); } + /** Sets or returns the format string for the value. */ void format(const char *f) { format_ = f; update(); } int handle(int event) { @@ -163,13 +171,19 @@ class Fl_Spinner : public Fl_Group return Fl_Group::handle(event); } - // Speling mistaks retained for source compatibility... + /** Speling mistakes retained for source compatibility \deprecated */ double maxinum() const { return (maximum_); } + /** Sets or returns the maximum value of the widget. */ double maximum() const { return (maximum_); } + /** Sets or returns the maximum value of the widget. */ void maximum(double m) { maximum_ = m; } + /** Speling mistakes retained for source compatibility \deprecated */ double mininum() const { return (minimum_); } + /** Sets or returns the minimum value of the widget. */ double minimum() const { return (minimum_); } + /** Sets or returns the minimum value of the widget. */ void minimum(double m) { minimum_ = m; } + /** Sets the minimum and maximum values for the widget. */ void range(double a, double b) { minimum_ = a; maximum_ = b; } void resize(int X, int Y, int W, int H) { Fl_Group::resize(X,Y,W,H); @@ -179,32 +193,51 @@ class Fl_Spinner : public Fl_Group down_button_.resize(X + W - H / 2 - 2, Y + H - H / 2, H / 2 + 2, H / 2); } + /** + Sets or returns the amount to change the value when the user clicks a button. + Before setting step to a non-integer value, the spinner + type() should be changed to floating point. + */ double step() const { return (step_); } + /** See double Fl_Spinner::step() const */ void step(double s) { step_ = s; if (step_ != (int)step_) input_.type(FL_FLOAT_INPUT); else input_.type(FL_INT_INPUT); update(); } + /** Sets or Gets the color of the text in the input field. */ Fl_Color textcolor() const { return (input_.textcolor()); } + /** Sets or Gets the color of the text in the input field. */ void textcolor(Fl_Color c) { input_.textcolor(c); } + /** Sets or Gets the font of the text in the input field. */ Fl_Font textfont() const { return (input_.textfont()); } + /** Sets or Gets the font of the text in the input field. */ void textfont(Fl_Font f) { input_.textfont(f); } + /** Sets or Gets the size of the text in the input field. */ Fl_Fontsize textsize() const { return (input_.textsize()); } + /** Sets or Gets the size of the text in the input field. */ void textsize(Fl_Fontsize s) { input_.textsize(s); } + /** Sets or returns the numeric representation in the input field. + Valid values are FL_INT_INPUT and FL_FLOAT_INPUT. + The first form also changes the format() template. + Setting a new spinner type via a superclass pointer will not work. + \note type is not a virtual function. + */ uchar type() const { return (input_.type()); } + /** See uchar Fl_Spinner::type() const */ void type(uchar v) { if (v==FL_FLOAT_INPUT) { format("%.*f"); @@ -213,7 +246,13 @@ class Fl_Spinner : public Fl_Group } input_.type(v); } + /** + Sets or returns the current value of the widget. + Before setting value to a non-integer value, the spinner + type() should be changed to floating point. + */ double value() const { return (value_); } + /** See double Fl_Spinner::value() const */ void value(double v) { value_ = v; update(); } }; |
