Fix indentation and remove trailing white space.

This does not fully apply the FLTK coding standard, but makes it more
consistent in that indentation is done with tabs as much as possible.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10300 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser
2014-09-12 09:08:41 +00:00
parent 2ac54f6aca
commit 21ae6c2903

View File

@@ -43,7 +43,7 @@
\image latex Fl_Spinner.png "Fl_Spinner widget" width=6cm
*/
class FL_EXPORT Fl_Spinner : public Fl_Group {
double value_; // Current value
double minimum_; // Minimum value
double maximum_; // Maximum value
@@ -92,26 +92,26 @@ private:
sb->update();
}
sb->set_changed();
sb->set_changed();
sb->do_callback();
}
void update() {
char s[255]; // Value string
if (format_[0]=='%'&&format_[1]=='.'&&format_[2]=='*') { // precision argument
// this code block is a simplified version of
// Fl_Valuator::format() and works well (but looks ugly)
int c = 0;
char temp[64], *sp = temp;
sprintf(temp, "%.12f", step_);
while (*sp) sp++;
sp--;
while (sp>temp && *sp=='0') sp--;
while (sp>temp && (*sp>='0' && *sp<='9')) { sp--; c++; }
if (format_[0]=='%'&&format_[1]=='.'&&format_[2]=='*') { // precision argument
// this code block is a simplified version of
// Fl_Valuator::format() and works well (but looks ugly)
int c = 0;
char temp[64], *sp = temp;
sprintf(temp, "%.12f", step_);
while (*sp) sp++;
sp--;
while (sp>temp && *sp=='0') sp--;
while (sp>temp && (*sp>='0' && *sp<='9')) { sp--; c++; }
sprintf(s, format_, c, value_);
} else {
} else {
sprintf(s, format_, value_);
}
}
input_.value(s);
}
@@ -172,9 +172,9 @@ private:
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.
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 */
@@ -209,29 +209,29 @@ private:
input_.textsize(s);
}
/** Gets the numeric representation in the input field.
\see Fl_Spinner::type(uchar)
\see Fl_Spinner::type(uchar)
*/
uchar type() const { return (input_.type()); }
/** Sets the numeric representation in the input field.
Valid values are FL_INT_INPUT and FL_FLOAT_INPUT.
Also changes the format() template.
Setting a new spinner type via a superclass pointer will not work.
\note type is not a virtual function.
\note type is not a virtual function.
*/
void type(uchar v) {
if (v==FL_FLOAT_INPUT) {
format("%.*f");
} else {
format("%.0f");
}
input_.type(v);
}
void type(uchar v) {
if (v==FL_FLOAT_INPUT) {
format("%.*f");
} else {
format("%.0f");
}
input_.type(v);
}
/** Gets the current value of the widget. */
double value() const { return (value_); }
/**
Sets the current value of the widget.
Before setting value to a non-integer value, the spinner
type() should be changed to floating point.
Before setting value to a non-integer value, the spinner
type() should be changed to floating point.
*/
void value(double v) { value_ = v; update(); }
/**