summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-03-25 02:39:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-03-25 02:39:25 +0000
commit6d65dcba88092bbff9979399a7d204bb0c88dd59 (patch)
tree1bd747547b0005c4c75d27e886ff3ab8565280c6 /FL
parent60b5a637f3bf33f1c3abd1eecbf67008e40b62d9 (diff)
Change Fl_Spinner to use double values instead of ints.
Update FLUID dependencies. The # copies spinner was just a bit too small for 100 copies. Didn't set the menu divider if there were exactly 10 files in the history. Add documentation for Fl_Spinner. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4186 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Spinner.H40
1 files changed, 20 insertions, 20 deletions
diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H
index 139079980..35a9badfb 100644
--- a/FL/Fl_Spinner.H
+++ b/FL/Fl_Spinner.H
@@ -45,10 +45,10 @@
class Fl_Spinner : public Fl_Group
{
- int value_; // Current value
- int minimum_; // Minimum value
- int maximum_; // Maximum value
- int step_; // Amount to add/subtract for up/down
+ double value_; // Current value
+ double minimum_; // Minimum value
+ double maximum_; // Maximum value
+ double step_; // Amount to add/subtract for up/down
const char *format_; // Format string
Fl_Input input_; // Input field for the value
@@ -57,11 +57,11 @@ class Fl_Spinner : public Fl_Group
down_button_; // Down button
static void sb_cb(Fl_Widget *w, Fl_Spinner *sb) {
- int v; // New value
+ double v; // New value
if (w == &(sb->input_)) {
// Something changed in the input field...
- v = atoi(sb->input_.value());
+ v = atof(sb->input_.value());
if (v < sb->minimum_) {
sb->value_ = sb->minimum_;
@@ -107,11 +107,11 @@ class Fl_Spinner : public Fl_Group
H / 2 + 2, H / 2, "@-22>") {
end();
- value_ = 1;
- minimum_ = 1;
- maximum_ = 100;
- step_ = 1;
- format_ = "%d";
+ value_ = 1.0;
+ minimum_ = 1.0;
+ maximum_ = 100.0;
+ step_ = 1.0;
+ format_ = "%.0f";
align(FL_ALIGN_LEFT);
@@ -127,11 +127,11 @@ class Fl_Spinner : public Fl_Group
const char *format() { return (format_); }
void format(const char *f) { format_ = f; update(); }
- int maxinum() const { return (maximum_); }
- void maximum(int m) { maximum_ = m; }
- int mininum() const { return (minimum_); }
- void minimum(int m) { minimum_ = m; }
- void range(int a, int b) { minimum_ = a; maximum_ = b; }
+ double maxinum() const { return (maximum_); }
+ void maximum(double m) { maximum_ = m; }
+ double mininum() const { return (minimum_); }
+ void minimum(double m) { minimum_ = m; }
+ 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);
@@ -140,8 +140,8 @@ class Fl_Spinner : public Fl_Group
down_button_.resize(X + W - H / 2 - 2, Y + H - H / 2,
H / 2 + 2, H / 2);
}
- int step() const { return (step_); }
- void step(int s) { step_ = s; }
+ double step() const { return (step_); }
+ void step(double s) { step_ = s; }
Fl_Color textcolor() const {
return (input_.textcolor());
}
@@ -160,8 +160,8 @@ class Fl_Spinner : public Fl_Group
void textsize(uchar s) {
input_.textsize(s);
}
- int value() const { return (value_); }
- void value(int v) { value_ = v; update(); }
+ double value() const { return (value_); }
+ void value(double v) { value_ = v; update(); }
};
#endif // !Fl_Spinner_H